Linux / Drivers / Char
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,520 units with 51,581 lines of code in units (74.0% of code).
    • 36 very long units (5,610 lines of code)
    • 156 long units (10,474 lines of code)
    • 602 medium size units (18,735 lines of code)
    • 672 small units (10,043 lines of code)
    • 1,054 very small units (6,719 lines of code)
10% | 20% | 36% | 19% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c10% | 20% | 36% | 19% | 12%
h0% | 0% | 0% | 10% | 89%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ipmi15% | 20% | 33% | 18% | 12%
mwave48% | 6% | 29% | 11% | 2%
xillybus30% | 31% | 28% | 4% | 4%
pcmcia17% | 19% | 38% | 18% | 6%
ROOT7% | 24% | 32% | 21% | 13%
tpm4% | 21% | 39% | 20% | 14%
agp3% | 17% | 38% | 24% | 15%
hw_random0% | 13% | 43% | 21% | 21%
xilinx_hwicap0% | 14% | 49% | 14% | 21%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
263 60 1
257 48 3
256 26 3
251 64 4
247 72 3
224 43 2
211 39 1
209 57 4
195 40 2
192 40 3
184 52 4
152 36 4
146 22 2
143 35 5
141 29 2
141 22 1
139 43 2
138 9 3
138 33 2
136 36 3
134 16 3
127 37 2
124 25 1
123 33 2
121 26 3
120 38 1
116 11 3
116 10 5
113 21 1
113 14 5
109 24 1
108 35 3
108 11 1
106 29 4
105 18 1
104 17 1
100 31 4
100 13 9
99 13 3
99 34 2
99 32 6
97 21 2
96 22 1
96 13 1
95 17 4
95 21 2
94 17 3
92 10 1
89 14 1
89 23 1