Linux / Drivers / Tty
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 5,299 units with 92,268 lines of code in units (73.4% of code).
    • 48 very long units (7,290 lines of code)
    • 241 long units (16,132 lines of code)
    • 1,004 medium size units (31,429 lines of code)
    • 1,424 small units (20,950 lines of code)
    • 2,582 very small units (16,467 lines of code)
7% | 17% | 34% | 22% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c7% | 17% | 34% | 22% | 17%
h0% | 0% | 0% | 34% | 65%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
serial8% | 16% | 34% | 22% | 18%
ROOT7% | 19% | 33% | 23% | 16%
vt14% | 18% | 33% | 17% | 17%
hvc0% | 17% | 34% | 29% | 17%
ipwireless0% | 28% | 38% | 18% | 14%
serdev0% | 0% | 30% | 33% | 36%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
1142 1 3
398 145 3
167 48 3
166 29 1
166 25 1
163 36 1
159 38 1
156 25 1
155 52 3
151 43 2
141 34 3
139 49 4
137 21 4
136 17 1
134 26 1
131 20 4
130 59 4
130 23 1
126 35 6
126 26 1
124 53 1
124 44 3
124 39 1
122 21 1
122 25 3
120 14 1
119 27 4
118 48 3
118 31 1
116 27 3
115 24 3
113 29 3
113 46 2
112 16 2
111 26 1
109 22 1
109 22 1
108 27 2
108 23 3
107 73 3
105 22 4
105 21 2
104 22 2
103 18 1
103 13 1
102 26 2
102 22 1
101 22 1
100 17 2
100 11 1