Linux / Drivers / Spi
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,530 units with 52,873 lines of code in units (74.8% of code).
    • 44 very long units (5,689 lines of code)
    • 179 long units (12,617 lines of code)
    • 556 medium size units (17,485 lines of code)
    • 692 small units (10,202 lines of code)
    • 1,059 very small units (6,880 lines of code)
10% | 23% | 33% | 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% | 23% | 33% | 19% | 12%
h0% | 0% | 0% | 23% | 76%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT10% | 23% | 33% | 19% | 13%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
186 27 1
185 25 1
181 23 2
179 28 1
174 37 3
161 30 1
158 22 1
157 26 1
156 28 2
154 29 1
147 24 1
141 23 1
139 21 1
137 23 1
132 32 1
131 22 1
130 22 1
129 36 3
128 24 1
123 28 2
122 12 2
122 16 1
120 21 3
120 18 1
118 14 1
116 18 2
115 18 1
115 30 3
114 23 1
112 18 1
112 15 1
111 33 2
110 15 1
109 14 1
109 15 1
107 14 1
106 14 1
105 14 1
105 17 1
104 13 1
103 17 2
103 18 2
102 16 1
101 18 3
100 11 1
100 29 3
98 10 1
98 20 4
98 13 1
97 12 1