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, method or constructor.

Example:

Assuming config:

custom_lint:
rules:
- 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.