Inspectopedia
 
2024.3

Condition of 'if' expression is constant

Info
New
Last modified: 03 December 2024

Reports if expressions that have true or false constant literal condition and can be simplified.

While occasionally intended, this construction is confusing and often the result of a typo or previous refactoring.

Example:

The quick-fix removes the if condition: