Handle If-Else Chains
Architecture and code structurestub
Intent
Refactor nested if-then-else structures for improved understandability. Can be seen as a specialisation of Remove Nested Control Structures.
Related patterns
-
Remove Nested Control Structures stub
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.