Linux / Mm
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 4,618 units with 76,675 lines of code in units (74.6% of code).
    • 39 very long units (5,088 lines of code)
    • 190 long units (12,814 lines of code)
    • 882 medium size units (26,982 lines of code)
    • 1,238 small units (18,387 lines of code)
    • 2,269 very small units (13,404 lines of code)
6% | 16% | 35% | 23% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c6% | 16% | 35% | 23% | 17%
h0% | 5% | 24% | 26% | 43%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT7% | 17% | 34% | 23% | 17%
damon0% | 9% | 46% | 32% | 11%
kfence0% | 13% | 36% | 26% | 23%
kasan0% | 0% | 41% | 32% | 26%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
246 48 5
233 90 5
187 41 2
180 12 2
167 41 1
167 45 8
162 50 6
160 44 4
156 32 8
138 32 4
137 30 4
135 33 4
134 19 2
127 28 7
124 25 7
124 34 4
122 28 2
121 29 2
118 19 3
114 24 4
114 24 7
113 46 8
113 29 4
113 29 7
112 35 1
111 29 4
111 29 6
110 16 3
107 22 6
105 21 4
105 23 1
104 28 3
103 18 3
103 32 2
103 11 6
103 33 4
103 45 7
102 30 3
101 35 9
100 35 9
99 22 2
99 36 6
99 30 7
98 27 4
98 15 1
97 23 4
96 24 6
96 16 4
95 18 2
94 24 2