Linux / Drivers / Misc
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 4,176 units with 97,215 lines of code in units (51.7% of code).
    • 8 very complex units (2,612 lines of code)
    • 24 complex units (2,828 lines of code)
    • 230 medium complex units (16,058 lines of code)
    • 535 simple units (19,989 lines of code)
    • 3,379 very simple units (55,728 lines of code)
2% | 2% | 16% | 20% | 57%
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% | 2% | 16% | 20% | 56%
h0% | 0% | 0% | 1% | 98%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
altera-stapl50% | 12% | 15% | 14% | 7%
habanalabs2% | 3% | 13% | 15% | 64%
mei4% | 0% | 24% | 16% | 54%
lis3lv02d12% | 0% | 22% | 18% | 47%
bcm-vk0% | 16% | 16% | 32% | 35%
ROOT0% | 2% | 15% | 25% | 56%
vmw_vmci0% | 3% | 26% | 29% | 40%
eeprom0% | 7% | 21% | 32% | 38%
genwqe0% | 3% | 19% | 28% | 47%
cxl0% | 0% | 19% | 25% | 54%
cardreader0% | 0% | 19% | 17% | 63%
sgi-gru0% | 0% | 14% | 29% | 56%
ti-st0% | 0% | 25% | 21% | 53%
lkdtm0% | 0% | 9% | 18% | 72%
ocxl0% | 0% | 5% | 24% | 70%
c2port0% | 0% | 18% | 11% | 70%
echo0% | 0% | 43% | 0% | 56%
ibmasm0% | 0% | 7% | 26% | 65%
cb7100% | 0% | 24% | 4% | 71%
uacce0% | 0% | 0% | 30% | 69%
sgi-xp0% | 0% | 0% | 61% | 38%
pvpanic0% | 0% | 0% | 23% | 76%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
1239 319 6
233 121 2
262 74 3
287 70 2
110 70 2
134 60 1
118 57 3
229 51 2
119 43 3
84 41 3
162 38 1
119 37 4
143 37 5
197 36 9
100 36 11
70 33 4
202 32 2
135 32 1
93 31 3
126 29 2
66 29 3
187 29 3
186 29 2
133 27 5
83 27 6
82 27 6
79 26 3
99 26 7
140 26 8
77 26 4
74 26 4
72 26 4
123 25 2
75 25 3
113 24 6
98 24 3
121 23 2
108 23 6
46 23 2
106 23 3
66 23 4
93 23 3
86 22 1
125 22 2
47 22 1
79 22 6
109 22 3
121 22 8
114 22 11
92 22 2