navigation

MaxNumberOfBooleanOperatorsInCondition (FL0054)

Cause

A while/if/assert/match when condition contains more than a configurable number of boolean operators, for example if maxItems was set to 4 (the default value) then the following condition would cause the error: if x && y || q || r && t && w then

Rationale

Can make the control flow become diffcult to understand.

How To Fix

Reduce the number of boolean operators in the while/if/assert/match when condition, e.g. a simple way to fix the example in the "Cause" section you could name the expression:

let catIsInBin = x && y || q || r && t && w
if catIsInBin then

Rule Settings

{
    "maxNumberOfBooleanOperatorsInCondition": {
        "enabled": false,
        "config": {
            "maxItems": 4
        }
    }
}