Pattern: Missing use of intValue.isOdd
/isEven
Issue: -
PREFER the use of intValue.isOdd
/isEven
to check for evenness.
Example of incorrect code:
bool isEven = 1 % 2 == 0;
bool isOdd = 13 % 2 == 1;
Example of correct code:
bool isEven = 1.isEven;
bool isOdd = 13.isOdd;