2 ms·
I reckon that most engineers don't get cyclomatic complexity, or just straw man it. Case in point, the example in the piece of sorting algorithms makes no sense
by henrydark 5y ago
I reckon that most engineers don't get cyclomatic complexity, or just straw man it. Case in point, the example in the piece of sorting algorithms makes no sense.
Major points implied by minimizing cyclomatic complexity:
1. Don't use conditionals if you can do without them.
2. No raw loops.
These have slowly become common advice only in the last decade.
If you generalize cyclomatic complexity so that calling functions is a single point, then another major point is that code reuse minimizes global cyclomatic complexity, and how you do it matters.
Though this case is seldom made, if ever, cyclomatic complexity actually provides a robust framework for refactoring decisions.