Linux / Drivers / Hid
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 2,290 units with 52,982 lines of code in units (68.5% of code).
    • 43 very long units (6,404 lines of code)
    • 158 long units (10,908 lines of code)
    • 642 medium size units (20,219 lines of code)
    • 684 small units (10,328 lines of code)
    • 763 very small units (5,123 lines of code)
12% | 20% | 38% | 19% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c12% | 20% | 38% | 19% | 9%
h0% | 0% | 0% | 21% | 78%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT12% | 19% | 38% | 20% | 9%
usbhid19% | 23% | 36% | 12% | 7%
intel-ish-hid9% | 25% | 34% | 16% | 13%
amd-sfh-hid0% | 35% | 31% | 19% | 13%
i2c-hid0% | 22% | 46% | 19% | 11%
surface-hid0% | 0% | 50% | 28% | 20%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
571 346 3
249 63 2
234 38 3
230 45 3
202 57 3
183 28 5
166 37 2
154 32 7
153 29 2
151 34 1
146 45 7
142 40 4
141 63 3
141 13 3
141 18 1
140 34 1
140 56 2
139 27 3
137 49 1
136 24 4
133 26 7
131 16 2
129 50 2
128 26 2
128 13 1
125 22 4
124 18 3
123 34 2
122 22 2
120 36 3
120 33 2
119 20 2
116 25 1
116 28 3
115 19 2
114 62 2
112 14 2
111 57 1
110 31 1
105 26 4
104 29 2
102 10 2
101 46 4
100 6 2
99 19 3
99 25 1
98 18 7
98 31 4
97 14 2
97 13 1