Method is too deeply nested
This rule checks for the nesting depth of methods.
Methods which are too deeply nested are usually an indication that one, or several, of the below problems apply:
- the method tries to do too many things;
- objects used by this method lack isolation;
- the code in the method fails to account for early exit conditions.
The first of those conditions above is the most frequent one; the suggested fix is therefore to split the logic of this particular method into several methods.
Maximum allowed nesting depth