Linux / Arch / Riscv
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 991 units with 12,294 lines of code in units (54.7% of code).
    • 4 very long units (1,383 lines of code)
    • 20 long units (1,436 lines of code)
    • 106 medium size units (3,207 lines of code)
    • 176 small units (2,550 lines of code)
    • 685 very small units (3,718 lines of code)
11% | 11% | 26% | 20% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c13% | 13% | 30% | 21% | 20%
h0% | 0% | 1% | 15% | 83%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
net34% | 12% | 14% | 7% | 30%
kernel9% | 9% | 28% | 23% | 27%
kvm0% | 21% | 40% | 25% | 13%
mm0% | 10% | 38% | 24% | 25%
errata0% | 0% | 23% | 40% | 35%
include0% | 0% | 0% | 23% | 76%
lib0% | 0% | 0% | 44% | 55%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
573 235 3
430 1 1
278 140 3
102 13 4
92 20 4
85 23 1
83 19 4
81 18 5
79 16 5
78 20 4
77 33 2
76 18 4
76 20 1
74 11 1
74 20 5
73 12 5
68 11 1
67 2 1
66 17 1
63 19 1
58 15 4
56 11 4
55 16 5
55 3 4
50 14 4
48 9 7
46 12 5
46 7 3
45 8 1
44 7 2
44 9 2
43 14 5
43 6 1
42 15 3
42 15 3
42 11 1
40 11 2
39 9 2
39 7 1
38 9 1
38 12 3
37 9 6
37 11 3
37 8 4
37 7 1
37 12 1
37 4 3
37 8 1
36 5 1
36 8 4