Linux / Drivers / Regulator
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 1,650 units with 35,847 lines of code in units (48.1% of code).
    • 25 very long units (3,441 lines of code)
    • 101 long units (6,997 lines of code)
    • 457 medium size units (14,246 lines of code)
    • 501 small units (7,418 lines of code)
    • 566 very small units (3,745 lines of code)
9% | 19% | 39% | 20% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c9% | 19% | 39% | 20% | 10%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT9% | 19% | 39% | 20% | 10%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
248 56 1
198 60 4
181 31 1
164 29 2
157 51 1
155 22 1
152 35 1
150 20 2
140 25 1
139 33 1
139 35 5
136 31 2
135 25 1
132 28 2
123 22 1
121 21 2
120 38 1
114 26 3
112 18 1
108 20 2
106 19 2
105 20 1
104 18 1
101 17 2
101 25 2
100 24 2
98 13 1
98 30 2
97 24 5
97 18 1
96 22 2
96 16 1
96 27 2
95 23 3
95 16 1
93 20 2
92 21 2
91 16 1
91 16 1
90 19 6
90 18 1
90 14 1
89 20 2
88 17 5
86 23 3
85 24 1
85 15 2
84 12 1
83 23 2
82 20 1