
org.sonar.l10n.squidjava.rules.squid.S1126.html Maven / Gradle / Ivy
Return of boolean literal statements wrapped into if-then-else ones should be simplified.
For example, the following code:
if (someBooleanMethod()) { // Non-Compliant
return true;
} else {
return false;
}
should be refactored into:
return someBooleanMethod(); // Compliant
and, the following code:
if (someBooleanMethod()) { // Non-Compliant
return false;
} else {
return true;
}
should be refactored into:
return !someBooleanMethod(); // Compliant
© 2015 - 2025 Weber Informatics LLC | Privacy Policy