anthropics / beam
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 53,450 units with 482,943 lines of code in units (60.2% of code).
    • 16 very complex units (8,669 lines of code)
    • 72 complex units (10,076 lines of code)
    • 766 medium complex units (43,776 lines of code)
    • 2,213 simple units (67,202 lines of code)
    • 50,383 very simple units (353,220 lines of code)
1% | 2% | 9% | 13% | 73%
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
go6% | 4% | 11% | 15% | 62%
groovy63% | 0% | 12% | 4% | 19%
java<1% | 1% | 7% | 11% | 79%
py<1% | 1% | 14% | 19% | 63%
js0% | 0% | 15% | 22% | 61%
ts0% | 0% | 3% | 18% | 78%
dart0% | 0% | 2% | 3% | 94%
tsx0% | 0% | 42% | 0% | 57%
pyx0% | 0% | 0% | 15% | 84%
kt0% | 0% | 0% | 0% | 100%
pyi0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
kts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sdks1% | 2% | 10% | 14% | 70%
buildSrc73% | 0% | 10% | 3% | 12%
playground3% | 0% | 6% | 8% | 82%
learning3% | 0% | 1% | 1% | 93%
runners<1% | <1% | 4% | 12% | 82%
infra0% | 0% | 29% | 25% | 44%
website0% | 0% | 17% | 25% | 57%
it0% | 0% | 4% | 9% | 86%
.test-infra0% | 0% | 17% | 18% | 64%
scripts0% | 0% | 8% | 37% | 54%
release0% | 0% | 13% | 18% | 68%
contributor-docs0% | 0% | 28% | 13% | 58%
plugins0% | 0% | 0% | 48% | 51%
.github0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
822 378 1
822 378 1
840 195 0
2127 190 1
566 138 0
566 138 0
324 94 4
183 83 2
341 83 1
342 81 0
329 65 1
334 63 1
266 60 0
289 59 2
270 57 0
248 52 1
206 48 7
446 47 6
200 47 2
160 46 1
232 46 3
194 45 0
202 45 1
237 45 4
197 44 0
134 44 1
125 42 1
132 41 2
275 41 1
142 41 2
157 41 1
160 40 3
121 40 0
179 39 0
77 38 25
128 38 4
164 37 1
182 37 1
227 36 13
115 35 1
144 35 1
83 35 2
261 35 3
85 34 5
96 34 1
111 33 1
165 33 1
99 33 1
145 33 2
106 32 1