Inspectopedia
 
2024.3

Ternary expression with identical branches

Warning
Code Style
New
Last modified: 03 December 2024

Reports ternary expressions with identical "then" and "else" branches. Such expressions are almost certainly a programmer error.

The quick-fix replaces the expression with its "then" branch.

Example:

After the quick-fix is applied: