Commit Graph

239 Commits

Author SHA1 Message Date
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
Mikhail Pyltsin
726973077d IJ-CR-107817 [java-inspections] IDEA-271540 Get rid of reading outside files, add support static qualifier
GitOrigin-RevId: c2bf552868caae235d62212cbb2b43d2473f46b2
2023-05-31 12:40:02 +00:00
Mikhail Pyltsin
7c7572d4f3 Revert "IJ-CR-107817 [java-inspections] IDEA-271540 Get rid of reading outside files, add support static qualifier"
This reverts commit f0e3ed6d04728b2446ba4058d58a1e286952013d.

GitOrigin-RevId: 48e3471ac324e1c1d1b774b84e21595f7ba04be0
2023-05-30 19:43:39 +00:00
Mikhail Pyltsin
c37ef4b599 IJ-CR-107817 [java-inspections] IDEA-271540 Get rid of reading outside files, add support static qualifier
GitOrigin-RevId: 93972fc5afa30eb2063d7b8c5a01b9a91adf2caf
2023-05-30 17:48:41 +00:00
Mikhail Pyltsin
cb5c4e6c21 [java-inspections] IDEA-271540 Get rid of reading outside files
GitOrigin-RevId: f4f050d70dd90e1185c7cb46dba4fb12b7a0f2ba
2023-05-29 13:37:14 +00:00
Bart van Helvert
9ea8e1f558 [jvm] Don't warn about since API usage in comments
#IDEA-320735 Fixed

GitOrigin-RevId: 68050bbca10b31cc0a592fce30e7e30c8a92366b
2023-05-20 13:17:13 +00:00
Mikhail Pyltsin
ec31ff40ac [java-inspections] IDEA-319998 base support akka for LoggingPlaceholderCountMatchesArgumentCount
GitOrigin-RevId: 83c106f1d93921e7476f2c4dcfc09aca46e8948b
2023-05-10 12:15:34 +00:00
Mikhail Pyltsin
093c7887c4 [java-inspections] IDEA-271540 fix tests
GitOrigin-RevId: 61cf311514002058d81a1b6e0016660e355be985
2023-05-09 16:51:53 +00:00
Mikhail Pyltsin
0fde0c0521 [java-inspections] IDEA-271540 general improvements for tainted analysis
GitOrigin-RevId: b6b84c387f260a3de7615ddff6d8ac1072849bcf
2023-05-09 13:35:42 +00:00
Mikhail Pyltsin
4edcb035e7 [java-inspections] IDEA-282916 Improve tainted analysis, support local methods
GitOrigin-RevId: 27871a7bbab9f093863d110711f7bb67c9b09fd9
2023-05-05 16:37:52 +00:00
Mikhail Pyltsin
8579ca0616 [java-inspections] IDEA-318681, IDEA-318678, IDEA-318677, IDEA-318676 Improve tainted analysis
GitOrigin-RevId: 93ef8d87e4dadd2b5cbfcc16b91610503df95664
2023-05-05 16:37:48 +00:00
Bart van Helvert
ef822020db [jvm] Simplify inspection quickfix preview tests
GitOrigin-RevId: ab69d50fb15ec7d54533e053ebbea425aca83828
2023-05-04 12:01:43 +00:00
Bart van Helvert
b47486e7df [jvm] Fix assertion type checker when calling AssertJ singleElement
#IDEA-317950 Fixed

GitOrigin-RevId: 4294f9be5ea139e4ff780986940e89c22cff3f68
2023-05-04 12:01:36 +00:00