# New rules for .NET developers

**URL:** <https://community.sonarsource.com/t/new-rules-for-net-developers/85566>\
**Category:** Sonar Updates\
**Tags:** vbnet, csharp, dotnet\
**Created:** [March 10, 2023, 11:19am UTC](https://community.sonarsource.com/t/new-rules-for-net-developers/85566 "2023-03-10T11:19:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Howlett](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tom_howlett/32/22183_2.png) [@Tom\_Howlett](https://community.sonarsource.com/u/Tom_Howlett)\
**Post date:** [March 10, 2023, 11:19am UTC](https://community.sonarsource.com/t/new-rules-for-net-developers/85566/1 "2023-03-10T11:19:35Z")

</div>

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](http://VB.NET).

- [Arrays should not be created for params parameters](https://rules.sonarsource.com/csharp/RSPEC-3878) ([VB.NET version](https://rules.sonarsource.com/vbnet/RSPEC-3878))
- [Deprecated code should be removed](https://rules.sonarsource.com/csharp/RSPEC-1133) ([VB.NET version](https://rules.sonarsource.com/vbnet/RSPEC-1133))
- [“private” methods called only by inner classes should be moved to those classes](https://rules.sonarsource.com/csharp/RSPEC-3398)
- [Classes should not be empty](https://rules.sonarsource.com/csharp/RSPEC-2094)
- [Comments should not be empty](https://rules.sonarsource.com/csharp/RSPEC-4663) ([VB.NET version](https://rules.sonarsource.com/vbnet/RSPEC-4663))
- [Classes named like “Exception” should extend “Exception” or a subclass](https://rules.sonarsource.com/csharp/RSPEC-2166) ([VB.NET version](https://rules.sonarsource.com/vbnet/RSPEC-2166))
- [“DebuggerDisplayAttribute” strings should reference existing members](https://rules.sonarsource.com/csharp/RSPEC-4545) ([VB.NET version](https://rules.sonarsource.com/vbnet/RSPEC-4545))
- [Silly mathematical comparisons should not be made](https://rules.sonarsource.com/csharp/RSPEC-2198)
- [“StringBuilder” data should be used](https://rules.sonarsource.com/csharp/RSPEC-3063) ([VB.NET version](https://rules.sonarsource.com/vbnet/RSPEC-3063))
- [Assertions should be complete](https://rules.sonarsource.com/csharp/RSPEC-2970)
- [Blocks should be synchronized on read-only fields](https://rules.sonarsource.com/csharp/RSPEC-2445)
- [Blocks should not be synchronized on local variables](https://rules.sonarsource.com/csharp/RSPEC-6507)

These are available on SonarCloud now and will be in upcoming releases of SonarQube and SonarLint.

Enjoy!

Tom
