Inspectopedia
 
2024.3

Shift operation by inappropriate constant

Warning
New
Last modified: 03 December 2024

Reports shift operations where the shift value is a constant outside the reasonable range.

Integer shift operations outside the range 0..31 and long shift operations outside the range 0..63 are reported. Shifting by negative or overly large values is almost certainly a coding error.

Example: