
org.sonar.l10n.csharp.rules.csharpsquid.S1145.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-csharp-plugin Show documentation
Show all versions of sonar-csharp-plugin Show documentation
Enable analysis and reporting on C# projects.
if
statements with conditions that are always false have the effect of making blocks of code non-functional. This can be useful during debugging, but should not be checked in. if
statements with conditions that are always true are completely redundant, and make the code less readable.
In either case, unconditional if
statements should be removed.
Noncompliant Code Example
if (true) {
doSomething();
}
...
if (false) {
doSomethingElse();
}
Compliant Solution
doSomething();
...
© 2015 - 2025 Weber Informatics LLC | Privacy Policy