anthropics / anthropic-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 1,542 units with 11,925 lines of code in units (27.9% of code).
    • 1 very complex units (74 lines of code)
    • 4 complex units (432 lines of code)
    • 31 medium complex units (1,090 lines of code)
    • 63 simple units (1,114 lines of code)
    • 1,443 very simple units (9,215 lines of code)
<1% | 3% | 9% | 9% | 77%
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
py<1% | 3% | 9% | 9% | 77%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src<1% | 3% | 8% | 9% | 77%
scripts0% | 0% | 27% | 0% | 72%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
74 53 1
131 40 3
129 39 3
72 38 4
100 38 2
44 21 4
44 20 2
42 20 2
52 19 2
52 17 1
21 17 3
27 16 4
19 16 6
47 15 1
32 15 5
33 15 1
24 14 0
40 14 2
83 14 3
39 14 1
24 13 2
62 13 1
34 13 1
45 13 1
32 12 2
32 12 2
12 12 3
8 12 3
23 12 0
33 12 1
33 11 2
60 11 5
24 11 4
32 11 1
18 11 3
19 11 3
12 10 3
22 10 1
23 10 1
18 9 18
18 9 18
19 9 1
21 9 2
10 9 2
16 9 2
16 9 2
32 9 1
51 9 1
26 9 1
18 8 2