navigation

MaxNumberOfFunctionParameters (FL0052)

Cause

A function contains more than a configurable number of parameters, for example if maxItems was set to 5 (the default value) then the following condition would cause the error: let findCat one two three four five six = 0

Rationale

Too many parameters make the function difficult to use.

How To Fix

Reduce the number of function parameters, e.g. to fix the example in the "Cause": let findCat one two three four five = 0. A good way to reduce the number of parameters is to group them using records.

Rule Settings

{
    "maxNumberOfFunctionParameters": {
        "enabled": false,
        "config": {
            "maxItems": 5
        }
    }
}