Checks if multi-line statements are split before or after binary operators. For example, consider the difference between the following two statements:

isValid = testsPass ...
    && validationPassed;

isValid = testsPass && ...

This check has an auto-fixer as well. Clicking the Fix all button in the report fixes all violations for this check, clicking the Fix all in this file button fixes all violations for this check for one file. The Fix on this line button applies the fix on one individual line. For more information, see section Automatic fixes.

Configurable parameters

  • OperatorPosition (string): Desired position of binary operators in multi-line statements. Can be StartOfLine (top example) or EndOfLine (bottom example). The default is StartOfLine.

  • CheckAssignmentEqualsSigns(boolean): Whether or not equals signs used in assignments need to be checked as well. The default is false.

Exemption tag: %@ok<OPLCO>