Linux / Drivers / Hwmon
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 3,865 units with 76,311 lines of code in units (60.3% of code).
    • 45 very long units (7,365 lines of code)
    • 202 long units (13,522 lines of code)
    • 903 medium size units (27,500 lines of code)
    • 1,119 small units (17,084 lines of code)
    • 1,596 very small units (10,840 lines of code)
9% | 17% | 36% | 22% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c9% | 17% | 36% | 22% | 14%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT8% | 17% | 35% | 23% | 15%
pmbus15% | 22% | 41% | 15% | 6%
occ20% | 16% | 49% | 11% | 2%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
717 98 1
311 106 3
304 1 3
287 64 1
269 1 5
253 29 1
223 1 5
219 65 1
177 39 1
174 53 4
170 46 1
168 94 2
168 1 6
156 1 6
152 26 4
149 37 1
146 1 4
142 1 5
142 57 1
140 30 1
139 29 1
138 48 1
137 1 5
133 25 1
129 30 1
125 40 1
122 15 1
122 20 1
116 16 2
114 34 1
114 31 1
113 26 4
112 27 1
111 22 2
110 14 1
109 15 1
109 36 4
108 36 4
106 26 1
106 24 1
106 34 1
106 20 1
105 31 1
105 19 1
103 17 1
99 29 1
99 20 2
98 10 2
98 23 1
96 24 1