Improve S1192: make threshold inclusive or change default from 3 to 4 #9647
Labels
Area: C#
C# rules related issues.
Area: VB.NET
VB.NET rules related issues.
Type: False Positive
Rule IS triggered when it shouldn't be.
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:nodes.length >= threshold
(see here)nodes.length >= threshold
(see here)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.
The text was updated successfully, but these errors were encountered: