Commit Graph

251 Commits

Author SHA1 Message Date
Mikhail Pyltsin
8efd59f2ec [java-inspections] IDEA-331308 Similar logs inspection
GitOrigin-RevId: 33b43026b651dfee14eaa91e978c0c0c2b793ba2
2024-01-08 11:12:08 +00:00
Bart van Helvert
3a5d36c5f7 [jvm] Add test case for Java API usage inspection
Adds another test case for when a method has a certain since version but its super method has a lower since version.

GitOrigin-RevId: 5962a0f2d4549b6729fe7c303798bc04b575e5c5
2024-01-05 20:01:46 +00:00
Mikhail Pyltsin
384af015b4 [java-console] IDEA-331307 Provide navigation for logs for jvm languages
GitOrigin-RevId: c827937afc1da8cdfe1cc7c1297093df284ecdc8
2024-01-03 12:11:30 +00:00
Bart van Helvert
e43e1dd876 [jvm] Clean up SuppressionAnnotationInspection
Improves inspection message and code structure. #IDEA-337709

GitOrigin-RevId: cc1fd2482724ea235a301b770abbcc02d1fcf6cc
2023-12-14 14:04:06 +00:00
Bart van Helvert
316a5db6c8 [jvm] Remove unnecessary extension point for annotation suppressions
The extension point was used to run logic for various suppression annotations. Instead of running different logic based on the language, we can run the same logic for all languages. #IDEA-337709

GitOrigin-RevId: 7c51e3774d8d0c5232d37b817d1086ba4ebdda57
2023-12-14 14:04:06 +00:00
Bart van Helvert
58298dd53c [jvm] Move JUnit inspections into JUnit plugin
#IDEA-334017 Fixed

GitOrigin-RevId: 919fb236aeb44c192944eae2bae8da621e5a0e74
2023-12-13 03:15:25 +00:00
Georgii Ustinov
0ee266b325 Get rid of resolver in Java Formatter
IDEA-235747

GitOrigin-RevId: b085d98a222ffdf93f46ff9ec75ee7a351b9ee01
2023-12-04 09:06:58 +00:00
Aleksey Dobrynin
ff17b6dabf [java, inspection, fix] IDEA-338231
- Rename an inspection class
- Add a code example in the documentation
- Support RunWith in interfaces
- Visit classes instead of annotations

GitOrigin-RevId: 2cbbe679fc77e81838cae02a6f4f4242a0e028d5
2023-12-01 11:54:54 +00:00
Karol Lewandowski
ad246cb491 IDEA-337709: Reimplement SuppressionAnnotationInspection to UAST
GitOrigin-RevId: 5384975e4786fbc34114065e117f66d930435621
2023-11-27 18:29:28 +00:00
Aleksey Dobrynin
52eece9283 [java, inspection] Detect inherited @RunWith annotation in JUnit 4 (IDEA-338231)
GitOrigin-RevId: a1b03ddd5904957286576b281aa97c6947c261e8
2023-11-23 12:15:32 +00:00
Bart van Helvert
d78141974f [jvm] Support go to related symbol for method source
#IDEA-325969 Fixed

GitOrigin-RevId: 7ae47a6e558b484cf397c7192abf66dc6eebdf22
2023-11-07 20:10:45 +00:00
Georgii Ustinov
26f97f459b [JUnit] Restrict the visibility of test classes and methods after migrating JUnit4 -> JUnit5
Improve 'Migrate to JUnit 5' action ^IDEA-237072 fixed

GitOrigin-RevId: 6bd0f4ccad30aad91b52a02b065c650cd27e4d02
2023-11-01 09:29:33 +00:00
Georgii Ustinov
6233b72cb6 [jvm] Fix false-positive UrlHashCodeInspection
Previously, this inspection highlighted the cases like `url.equals(null)` or `url == null`. This commit fixes this behavior

^IDEA-332645 fixed

GitOrigin-RevId: 7448489db08e5bbf75dfc1582788bc1f78f923f2
2023-10-26 15:23:03 +00:00
Mikhail Pyltsin
de1dca93d3 [uast-inspections] IDEA-335116 - Non-safe string, support qualifier cleaners
GitOrigin-RevId: 5bd6b1c53c32e096a7a20e7cdd23b2e39bc19fea
2023-10-17 15:20:05 +00:00
Mikhail Pyltsin
e7c4d58f83 [uast-inspections] IDEA-334967 Non-safe string: always true/false condition in taint inference in other methods
- support if in other methods

GitOrigin-RevId: 1012172402ed8ea0961b1ef552cdfb2f37a7d49e
2023-10-17 12:25:09 +00:00
Mikhail Pyltsin
0e4c75ac6d [uast-inspections] IDEA-334946 Non-safe string: always true/false condition in taint inference for ternary operators
- support ternary

GitOrigin-RevId: 3d9081be20e5e9ff1546098fc0c84b942c77b53f
2023-10-17 11:54:55 +00:00
Bart van Helvert
ba513a4d88 [jvm] Rename shared.testFramework to internal.TestFramework
To better highlight that this test framework is for internal usage only. #IDEA-334017

