Linux / Arch / Arc
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 419 units with 6,639 lines of code in units (44.9% of code).
    • 4 very long units (1,133 lines of code)
    • 12 long units (784 lines of code)
    • 60 medium size units (1,820 lines of code)
    • 99 small units (1,464 lines of code)
    • 244 very small units (1,438 lines of code)
17% | 11% | 27% | 22% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c16% | 13% | 30% | 20% | 19%
h20% | 4% | 12% | 31% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
kernel22% | 13% | 26% | 20% | 17%
include20% | 4% | 12% | 31% | 32%
mm0% | 10% | 43% | 17% | 28%
plat-hsdk0% | 46% | 38% | 10% | 4%
plat-axs10x0% | 0% | 32% | 67% | 0%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
377 116 1
342 93 5
235 10 1
179 47 5
86 16 2
81 26 2
78 14 1
75 15 1
69 19 3
67 4 6
59 1 1
56 1 1
55 2 3
54 25 1
53 8 5
51 5 1
47 12 3
47 12 1
47 20 1
46 8 1
46 8 1
45 13 1
44 3 1
41 9 3
41 4 5
41 5 2
40 4 1
39 1 2
39 10 1
39 3 2
37 5 2
36 12 1
35 8 4
34 9 1
34 5 2
33 9 1
31 2 1
31 9 5
31 8 4
31 6 1
30 6 3
30 8 10
30 5 2
29 4 1
28 3 1
28 5 3
28 4 2
27 12 1
27 6 4
27 7 1