by Deukhoofd · 2mo ago · 0 comments
I think generally when you run into something like this, the better way to handle it is to sit back, and reconsider how your overall handling is designed.
There’s a bit of an assumption that the branching _has_ to exist, but so often it doesn’t.
To be fair, the article does suggest other techniques: hinting at separating pure/impure code for example, which I would say often results in a “net” cyclomatic complexity reduction. But I would disagree with “extract method” as the most effective… yes very effective in reducing cyclomatic complexity, but that ignores downsides, especially if the code needs to be thought about as a whole.