Linux / Drivers / Input
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 5,203 units with 113,252 lines of code in units (74.9% of code).
    • 4 very complex units (775 lines of code)
    • 39 complex units (4,968 lines of code)
    • 445 medium complex units (28,780 lines of code)
    • 825 simple units (29,301 lines of code)
    • 3,890 very simple units (49,428 lines of code)
<1% | 4% | 25% | 25% | 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
c<1% | 4% | 25% | 25% | 43%
h0% | 17% | 8% | 16% | 56%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tablet16% | 7% | 24% | 22% | 28%
serio2% | 3% | 12% | 26% | 54%
ROOT3% | 1% | 20% | 25% | 49%
keyboard<1% | 3% | 30% | 25% | 39%
misc0% | 6% | 21% | 26% | 45%
touchscreen0% | 2% | 27% | 24% | 46%
mouse0% | 4% | 27% | 26% | 41%
rmi40% | 11% | 20% | 28% | 39%
joystick0% | 7% | 31% | 29% | 32%
gameport0% | 0% | 16% | 16% | 66%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
276 82 1
197 55 1
161 55 4
141 54 3
205 48 2
178 47 1
159 45 4
111 45 1
212 44 1
144 44 2
157 41 7
105 39 3
149 38 1
56 38 2
181 38 2
149 37 1
142 37 1
60 36 3
121 36 3
140 35 1
128 34 1
147 34 1
128 33 2
164 33 1
81 31 4
135 30 2
109 29 2
93 29 1
125 29 1
88 29 4
120 29 2
230 28 4
157 28 1
70 28 3
71 28 3
122 27 3
34 27 1
149 27 2
105 26 1
128 26 1
86 26 1
104 26 2
125 26 6
163 25 2
139 25 2
76 25 1
84 25 4
67 25 1
68 25 3
129 25 1