Linux / Drivers / Usb
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 12,165 units with 279,168 lines of code in units (71.6% of code).
    • 33 very complex units (7,658 lines of code)
    • 159 complex units (20,014 lines of code)
    • 1,123 medium complex units (74,096 lines of code)
    • 1,841 simple units (63,332 lines of code)
    • 9,009 very simple units (114,068 lines of code)
2% | 7% | 26% | 22% | 40%
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% | 7% | 26% | 22% | 40%
h0% | 0% | 5% | 9% | 84%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
host4% | 7% | 30% | 22% | 35%
gadget2% | 6% | 26% | 21% | 42%
core9% | 8% | 24% | 20% | 36%
typec9% | 9% | 19% | 27% | 35%
class6% | 10% | 27% | 19% | 35%
usbip5% | 5% | 23% | 23% | 42%
storage2% | 7% | 32% | 22% | 35%
dwc22% | 13% | 25% | 25% | 33%
misc1% | 10% | 30% | 15% | 41%
isp17605% | 2% | 28% | 20% | 42%
common11% | 0% | 44% | 9% | 34%
image7% | 0% | 47% | 12% | 33%
musb0% | 10% | 28% | 25% | 34%
serial0% | 3% | 23% | 25% | 47%
chipidea0% | 13% | 19% | 23% | 43%
cdns30% | 6% | 22% | 29% | 41%
dwc30% | 4% | 30% | 20% | 43%
phy0% | 5% | 23% | 20% | 49%
atm0% | 6% | 29% | 33% | 29%
c67x000% | 9% | 12% | 22% | 54%
mtu30% | 0% | 17% | 20% | 62%
renesas_usbhs0% | 0% | 15% | 14% | 69%
early0% | 0% | 25% | 30% | 44%
mon0% | 0% | 20% | 22% | 57%
ROOT0% | 0% | 38% | 14% | 47%
roles0% | 0% | 0% | 47% | 52%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
754 200 1
196 117 2
100 89 2
163 89 3
332 87 6
313 84 5
352 83 6
118 82 1
292 68 6
269 66 1
235 66 2
275 66 6
281 65 2
77 65 1
164 63 1
322 63 2
216 62 6
229 62 6
258 59 2
234 59 6
126 59 2
230 58 2
181 57 6
201 56 2
229 56 5
167 55 2
163 55 2
152 55 3
176 55 2
167 54 1
208 53 2
174 52 4
304 52 1
150 50 1
183 50 1
180 48 3
179 48 1
167 47 1
185 47 3
93 47 3
155 47 3
143 44 6
168 44 2
204 44 2
171 44 2
164 44 2
59 42 1
160 42 1
164 42 6
132 42 2