IfSQ logo

IfSQ


SP-2—Nesting Too Deep

Defect Indicators: Statements involving a condition have been nested to a depth of more than 4.

Risks: With more than 4 levels of nesting, programs become difficult to understand and therefore difficult to maintain. Programmers are more likely to introduce new errors when they make changes.

Assessment:

Remedy: Refactor the deeply nested code into its own routine, OR Redesign the tests in the condition, OR Write a comment justifying the level of nesting.

References:

Research Findings: