Skip to content

Files

Latest commit

 

History

History
27 lines (18 loc) · 511 Bytes

NamedArguments.md

File metadata and controls

27 lines (18 loc) · 511 Bytes

Pattern: Too many named arguments

Issue: -

Description

Reports function invocations which have more parameters than a certain threshold and are all not named.

Example of incorrect code:

fun sum(a: Int, b: Int, c: Int, d: Int) {
}
sum(1, 2, 3, 4)

Example of correct code:

fun sum(a: Int, b: Int, c: Int, d: Int) {
}
sum(a = 1, b = 2, c = 3, d = 4)

Further Reading