Linux / Arch / Xtensa
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 453 units with 5,782 lines of code in units (29.2% of code).
    • 3 very long units (361 lines of code)
    • 10 long units (657 lines of code)
    • 67 medium size units (1,969 lines of code)
    • 81 small units (1,188 lines of code)
    • 292 very small units (1,607 lines of code)
6% | 11% | 34% | 20% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c7% | 10% | 37% | 21% | 22%
h0% | 12% | 19% | 17% | 50%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
kernel7% | 11% | 34% | 23% | 22%
mm18% | 7% | 28% | 32% | 12%
include0% | 14% | 21% | 16% | 47%
lib0% | 100% | 0% | 0% | 0%
platforms0% | 5% | 49% | 10% | 34%
boot0% | 0% | 90% | 0% | 9%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
134 40 1
123 45 5
104 1 1
95 6 1
85 9 1
77 6 1
65 9 5
60 1 5
60 12 2
57 9 3
53 5 2
53 1 1
52 16 1
50 12 3
47 23 3
45 1 1
43 7 1
43 1 2
43 7 6
42 14 1
41 13 3
40 6 1
39 14 3
38 13 4
38 9 4
37 6 3
37 10 3
34 6 3
33 3 6
33 7 2
32 12 1
32 6 3
31 8 1
31 3 1
31 10 1
30 6 2
30 6 2
29 7 5
29 3 3
29 3 1
29 1 2
29 6 2
29 5 3
28 4 1
28 7 1
28 12 3
28 12 5
28 8 3
27 5 2
27 1 5