Hi .NET Folks
We’ve recently added some new .NET rules that I wanted to share. All are available for C#, and some are available in VB.NET.
- Arrays should not be created for params parameters (VB.NET version)
- Deprecated code should be removed (VB.NET version)
- “private” methods called only by inner classes should be moved to those classes
- Classes should not be empty
- Comments should not be empty (VB.NET version)
- Classes named like “Exception” should extend “Exception” or a subclass (VB.NET version)
- “DebuggerDisplayAttribute” strings should reference existing members (VB.NET version)
- Silly mathematical comparisons should not be made
- “StringBuilder” data should be used (VB.NET version)
- Assertions should be complete
- Blocks should be synchronized on read-only fields
- Blocks should not be synchronized on local variables
These are available on SonarCloud now and will be in upcoming releases of SonarQube and SonarLint.