Linux / Arch / Sparc
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 2,556 units with 43,867 lines of code in units (44.7% of code).
    • 27 very long units (4,096 lines of code)
    • 104 long units (6,943 lines of code)
    • 495 medium size units (15,019 lines of code)
    • 667 small units (9,812 lines of code)
    • 1,263 very small units (7,997 lines of code)
9% | 15% | 34% | 22% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c9% | 17% | 36% | 22% | 14%
h5% | 4% | 14% | 22% | 53%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
kernel5% | 19% | 37% | 22% | 13%
net68% | 6% | 7% | 7% | 9%
mm11% | 10% | 44% | 19% | 13%
math-emu84% | 0% | 15% | 0% | 0%
include3% | 4% | 14% | 22% | 55%
vdso17% | 20% | 6% | 39% | 16%
lib0% | 33% | 23% | 17% | 25%
crypto0% | 5% | 38% | 24% | 31%
boot0% | 37% | 34% | 0% | 27%
prom0% | 0% | 21% | 49% | 28%
power0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
464 145 2
382 98 1
312 190 3
214 121 3
168 52 1
149 30 1
143 22 1
129 15 1
128 35 2
124 35 3
123 30 4
123 20 1
122 23 3
121 34 7
112 19 5
112 19 5
111 23 2
111 18 3
109 21 3
109 19 2
107 34 6
106 25 5
106 18 3
104 33 3
103 12 1
103 23 3
101 29 1
95 19 1
95 23 6
94 20 1
91 29 3
91 17 3
90 19 3
90 15 1
88 8 1
87 22 2
87 14 1
85 14 1
85 19 2
85 14 2
84 9 1
84 21 2
83 16 4
83 12 5
83 19 2
81 42 1
80 13 2
79 12 1
78 17 3
78 11 3