Skip to content

function-length

Default severity: warning

Reports a function that exceeds either the statement or line limit. Nested statements count toward the total, and the line span includes the declaration and braces.

The compact examples below assume max-statements = 3.

func run() {
load()
process()
save()
notify()
}
func run() {
load()
processAndSave()
notify()
}

The defaults are 50 statements and 75 lines.

[checks.rules.function-length]
max-statements = 60
max-lines = 100

Set either option to 0 to use its built-in default.