NESTING_INCREASED¶
Severity: warn (default) / error (new depth crosses the error threshold)
A POU's maximum control-structure nesting depth increased and now sits beyond the configured warn threshold. Depth counts nested IF / CASE / FOR / WHILE / REPEAT; the clauses of a construct (ELSIF, ELSE, each CASE arm) do not add depth on their own.
Why it matters. Deeply nested logic is where edge cases hide. A jump in nesting depth is an early signal that a POU is drifting toward arrow-shaped code that is hard to follow and easy to get wrong.
Settings. Reads metrics.thresholds.nesting_depth from .plc-st-review.yml:
Fires only when the new depth exceeds the warn band. Escalates to error when the new depth reaches the error band and the old value was below it.
Trigger.
The bot posts.
Fix. Flatten with guard clauses (early RETURN/CONTINUE), invert conditions, or hoist an inner block into its own method.