SonarSource is pleased to announce the release of SonarLint for Visual Studio version 1.9.
This version embeds 10 new rules. Furthermore, some rules have been improved to handle more cases or to filter false positives. Also, two bugs have been found and fixed that caused exceptions in rules when analysing invalid code. Altogether there are 153 C# rules in SonarLint for Visual Sudio. Check the new rules since version 1.8.0:
- Interfaces with colliding, inherited members should explicitly redefine interface members
- Type examining methods should be avoided on “System.Type” instances
- Inappropriate casts should not be made
- Optional parameters should be passed to “base” calls
- Non-flags enums should not be used in bitwise operations
- “[DefaultValue]” should not be used when “[DefaultParameterValue]” is meant
- Right operands of shift operators should be integers
- Limit nesting depth of control flow statements in functions
- Redundant property names should be omitted in anonymous classes
- Redundancies in declarations
Rules that have been reworked:
- Rule S2333 has been changed to not report on virtual keywords, and at the same time it now looks for redundant unsafe keywords
- Rule S1698 now doesn’t report on cases when the Equals override is known to perform a reference equality check
- Rule S2184 also reports on returned integer divisions and lambda return values
- Rule S2737 not only checks the last catch block, but all redundant ones
Finally, we’d like to thank the contribution from Pepijn van de Kamp, who implemented “Limit nesting depth of control flow statements in functions“.
Have fun with SonarLint!