SonarSource / sonar-dotnet

Code analyzer for C# and VB.NET projects
https://redirect.sonarsource.com/plugins/csharp.html
GNU Lesser General Public License v3.0
797 stars 229 forks source link

Improve S1192: make threshold inclusive or change default from 3 to 4 #9647

Open antonioaversa opened 3 months ago

antonioaversa commented 3 months ago

Reviewing https://github.com/SonarSource/sonar-dart/pull/40 I noticed the following fact:

Java and C# seem to interpret the definition of the threshold (Number of times a literal must be duplicated to trigger an issue) differently:

C++ doesn't implement S1192 (they most likely have another rule key). I haven't checked other languages. I tend to agree more with the Java (and now Dart) interpretation.

If we want to act on this, and make the interpretation of the parameter (that has the same description in the rspecator for both Java and C#) consistent, and we don't want to increase noise, we should probably change the default from 3 to 4, provided that changing the default doesn't have any other side effect.