checkParenthesesMathematicalOperators
Checks if all statements with mixed mathematical operators use
sufficient parentheses to clarify operator precedence. The mathematical
operators that are checked are: +
, -
, /
, *
, and .``*
. As an
exception, +
and -
are allowed to be used successively without
requiring parentheses for clarifying operator precedence because the
order in which the operators are treated does not matter. In the HTML
report at most one violation of the same type per line of code will be
shown for this check. Some examples of code that will be reported by
this check are:
x = 6 * 2 + 1;
y = 1 / 2 * 3;
z = 2 * pi + 2;
Some examples of code that will not be reported by this check are:
a = 6 * 2 * 1;
y = 1 + 2 - 3 + 5;
z = (2 * 3) + (5 * 2);
Exemption tag: %@ok<PARMO>