Evaluate the Growth Patterns

When you’re analyzing complexity trends, the interesting thing isn’t the numbers themselves but the shape of the evolutionary curve.

The following figure shows the shapes you’re most likely to find in a typical codebase. The dip in the curve in Case B generally is a sign of a refactoring, because the code got simpler. Case C is also common because there’s little change in the file’s complexity. We have a stable module where we make small tweaks and changes. I expect to see this pattern in a configuration file.

images/Chp7_ComplexityTrendPatterns.png

Case A is a warning sign. As the file gets more complex, it becomes harder to understand.

To know how bad ...

Get Your Code as a Crime Scene now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.