All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.csharp.rules.csharpsquid.S1145.html Maven / Gradle / Ivy

There is a newer version: 4.0
Show newest version

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