Linux / Drivers / Bus
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 702 units with 13,620 lines of code in units (68.5% of code).
    • 5 very long units (602 lines of code)
    • 51 long units (3,367 lines of code)
    • 156 medium size units (4,848 lines of code)
    • 203 small units (3,019 lines of code)
    • 287 very small units (1,784 lines of code)
4% | 24% | 35% | 22% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c4% | 24% | 35% | 22% | 12%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
mhi14% | 32% | 27% | 14% | 10%
ROOT0% | 21% | 39% | 23% | 15%
fsl-mc0% | 21% | 36% | 29% | 12%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
140 24 3
130 15 1
115 25 2
111 7 1
106 13 1
99 21 3
97 24 1
95 20 4
92 17 1
91 21 1
86 16 1
82 14 4
80 21 1
79 14 1
79 15 2
77 22 1
76 10 1
76 10 1
75 10 4
73 9 1
72 16 3
72 9 2
71 16 2
68 20 3
67 16 1
66 16 1
65 10 1
64 10 2
64 12 3
63 10 3
62 9 1
62 11 2
62 10 1
62 12 1
61 1 1
59 9 3
59 21 1
58 10 1
58 11 4
57 15 1
55 5 2
55 10 1
54 10 1
54 16 1
54 14 1
53 11 3
53 10 5
52 7 6
51 10 1
51 9 1