Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Version 10.2.1 (build 78527 - how is SonarQube deployed: zip, Docker, Helm
Docker
Error is also Present in Sonar lint
Rule Description:
This rule also reports on redundant boolean operations.
if (someValue === true) { /* ... */ } // Noncompliant: Redundant comparison
if (someBooleanValue !== true) { /* ... */ } // Noncompliant: Redundant comparison
if (booleanMethod() || false) { /* ... */ } // Noncompliant: Redundant OR
doSomething(!false); // Noncompliant: Redundant negation
Remove redundant boolean literals to improve readability.
if (someValue) { /* ... */ }
if (!someBooleanValue) { /* ... */ }
if (booleanMethod()) { /* ... */ }
doSomething(true);
Mistake: The rule itselve does not apply to someValue === true
it only aplyes to someValue == true
, the rule is correkt the desktiption is not