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

org.sonar.l10n.squidjava.rules.squid.S1125.html Maven / Gradle / Ivy

Boolean expressions should not be compared against boolean literals, as their value can be directly used.

The following code:

if (booleanVariable == true) { /* ... */ }         // Non-Compliant
if (booleanVariable != true) { /* ... */ }         // Non-Compliant

should be refactored into:

if (booleanVariable) { /* ... */ }                 // Compliant
if (!booleanVariable) { /* ... */ }                // Compliant




© 2015 - 2025 Weber Informatics LLC | Privacy Policy