Query module BadCheckOdd

name
Bad parity check
description
Code that uses ‘x % 2 == 1’ or ‘x % 2 > 0’ to check whether a number is odd does not work for negative numbers.
kind
problem
problem.severity
warning
precision
low
id
cs/incomplete-parity-check
tags
reliability correctness

Imports

csharp

The default C# QL library.

Predicates