Linux / Documentation
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 100 units with 2,098 lines of code in units (0.3% of code).
    • 2 very long units (344 lines of code)
    • 5 long units (383 lines of code)
    • 22 medium size units (696 lines of code)
    • 30 small units (453 lines of code)
    • 41 very small units (222 lines of code)
16% | 18% | 33% | 21% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
pl44% | 11% | 29% | 12% | 2%
py0% | 24% | 35% | 24% | 14%
c0% | 0% | 34% | 46% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
trace44% | 11% | 29% | 12% | 2%
sphinx0% | 24% | 35% | 24% | 14%
usb0% | 0% | 61% | 15% | 23%
scheduler0% | 0% | 0% | 88% | 11%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
175 32 0
169 26 0
98 1 1
89 18 0
73 1 2
67 20 1
56 16 3
49 8 2
47 6 0
45 6 0
42 11 3
41 18 1
37 7 0
33 3 1
33 5 1
32 7 0
30 10 3
29 11 3
29 1 1
28 9 3
28 9 3
27 7 3
27 5 2
26 8 1
25 3 0
22 7 0
22 7 0
22 3 1
22 3 1
20 3 3
20 9 4
20 3 3
19 6 1
19 5 3
18 4 0
18 4 0
17 4 3
17 8 3
17 3 1
17 7 2
16 5 1
16 4 1
16 6 3
15 4 1
14 4 1
14 4 3
14 5 3
14 6 2
13 3 0
13 4 1