GitOrigin-RevId: c491de2411cdffd6eee3e97a6273982560572f4b
2023-10-11 23:39:50 +00:00
Bart van Helvert
4845f7164a [jvm] Migrate JVM inspection tests to JDK 21 language and SDK
GitOrigin-RevId: 477fad876b95025bb48419f2510d597da6dbc9bd
2023-10-06 21:56:09 +00:00
Bart van Helvert
79bce8459f [jvm] Split test framework into testBase and testFramework
Test bases should only be used in test from jvm-analysis module, the test framework can be shared in multiple modules.

GitOrigin-RevId: cbe47d864eb2c1f3f89189022d76333ed3fe3601
2023-10-06 15:10:52 +00:00
Bart van Helvert
212683a78c [jvm] Disable assertions between inconvertible types on throwables
#IDEA-331109

GitOrigin-RevId: b7f9a705ae3cce08880316d7d7a2ff0a92668bf9
2023-10-03 12:14:41 +00:00
Bart van Helvert
2c7dcce36f [jvm] Support AssertJ first in type checker
#IDEA-331109 Fixed

GitOrigin-RevId: b4b81e030b804714b32979954ac8779b29dc52c9
2023-10-03 12:14:40 +00:00
Mikhail Pyltsin
b4c698f763 [uast-inspections] IDEA-333480 support setMessage for slf4j fluent api
GitOrigin-RevId: 404bff9bebe88169f44588e209fb3eeba09eaab5
2023-10-02 10:48:06 +00:00
Mikhail Pyltsin
46d30a46d9 [uast-inspection] IDEA-333003 support fluent api for slf4j
- now `addArgument` is taken into account and complex cases are skipped

GitOrigin-RevId: acbdd50da7199f24938f76d3a84d0d17857b261e
2023-09-29 11:45:33 +00:00
Georgii Ustinov
883f800574 [Code Analysis. Inspection] IDEA-234302 System.getProperty(str) inspection implementation. Review Refactor
GitOrigin-RevId: e793b2306586a3ea6e12691b5d887fe1cf0b2913
2023-09-22 13:59:38 +00:00
Mikhail Pyltsin
db15bf9aa3 [uast-inspections] IDEA-332774 Non-safe string: always true/false condition in taint inference
-clean up

GitOrigin-RevId: 6d9649d0f63d9b93de0f33837d008d4a1c10624e
2023-09-22 09:38:20 +00:00
Georgii Ustinov
0382910261 [Code Analysis. Inspection] IDEA-234302 System.getProperty(str) inspection implementation.
Call to System.getProperty(str) could be simplified for certain predefined constants. Implementation includes inspection and quickfix.

GitOrigin-RevId: 8b7edf6c4a6849062535ded1c49e733b8fed05a8
2023-09-21 19:51:28 +00:00
Mikhail Pyltsin
403f28bc16 [uast-inspections] IDEA-332774 Non-safe string: always true/false condition in taint inference
-support simple cases in if condition

GitOrigin-RevId: 93071f1a55fbf9e5a0d7f0798497e43781ed44ec
2023-09-21 16:22:39 +00:00
Mikhail Pyltsin
5c632ee060 [uast-inspections] Non-safe string: configuration for method with context awareness
GitOrigin-RevId: 108a4e8f5beaa951dbe1be64c578d39b7a82163b
2023-09-20 18:30:13 +00:00
Bart van Helvert
cc61bc25c7 [jvm] Convert TestCaseWithNoTestMethods inspection to JVM
#IDEA-331938 Fixed

GitOrigin-RevId: 9ecdc3d6e03d52cb54865067483b4c97e29d3236
2023-09-10 16:39:57 +00:00
Mikhail Pyltsin
b389c297de [uast-inspections] IDEA-331248 Non-safe string: allow static inter-analysis for taint inference
- support if statements during analysis

GitOrigin-RevId: cebd7172ef8964bf557c15662e4b48acb7f48fb0
2023-09-04 19:02:12 +00:00
Mikhail Pyltsin
ee4b8fa0ef [uast-inspections] IDEA-331248 Non-safe string: allow static inter-analysis for taint inference
- added new inner option to check static methods
- configurations for methods and fields are separated
- clarify some comments

GitOrigin-RevId: 9a4287b3b5045d43c88f8d2fb515056fecbc3768
2023-09-01 17:38:36 +00:00
Mikhail Pyltsin
b04e91dc99 [uast-inspections] SourceToSinkFlowInspection
- added options to correct max depth of analysis.

