Remove literal boolean values from conditional expressions to improve readability. Anything that can be tested for equality with a boolean value must itself be a boolean value, and boolean values can be tested atomically.

Noncompliant Code Example

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

Compliant Solution

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