SonarLint for IntelliJ 5.2 released - Support for Java 16 features, faster Python symbol table build

Hello Java and Python developers,

we just released a new version of SonarLint for IntelliJ-based IDEs that is particularly dedicated to you.

For Java, we added several new rules that cover Java 16 features and delivers several improvements to the existing ones. Here is an overview of the new rules:

  • S6201: Pattern Matching for “instanceof” operator should be used instead of simple “instanceof” + cast
  • S6204: “Stream.toList()” method should be used instead of “collectors” when unmodifiable list needed
  • S6206: Records should be used instead of ordinary classes when representing immutable data structure
  • S6207: Redundant constructors/methods should be avoided in records
  • S6209: Members ignored during record serialization should not be used
  • S6211: Custom getter method should not be used to override record’s getter behavior
  • S6216: Reflection should not be used to increase accessibility of records’ fields
  • S6218: Equals method should be overridden in records containing array fields
  • S6219 : ‘serialVersionUID’ field should not be set to ‘0L’ in records

For Python, we announced last month that we started leveraging a cross-module symbol table to deliver more accurate analysis results. Next, we have been working to reduce the time needed to compute this symbol table; we achieved this by using the serialized version of TypeShed builtins symbols, which are precomputed at build time. As a result, you can now benefit of the cross-module symbol table for projects up 200.000 LOC (instead of 150.000).
What’s more, we improved our Python analyzer to raise more issues when we know the version of Python used by your project. In future releases, SonarLint will automatically detect the Python version and fine-tune the Python analysis (you can follow this ticket).
For the time being, in order to benefit from this feature, you’ll need to manually specify the analysis property sonar.python.version to your version (e.g. 3.8) in your SonarLint’s project settings.

Finally, we delivered plenty of other improvements and bug fixes that you can find in the release notes. Just to mention one of them, you are now able to dock the SonarLint panel vertically to the left or the right side of you IDE window.

I sincerely hope you will enjoy this new version.

2 Likes