Swap Nested Ifs
Documentation Index
Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sourcery refactoring id: swap-nested-ifs
Section titled “Sourcery refactoring id: swap-nested-ifs”Description:
Section titled “Description:”Swaps the order of nested if statements
Before:
Section titled “Before:”if a: if b: return cAfter:
Section titled “After:”if b: if a: return cExplanation:
Section titled “Explanation:”This refactoring identity will not improve code quality on its own, but can be part of a series of steps that will improve quality. Sourcery will only suggest this refactoring where it unlocks further improvements.