Linux / Drivers / Hid
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 2,290 units with 52,982 lines of code in units (68.5% of code).
    • 9 very complex units (1,695 lines of code)
    • 39 complex units (4,504 lines of code)
    • 186 medium complex units (11,235 lines of code)
    • 361 simple units (12,291 lines of code)
    • 1,695 very simple units (23,257 lines of code)
3% | 8% | 21% | 23% | 43%
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% | 8% | 21% | 23% | 43%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT3% | 9% | 21% | 23% | 43%
usbhid11% | 3% | 31% | 17% | 35%
intel-ish-hid0% | 9% | 12% | 23% | 54%
i2c-hid0% | 0% | 27% | 22% | 49%
amd-sfh-hid0% | 0% | 20% | 34% | 45%
surface-hid0% | 0% | 0% | 24% | 75%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
571 346 3
141 63 3
249 63 2
114 62 2
202 57 3
111 57 1
79 56 1
140 56 2
88 54 6
129 50 2
137 49 1
101 46 4
146 45 7
230 45 3
54 45 4
52 42 6
142 40 4
234 38 3
76 37 4
166 37 2
120 36 3
96 36 4
62 36 1
140 34 1
123 34 2
151 34 1
120 33 2
73 33 4
74 32 1
81 32 2
154 32 7
94 32 1
110 31 1
98 31 4
94 31 2
153 29 2
104 29 2
116 28 3
65 28 2
55 28 3
183 28 5
90 27 3
139 27 3
91 27 4
85 26 4
133 26 7
105 26 4
128 26 2
116 25 1
99 25 1