Cyclomatic complexity counts the independent execution paths through a software module. It reflects decision-making created by loops, conditionals, and branches: higher values generally indicate code that is harder to understand, maintain, and test, with greater potential for bugs. section 6.2 section 6.7
Use the metric to guide practical code review:
- Prefer lower complexity when possible because simpler code is easier to reason about and maintain. section 6.2
- Treat higher complexity as a signal to examine logic carefully and anticipate a larger testing burden. section 6.2
- Interpret the metric alongside code coverage, Halstead measures, and the maintainability index rather than as a complete quality judgment. section 6.7
Querying a class with Copilot
Ask Copilot, “What is the cyclomatic complexity of the class Department-StatisticsVisitor?” The demonstrated answer is 1. A follow-up question—“Why is 1 a good value?”—returns “Because it is low,” illustrating the metric’s basic interpretation without replacing review or testing. section 6.2
# Question: What is the cyclomatic complexity of the class Department- StatisticsVisitor? # Answer: 1
Inspect the compact question-and-answer example for a direct complexity assessment. section 6.2




