Linux / Drivers / Pci
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 3,706 units with 69,926 lines of code in units (76.1% of code).
    • 6 very complex units (1,720 lines of code)
    • 22 complex units (3,042 lines of code)
    • 216 medium complex units (13,930 lines of code)
    • 489 simple units (16,045 lines of code)
    • 2,973 very simple units (35,189 lines of code)
2% | 4% | 19% | 22% | 50%
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% | 4% | 20% | 23% | 49%
h0% | 0% | 4% | 8% | 87%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
hotplug9% | 8% | 29% | 20% | 31%
controller<1% | 3% | 16% | 22% | 57%
ROOT<1% | 2% | 19% | 23% | 53%
pcie0% | 4% | 14% | 25% | 55%
switch0% | 8% | 27% | 26% | 37%
endpoint0% | 0% | 12% | 33% | 54%
msi0% | 0% | 11% | 15% | 72%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
316 90 2
399 66 4
379 61 2
164 60 5
355 56 2
107 53 1
136 43 5
209 41 2
170 41 1
144 38 1
180 37 2
147 36 1
101 36 2
181 34 2
137 34 1
151 33 2
161 32 1
176 31 1
111 31 1
109 31 1
66 30 1
157 30 1
91 29 8
147 29 1
151 28 1
152 28 1
62 27 2
103 27 4
133 25 1
98 25 3
114 24 3
129 24 1
118 24 1
104 24 6
75 24 2
118 24 1
110 23 1
102 23 1
113 23 2
113 23 1
100 23 4
89 22 2
184 22 1
99 22 1
74 22 2
57 21 4
84 21 2
55 21 1
99 21 1
87 21 1