-
Notifications
You must be signed in to change notification settings - Fork 10
Check NestingDepth
github-actions[bot] edited this page Nov 22, 2024
·
3 revisions
The nesting depth of methods/procedures/if-statements/loop-statements should not exceed the defined maximum nesting depth threshold.
Deeply nested code may perform poorly, is difficult to understand and can be difficult to test thoroughly.
_if a _isnt _unset
_then
_for x _over a.fast_elements()
_loop
_if x _isnt _unset
_then
_for child _over x.fast_elements()
_loop
_return child
_endloop
_endif
_endloop
_else
_return b
_endif
_if a _is _unset _then _return b _endif
_for x _over a.fast_elements()
_loop
_if x _is _unset
_then
_continue
_endif
_for child _over x.fast_elements()
_loop
_return child
_endloop
_endloop
Option | Default value | Description |
---|---|---|
nesting-depth.max-nesting-depth | 3 | Maximum nesting depth |
nesting-depth.count-early-return-as-nesting-depth | true | Count early return as nesting depth |
Note
This page is generated. Any changes made to this page through the wiki will be lost in the future.