Linux / Arch / Um
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 1,103 units with 16,840 lines of code in units (69.8% of code).
    • 1 very long units (106 lines of code)
    • 38 long units (2,622 lines of code)
    • 219 medium size units (6,723 lines of code)
    • 259 small units (3,825 lines of code)
    • 586 very small units (3,564 lines of code)
<1% | 15% | 39% | 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
c<1% | 16% | 40% | 23% | 19%
h0% | 0% | 20% | 4% | 75%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
drivers1% | 16% | 43% | 21% | 17%
os-Linux0% | 14% | 42% | 24% | 18%
kernel0% | 16% | 29% | 26% | 26%
include0% | 0% | 10% | 5% | 83%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
106 17 1
97 25 2
96 27 2
93 17 1
91 23 3
90 6 2
88 13 5
88 10 5
86 23 7
83 19 1
80 21 1
79 12 2
76 23 5
69 8 1
69 14 1
68 14 1
68 18 8
65 7 3
65 12 1
64 8 1
63 7 2
62 8 6
62 16 2
61 8 1
61 14 4
60 19 4
60 11 2
60 15 2
59 8 1
59 9 1
58 7 7
57 9 1
57 11 1
56 10 1
55 11 1
55 9 4
54 11 1
54 11 3
54 10 3
50 6 1
50 15 3
50 9 1
49 8 3
49 9 5
49 9 2
48 9 1
47 10 1
47 10 2
47 9 1
47 6 1