anthropics / triton
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 2,276 units with 29,173 lines of code in units (62.9% of code).
    • 1 very complex units (89 lines of code)
    • 11 complex units (2,322 lines of code)
    • 100 medium complex units (5,305 lines of code)
    • 215 simple units (6,349 lines of code)
    • 1,949 very simple units (15,108 lines of code)
<1% | 7% | 18% | 21% | 51%
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
cpp<1% | 4% | 25% | 24% | 45%
cc0% | 76% | 0% | 10% | 12%
py0% | 3% | 11% | 21% | 63%
h0% | 0% | 3% | 12% | 84%
c0% | 0% | 0% | 0% | 100%
hpp0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib<1% | 3% | 24% | 24% | 46%
python0% | 14% | 8% | 18% | 58%
unittest0% | 21% | 25% | 4% | 48%
include0% | 0% | 0% | 7% | 92%
.github0% | 0% | 0% | 53% | 46%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
89 53 1
75 50 4
88 43 7
174 41 4
1331 41 1
149 34 5
104 33 1
86 31 3
62 28 5
84 27 3
79 27 2
90 26 2
87 25 2
70 25 3
212 25 4
63 25 6
38 25 9
23 24 3
141 23 15
146 23 3
86 22 2
42 22 1
105 22 7
54 21 2
105 21 7
35 21 2
70 20 4
82 20 0
58 20 3
28 20 2
36 20 4
55 19 2
52 19 2
52 19 1
35 19 1
55 18 0
71 17 0
106 17 0
37 17 3
52 17 2
44 17 3
48 16 1
37 16 2
43 16 1
84 16 1
28 16 7
31 16 10
43 16 5
38 16 4
79 15 4