anthropics / anthropic-sdk-typescript
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 859 units with 10,099 lines of code in units (30.6% of code).
    • 0 very complex units (0 lines of code)
    • 11 complex units (1,112 lines of code)
    • 48 medium complex units (2,232 lines of code)
    • 76 simple units (2,010 lines of code)
    • 724 very simple units (4,745 lines of code)
0% | 11% | 22% | 19% | 46%
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
ts0% | 11% | 21% | 19% | 47%
cjs0% | 0% | 70% | 16% | 12%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages0% | 18% | 22% | 13% | 45%
src0% | 5% | 20% | 24% | 49%
scripts0% | 0% | 48% | 42% | 8%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
72 50 2
136 48 4
136 48 4
136 48 4
136 48 4
136 48 4
72 36 1
72 36 1
72 36 1
72 36 1
72 36 1
84 25 1
65 24 5
65 24 5
65 24 5
65 24 5
65 24 5
100 23 1
145 22 3
38 20 2
70 18 1
80 17 2
11 17 2
11 17 2
11 17 2
11 17 2
11 17 2
65 16 2
65 16 2
65 16 2
65 16 2
65 16 2
84 14 1
22 14 2
56 13 2
61 13 2
26 12 2
32 12 3
39 12 4
32 12 3
32 12 3
32 12 3
32 12 3
37 11 4
21 11 2
22 11 1
52 11 2
25 11 2
24 11 1
66 11 0