Inspectopedia
 
2024.3

Pointless arithmetic expression

Warning
Performance
Last modified: 03 December 2024

Reports pointless arithmetic expressions.

Such expressions include adding or subtracting zero, multiplying by zero or one, division by one, and shift by zero. 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: