Improve

Remove Nested Control Structures

Architecture and code structurestub

Intent

Re-structure code so that deeply nested or complicated control structures are replaced by semantically identical versions. Special case of Refactoring, similar to Untangle Code. Often performed by reducing complexity and especially cyclomatic complexity. When reducing code complexity one needs to make sure we’re not exchanging inner/ method/ cyclomatic complexity by outer/ design or runtime complexity.

Found a mistake or want to add your experience? Edit this pattern on GitHub.