Inspectopedia
 
2024.3

Pointless boolean expression

Warning
Code Style
Last modified: 03 December 2024

Reports pointless or pointlessly complicated boolean expressions.

Such expressions include conjunction with true, disjunction with false, equality comparison with a boolean literal, or negation of a boolean literal. Such expressions may be the result of automated refactorings not completely followed through to completion, and in any case are unlikely to be what the developer intended to do.

Example:

After the quick-fix is applied: