Miscellaneous-MaxNesting

A function must have a nesting level less than or equal N

Required inputs: IR

Avoid exceeding the configured maximum nesting level. Use guard clauses to reduce nesting, or extract code into separate functions.

Possible Messages

Key

Text

Severity

Disabled

excessive_nesting

Nesting level {} greater than {}.

None

False

Options

count_elseif

count_elseif : bool = False

Whether nesting should be increased for else if
 

maxnesting

maxnesting : int = 10

Maximum acceptable nesting level. Statements on top-level have a nesting level of 1.