anthropics / cwc-workshops
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 511 units with 8,240 lines of code in units (51.6% of code).
    • 0 very complex units (0 lines of code)
    • 8 complex units (1,050 lines of code)
    • 30 medium complex units (1,332 lines of code)
    • 67 simple units (1,896 lines of code)
    • 406 very simple units (3,962 lines of code)
0% | 12% | 16% | 23% | 48%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
tsx0% | 26% | 6% | 17% | 50%
py0% | 10% | 21% | 24% | 42%
js0% | 9% | 31% | 33% | 25%
ts0% | 0% | 10% | 23% | 66%
cjs0% | 0% | 55% | 22% | 21%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
production-ready-agent0% | 17% | 6% | 12% | 64%
how-we-claude-code0% | 18% | 10% | 27% | 43%
agent-battle0% | 6% | 33% | 29% | 29%
agent-decomposition0% | 10% | 15% | 20% | 53%
ship-your-first-managed-agent0% | 28% | 0% | 27% | 44%
eval-driven-agent-development0% | 0% | 8% | 27% | 64%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
102 44 6
272 42 0
190 38 3
190 38 3
113 36 0
79 29 0
74 29 4
30 27 2
65 25 2
65 25 2
56 23 1
101 22 2
54 21 2
107 19 0
38 17 3
38 16 3
52 16 3
30 15 1
36 14 4
49 14 1
40 14 4
22 14 0
24 14 3
33 14 3
50 13 1
51 13 0
51 13 5
31 13 3
14 13 1
23 13 1
30 12 0
32 12 2
49 12 2
26 12 1
37 11 3
61 11 0
12 11 2
55 11 1
20 10 1
43 10 2
60 10 0
33 10 0
13 10 2
14 10 2
45 10 4
19 10 2
21 9 2
19 9 0
26 9 3
65 9 2