Linux / Drivers / W1
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 368 units with 7,227 lines of code in units (76.6% of code).
    • 1 very long units (115 lines of code)
    • 20 long units (1,340 lines of code)
    • 101 medium size units (3,138 lines of code)
    • 124 small units (1,812 lines of code)
    • 122 very small units (822 lines of code)
1% | 18% | 43% | 25% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c1% | 18% | 43% | 25% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT6% | 14% | 35% | 27% | 15%
masters0% | 28% | 27% | 29% | 13%
slaves0% | 14% | 56% | 21% | 7%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
115 22 2
99 10 4
85 17 1
75 22 2
73 18 3
73 12 2
72 10 4
72 19 3
69 8 3
68 17 4
67 9 1
66 18 1
66 8 2
64 13 1
61 10 2
57 1 3
57 12 1
55 11 2
55 10 3
53 16 2
53 4 2
50 13 3
50 7 1
47 7 1
46 9 6
46 9 6
46 9 6
45 10 3
45 8 1
44 7 2
44 7 2
43 10 5
43 9 1
43 9 3
43 6 3
43 10 2
42 9 6
42 10 4
42 5 2
41 10 6
40 11 1
39 7 3
39 8 4
39 13 4
39 5 6
39 8 2
38 3 1
38 9 6
37 3 2
36 9 4