anthropics / claude-agent-sdk-python
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 159 units with 2,126 lines of code in units (33.3% of code).
    • 1 very complex units (131 lines of code)
    • 1 complex units (58 lines of code)
    • 11 medium complex units (561 lines of code)
    • 24 simple units (591 lines of code)
    • 122 very simple units (785 lines of code)
6% | 2% | 26% | 27% | 36%
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
py6% | 2% | 26% | 27% | 36%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src7% | 3% | 32% | 20% | 34%
scripts0% | 0% | 5% | 52% | 42%
.github0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
131 66 1
58 27 1
269 22 2
41 21 1
30 16 4
32 16 1
42 15 2
24 12 1
32 12 2
18 12 2
24 11 0
18 11 1
31 11 3
26 10 2
59 9 0
26 9 1
19 8 0
17 8 2
16 8 1
22 8 1
72 7 0
45 7 0
19 7 1
21 7 2
20 7 1
25 7 1
29 7 0
20 6 0
34 6 2
16 6 2
20 6 1
9 6 1
16 6 1
10 6 1
19 6 1
16 6 0
15 6 2
16 5 0
18 5 1
11 5 2
10 5 1
12 5 1
6 4 1
20 4 0
10 4 1
27 4 0
13 4 0
8 4 1
10 4 1
20 4 1