Linux / Drivers / Md
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,180 units with 80,041 lines of code in units (77.7% of code).
    • 16 very complex units (4,050 lines of code)
    • 47 complex units (6,345 lines of code)
    • 259 medium complex units (16,654 lines of code)
    • 518 simple units (16,766 lines of code)
    • 3,340 very simple units (36,226 lines of code)
5% | 7% | 20% | 20% | 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
c5% | 8% | 21% | 21% | 44%
h0% | 0% | 0% | 3% | 96%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT6% | 9% | 21% | 19% | 42%
bcache0% | 1% | 21% | 29% | 47%
persistent-data0% | 0% | 6% | 20% | 73%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
277 137 1
516 127 3
468 121 3
305 96 1
379 92 3
317 85 3
216 69 3
197 66 2
222 66 1
125 63 4
200 63 4
153 62 2
262 61 1
103 58 1
158 53 2
152 52 3
184 48 3
122 48 1
217 47 3
193 47 3
205 47 3
169 46 2
165 45 1
185 44 2
139 43 2
141 42 3
112 42 3
137 42 5
143 41 1
78 41 2
164 40 5
143 40 2
135 39 2
108 37 2
49 36 4
124 36 3
158 35 4
91 35 5
142 35 2
147 34 1
212 33 2
108 32 5
134 32 1
127 31 1
168 31 3
94 31 5
172 29 2
110 28 1
78 28 5
96 28 5