Linux / Drivers / Net
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 81,320 units with 1,849,325 lines of code in units (58.6% of code).
    • 163 very complex units (44,337 lines of code)
    • 884 complex units (120,054 lines of code)
    • 5,747 medium complex units (394,151 lines of code)
    • 11,940 simple units (440,575 lines of code)
    • 62,586 very simple units (850,208 lines of code)
2% | 6% | 21% | 23% | 45%
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
c2% | 6% | 21% | 24% | 45%
h0% | 0% | <1% | 2% | 96%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
wireless3% | 8% | 23% | 22% | 42%
ethernet1% | 5% | 20% | 24% | 47%
fddi20% | 10% | 15% | 20% | 33%
bonding11% | 6% | 20% | 21% | 40%
usb2% | 5% | 24% | 24% | 43%
ROOT2% | 9% | 19% | 23% | 44%
phy1% | 1% | 19% | 25% | 51%
arcnet8% | 5% | 18% | 20% | 46%
ppp6% | 10% | 27% | 16% | 38%
hamradio2% | 8% | 31% | 24% | 32%
can<1% | 4% | 26% | 23% | 45%
wan0% | 13% | 26% | 24% | 35%
dsa0% | 2% | 14% | 26% | 57%
wireguard0% | 10% | 25% | 18% | 45%
fjes0% | 12% | 20% | 23% | 43%
team0% | 7% | 12% | 9% | 69%
xen-netback0% | 5% | 19% | 22% | 52%
hippi0% | 14% | 23% | 30% | 31%
ieee8021540% | 2% | 19% | 28% | 49%
hyperv0% | 3% | 29% | 30% | 36%
appletalk0% | 9% | 26% | 23% | 39%
wwan0% | 1% | 10% | 25% | 62%
slip0% | 12% | 26% | 26% | 35%
pcs0% | 5% | 23% | 34% | 37%
ipa0% | <1% | 5% | 23% | 70%
mdio0% | 0% | 14% | 27% | 57%
netdevsim0% | 0% | 8% | 22% | 69%
ipvlan0% | 0% | 13% | 16% | 69%
mctp0% | 0% | 42% | 19% | 37%
caif0% | 0% | 18% | 37% | 43%
vmxnet30% | 0% | 24% | 44% | 30%
plip0% | 0% | 25% | 9% | 64%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
548 199 2
212 197 2
672 185 2
194 180 4
939 174 4
854 168 4
413 132 5
580 123 5
786 122 4
342 121 4
374 112 2
360 105 3
300 102 4
227 100 1
407 99 4
303 98 5
326 97 5
376 94 3
236 91 2
599 91 2
297 91 3
232 89 2
289 89 4
479 88 5
250 88 2
341 87 4
254 85 2
348 85 1
307 85 4
354 84 2
349 84 2
286 83 1
202 83 1
154 82 3
462 82 2
477 81 1
443 80 2
292 80 2
301 79 3
114 79 5
261 78 2
265 77 4
102 77 1
195 77 4
225 77 3
225 76 2
277 76 2
282 76 3
302 76 2
147 76 6