GitOrigin-RevId: 9aa6b396bce0873ab8bc97e91109930ba2571729
2023-08-07 15:23:14 +00:00
Mikhail Pyltsin
c80e4efe26 [java-inspections] IDEA-326706 Filter guards for logs if any of calls are accepted
GitOrigin-RevId: 201056e9b3ea856df391fc4aba8d01605cdb053f
2023-08-03 08:52:43 +00:00
Mikhail Pyltsin
aabad19c45 [java-inspections] IDEA-327142 Support not only String for Taint analyzer. Added table
GitOrigin-RevId: 8cf47f40490dd82e20e75eaae682ac218f019614
2023-08-02 11:16:43 +00:00
Mikhail Pyltsin
f9a7414857 [java-inspections] IDEA-327142 Support not only String for Taint analyzer
GitOrigin-RevId: af27a08d29067d8c02c537e74e86851182ba4266
2023-08-01 15:20:00 +00:00
Mikhail Pyltsin
f79ca70162 IJ-CR-111985 [uast-inspection] IDEA-326309 Process context for unsafe string
Narrow visibility scope for taint value context

GitOrigin-RevId: 433ba3ce28840ad344cfe53c8b52df354ae7014e
2023-07-27 10:39:38 +00:00
Mikhail Pyltsin
e67ee5687e [uast-inspection] IDEA-326309 Process context for unsafe string
GitOrigin-RevId: d8caee212e7c3dbb89221bab92d988a001f9406e
2023-07-26 15:10:00 +00:00
Mikhail Pyltsin
2d060a17a9 [uast-inspection] IDEA-326308
Add an option to report only unsafe strings from the "Non-safe string is passed to safe method"

GitOrigin-RevId: 5f889b3cc5aaac9f98a6a335da600b0759f56c5c
2023-07-25 19:09:29 +00:00
Bart van Helvert
975be82c24 [jvm] Consider register extensions when checking for parameter resolver context
#IDEA-324687 Fixed

GitOrigin-RevId: 830b61dfdda85ff5c7af79d8bbf7a9f9936bc92d
2023-07-14 10:26:45 +00:00
Bart van Helvert
27244ec296 [jvm] Consider JUnit version when warning about empty source invalid type
#IDEA-322880 Fixed

GitOrigin-RevId: 3c6bef500ded79076ed07b5f741d2525e790a6ee
2023-07-11 22:57:39 +00:00
Tagir Valeev
3a7196c111 [uast-inspections] JavaObsoleteApiUsageInspectionTest: remove false-positive on method references
IDEA-323970 Some method references are incorrectly highlighted as 'Obsolete API'

GitOrigin-RevId: 5f44caad2fbc1a598e0e852e7a90d4fb50d8a4ed
2023-07-08 18:05:37 +00:00
Bart van Helvert
cf40811d53 [test] Set test inspections to error level
Makes test inspections that report code that will give a guaranteed runtime error be at error level by default.

GitOrigin-RevId: 5fd05b4e8e9f9f1f80fa87280eb8166e6dd497f6
2023-06-23 17:26:28 +00:00
Bart van Helvert
0c29cc71a9 [jvm] Fix doc on JavaApiUsageInspectionWithCustomMockJdkTest
GitOrigin-RevId: 84631ed340485fd2a1b6996de3e01d5f00e81c0a
2023-06-22 15:54:47 +00:00
Anna Kozlova
b6f1aecde2 [uast visitor] optimization: convert to uast only while in qualified reference
otherwise we might have converted the whole file in the hope to find import statement

GitOrigin-RevId: e1d8d94b190e720509723ac8c082f0cc997c112a
2023-06-14 20:59:15 +00:00
Bart van Helvert
b74b1da1cb [jvm] Fix false positives on @EmptySource annotated methods
Fixes an issue where Collection itself wasn't recognised as a valid type and inheritors with a non-public zero-arg constructor were also falsely recognised as a valid type. #IDEA-313866

GitOrigin-RevId: 614fb604356b249aeae3e551286863f142c31ecb
2023-06-14 14:44:09 +00:00
Mikhail Pyltsin
aee9ccff9b [java-inspections] IDEA-322306 Skip when arguments are empty. LoggingPlaceholderCountMatchesArgumentCountInspection
GitOrigin-RevId: 1420c689a98061e32581d28bac63f853ecf2d32a
2023-06-12 15:32:07 +00:00
Bart van Helvert
dc08ff6740 [junit] Support new EmptySource types
Support new types supported when providing an `@EmptySource` in JUnit 5.10.0. #IDEA-313866 Fixed

GitOrigin-RevId: 31d86ceb097aec10d00d07ae6ba4dd2710c65ee1
2023-06-12 09:08:31 +00:00
Mikhail Pyltsin
525f0b3737 [java-inspections] IDEA-271540 support configuration without annotations
GitOrigin-RevId: e9222258457e8cb18e62684b1fc6e4499126d15b
2023-06-09 20:45:23 +00:00
Daniil Ovchinnikov
292c324976 IDEA-322044 highlight reference if the highlight element is a reference
GitOrigin-RevId: 0102670574bd4f50a6effe4dcc743bf84ce6533d
2023-06-08 16:45:35 +00:00
Mikhail Pyltsin
230662f4db [java-inspections] IDEA-321902 support loop for TaintAnalyzer
GitOrigin-RevId: d31d9f304f2d364fec5fb73dfbfdcf934a858243
2023-06-07 12:18:45 +00:00