facebookincubator / oculus-linux-kernel
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 369,193 units with 7,752,132 lines of code in units (57.8% of code).
    • 882 very complex units (242,438 lines of code)
    • 3,976 complex units (536,451 lines of code)
    • 25,557 medium complex units (1,707,135 lines of code)
    • 49,075 simple units (1,749,493 lines of code)
    • 289,703 very simple units (3,516,615 lines of code)
3% | 6% | 22% | 22% | 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
c3% | 7% | 22% | 23% | 44%
pl18% | 10% | 19% | 15% | 35%
h<1% | <1% | 3% | 6% | 90%
cc0% | 8% | 33% | 13% | 44%
py0% | 0% | 15% | 19% | 65%
pm0% | 0% | 0% | 45% | 54%
inl0% | 0% | 0% | 0% | 100%
uc0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
drivers3% | 7% | 23% | 23% | 43%
arch2% | 4% | 14% | 18% | 60%
fs3% | 8% | 26% | 23% | 38%
sound3% | 4% | 22% | 24% | 45%
net2% | 7% | 22% | 23% | 43%
scripts11% | 9% | 22% | 17% | 37%
tools3% | 7% | 22% | 21% | 44%
kernel1% | 4% | 14% | 21% | 57%
crypto5% | 1% | 8% | 16% | 67%
lib4% | 12% | 15% | 18% | 48%
security1% | 7% | 22% | 24% | 43%
mm<1% | 4% | 19% | 23% | 51%
block1% | 3% | 18% | 24% | 51%
virt0% | 6% | 10% | 24% | 58%
ipc0% | 3% | 24% | 19% | 51%
include0% | <1% | 1% | 4% | 93%
init0% | 0% | 32% | 29% | 37%
usr0% | 0% | 35% | 10% | 54%
firmware0% | 0% | 75% | 3% | 20%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
1124 1117 2
872 867 2
767 767 2
674 667 2
635 628 2
936 354 0
361 351 2
1239 319 6
656 308 3
473 300 3
908 258 3
894 253 2
246 239 2
768 217 1
220 213 2
501 210 4
218 207 2
742 201 4
274 199 8
546 199 5
202 195 2
223 193 2
623 190 5
312 190 3
410 186 3
932 186 3
994 183 3
1050 181 1
1039 176 2
525 172 5
849 171 3
178 171 2
754 171 3
702 168 2
252 166 3
170 163 2
523 162 3
388 162 4
1088 155 4
579 152 1
662 152 1
406 146 5
591 146 1
158 146 2
394 144 5
339 144 2
588 143 3
875 143 4
756 143 1
587 142 2