Linux / Drivers / Hv
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 340 units with 6,187 lines of code in units (73.3% of code).
    • 2 very long units (238 lines of code)
    • 21 long units (1,378 lines of code)
    • 75 medium size units (2,404 lines of code)
    • 90 small units (1,281 lines of code)
    • 152 very small units (886 lines of code)
3% | 22% | 38% | 20% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c3% | 22% | 39% | 20% | 13%
h0% | 0% | 0% | 27% | 72%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT3% | 22% | 38% | 20% | 14%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
134 21 1
104 15 4
100 10 5
87 9 6
82 19 9
77 17 1
75 13 1
71 11 1
70 11 1
67 13 4
66 12 1
66 15 2
62 8 1
61 10 1
60 14 1
60 10 4
57 10 1
55 14 1
54 9 1
53 9 1
52 11 1
52 6 1
51 4 2
50 10 1
49 5 2
49 7 3
48 13 7
47 5 1
46 11 2
45 6 1
44 7 1
43 9 4
43 14 1
42 6 2
42 5 4
42 6 1
41 10 3
41 7 1
41 8 1
40 4 2
40 11 3
39 3 6
39 3 3
39 6 1
37 3 1
37 5 2
37 3 3
36 4 1
36 7 2
36 8 4