Skip to main content

number_of_parameters

A number of parameters metric which checks whether we didn't exceed the maximum allowed number of parameters for a function or method.

Example:​

Assuming config:

solid_lints:
diagnostics:
number_of_parameters:
max_parameters: 2

BAD:​

void fn(a, b, c) {} // LINT
class C {
void method(a, b, c) {} // LINT
}

GOOD:​

void fn(a, b) {} // OK
class C {
void method(a, b) {} // OK
}

Parameters​

max_parameters (int)​

Maximum number of parameters allowed before a warning is triggered.

exclude (String | Map | List<String | Map>)​

A list of methods that should be excluded from the lint.