Complexity hotspots

The problem

You open a package and its average cyclomatic complexity is 3.2. Looks harmless. Then CC Max points to one method at 47. Or, in a TypeScript artifact scan, one source file towers over the rest of its folder. The aggregate was not wrong; it simply could not tell you where the control-flow paths actually concentrate.

Why it matters

Averages hide outliers. That is what averages do. CC Max pulls the strongest control-flow outlier back to the surface, while CC avg tells you whether the complexity is isolated or spread around. Higher CC means more independent paths to account for when you design tests. It does not mean a score of 47 prescribes exactly 47 tests, and it does not decide that the code must be refactored. First find the contributor. Then read it.

Where to start

Begin with Topology.

Step by step

  1. Start with the whole complexity field.

    Launch Complexity hotspots from Workflows. AtlasArc.io opens Topology with the Cyclomatic Complexity (Max) heatmap, no Fan-in or Fan-out cutoff, and isolated nodes retained. Every package or source folder with CC evidence gets a chance to surface.

  2. Read the hot end of your own model.

    The Wizard gives you the live 75th-percentile CC Max and range for this scan. Use those values to orient yourself, not as a universal quality gate. Start with the hottest visible nodes and compare their maximum with their average.

  3. Follow the aggregate to its contributor.

    Select a hot node and open Metrics, then Complexity. For Java and Kotlin, AtlasArc.io names the top contributing class and method. For TypeScript artifact analysis, it names the top source file reported by the imported complexity evidence.

  4. Read the code before choosing an outcome.

    Open the named contributor in the IDE. A parser, state machine, dispatch table, or decision engine may carry high path complexity for a good reason. Accidental nesting, repeated conditions, and unrelated branches may point toward a clearer design. The score tells you where to look; the code tells you what to do.

  5. Add Cognitive Complexity as a second pass when it is available.

    Switch to Cognitive Complexity (Max) to inspect reading difficulty separately. High CC with lower CogC often means broad but relatively flat branching. High values on both signals deserve a closer read, not an automatic refactoring verdict.

  6. Use Hotspots Classes only when a visual comparison helps.

    On Java or Kotlin, you can switch to Hotspots and choose Classes for a side-by-side contributor view. That is an optional follow-up. W13 already exposes the outlier through Topology and Metrics; the Identify risky hotspots workflow owns multidimensional package prioritization.

Interpreting results

CC Max exposes the strongest path-count outlier; CC avg tells you how broadly that complexity is distributed. Cognitive complexity adds a separate estimate of reading difficulty. Neither metric supplies bug history or a refactoring verdict. Preserve clear, inherent complexity and support it with deliberate tests. Simplify accidental complexity when the code evidence supports that outcome.

Export & share

Export the Topology heatmap as PNG when you want to capture the full complexity field for review. On Java or Kotlin, an optional Hotspots Classes export can show the contributor comparison after you have identified the package.