Linux / Arch / Alpha
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 452 units with 5,446 lines of code in units (13.5% of code).
    • 5 very long units (675 lines of code)
    • 6 long units (350 lines of code)
    • 49 medium size units (1,512 lines of code)
    • 86 small units (1,291 lines of code)
    • 306 very small units (1,618 lines of code)
12% | 6% | 27% | 23% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c17% | 9% | 35% | 21% | 16%
h0% | 0% | 10% | 29% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
kernel16% | 9% | 35% | 20% | 17%
boot33% | 0% | 32% | 20% | 13%
lib0% | 22% | 32% | 29% | 15%
include0% | 0% | 10% | 29% | 60%
mm0% | 0% | 0% | 100% | 0%
math-emu0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
160 20 4
150 54 3
135 6 1
119 13 4
111 6 1
63 2 1
60 13 2
60 1 1
57 15 5
55 3 1
55 14 5
50 6 1
49 8 2
49 1 4
48 11 1
44 8 4
44 8 2
43 9 2
41 12 3
41 15 3
41 9 5
40 11 3
40 11 3
39 8 1
37 6 1
37 1 1
37 3 5
36 8 4
34 2 1
33 8 2
31 4 3
30 1 1
28 4 2
27 3 3
27 5 3
27 8 1
27 4 2
27 6 4
26 1 1
26 4 1
26 1 1
25 5 3
24 7 1
24 8 1
24 6 5
24 6 4
24 5 4
23 2 2
23 9 4
23 7 1