Linux / Drivers / Media
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 26,003 units with 621,043 lines of code in units (63.2% of code).
    • 93 very complex units (28,611 lines of code)
    • 376 complex units (48,853 lines of code)
    • 2,082 medium complex units (138,107 lines of code)
    • 3,776 simple units (138,497 lines of code)
    • 19,676 very simple units (266,975 lines of code)
4% | 7% | 22% | 22% | 42%
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
c4% | 7% | 22% | 22% | 42%
h0% | 1% | 4% | 7% | 87%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
dvb-frontends8% | 14% | 26% | 19% | 32%
pci6% | 7% | 19% | 22% | 44%
i2c4% | 5% | 18% | 22% | 48%
platform1% | 3% | 20% | 23% | 49%
usb2% | 7% | 23% | 24% | 42%
tuners10% | 11% | 28% | 15% | 34%
common11% | 7% | 24% | 18% | 38%
v4l2-core10% | 11% | 20% | 23% | 34%
cec8% | 15% | 20% | 19% | 36%
dvb-core6% | 13% | 24% | 22% | 31%
test-drivers2% | 13% | 21% | 18% | 42%
rc2% | 10% | 23% | 19% | 45%
radio0% | 3% | 22% | 24% | 50%
firewire0% | 8% | 13% | 27% | 50%
mc0% | 0% | 22% | 25% | 52%
spi0% | 0% | 25% | 37% | 37%
mmc0% | 0% | 42% | 31% | 25%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
403 261 8
892 253 2
238 218 1
1260 214 1
288 185 2
394 156 4
686 154 1
595 147 1
332 143 1
2768 134 2
589 129 4
409 127 1
242 122 1
408 119 3
638 117 3
537 114 3
456 111 2
313 111 3
466 109 1
223 105 1
452 96 1
124 96 3
264 95 1
319 90 1
140 87 1
308 87 1
206 87 1
299 83 1
326 83 1
133 83 11
375 82 4
261 80 1
246 79 1
458 77 1
432 77 2
297 75 1
244 75 3
199 72 1
194 72 2
217 71 1
238 71 1
158 70 1
337 67 1
229 67 3
183 67 3
383 65 3
237 64 3
254 64 3
403 64 1
228 64 2