I’d like to update you on our plans for the rule ‘calculations should not overflow’. We think this is a valuable rule but are not satisfied with its current accuracy, and for this reason, it’s not part of the Sonarway profile. After the release of the upcoming SonarQube LTS, during the 10.x cycle, we plan to change the way it works by using features available in more recent versions of the Roslyn compiler. These changes will improve the precision of the rule, remove the Windows-only limitations and also bring the rule directly to your IDE via SonarLint or NuGet package.
The tradeoff for the increased accuracy is that this rule will require a build using MSBuild 15+. Once this is done builds using older MSBuild versions will not raise issues for this rule. Until then you can continue to use this rule as you do now.
The ‘calculations should not overflow’ rule has now been updated and you should see a big improvement in its detection and precision, particularly on newer versions of .NET. The rule is now part of the Sonarway profile. As previously mentioned the rule now requires a build using MSBuild 15+.
This update is on SonarCloud today and will be in the upcoming SonarQube 10.1 as well as upcoming releases on SonarLint.
Let me know if you have any feedback or questions.