This check reports any statements in which insufficient parentheses are used to clarify the precendence of logical operators. Any statement where the operator precedence affects the outcome must use sufficient parentheses. For example:

x = a && b || c; shall becomex = (a && b) || c;or x = a && (b || c);

When only one type of logical operator is used, operator precedence is irrelevant and no parentheses are required for this check. For example: x = a && b && c;

Configurable parameters

  • RequireParenthesesAroundCondition (boolean): Set to true to require parentheses around if and elseif-statements, even though these are not required to clarify operator precedence. For example:if a && bshould become if (a && b).

Exemption tag: %@ok<PARLO>