Linux / Drivers / Iio
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 6,018 units with 127,909 lines of code in units (64.0% of code).
    • 42 very long units (5,307 lines of code)
    • 398 long units (26,365 lines of code)
    • 1,748 medium size units (54,209 lines of code)
    • 1,923 small units (28,858 lines of code)
    • 1,907 very small units (13,170 lines of code)
4% | 20% | 42% | 22% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c4% | 20% | 42% | 22% | 10%
h0% | 0% | 0% | 10% | 89%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
adc6% | 23% | 39% | 20% | 10%
accel4% | 15% | 45% | 24% | 9%
light2% | 24% | 43% | 21% | 8%
imu4% | 19% | 46% | 22% | 6%
magnetometer8% | 20% | 40% | 21% | 9%
chemical6% | 16% | 41% | 26% | 9%
gyro5% | 22% | 36% | 24% | 10%
frequency9% | 23% | 47% | 14% | 5%
dac1% | 18% | 39% | 24% | 16%
dummy23% | 16% | 26% | 19% | 13%
ROOT2% | 20% | 34% | 21% | 19%
pressure2% | 18% | 51% | 17% | 10%
addac11% | 6% | 31% | 34% | 16%
common0% | 26% | 35% | 30% | 7%
proximity0% | 12% | 48% | 30% | 8%
temperature0% | 14% | 52% | 22% | 10%
humidity0% | 24% | 47% | 18% | 9%
health0% | 23% | 39% | 30% | 6%
orientation0% | 43% | 43% | 6% | 7%
multiplexer0% | 51% | 35% | 11% | 1%
cdc0% | 40% | 49% | 5% | 5%
potentiostat0% | 32% | 37% | 21% | 8%
position0% | 17% | 56% | 17% | 7%
afe0% | 26% | 51% | 13% | 8%
amplifiers0% | 18% | 66% | 7% | 7%
resolver0% | 36% | 63% | 0% | 0%
buffer0% | 7% | 18% | 35% | 38%
potentiometer0% | 0% | 50% | 46% | 3%
trigger0% | 0% | 45% | 35% | 19%
filter0% | 0% | 63% | 21% | 15%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
191 36 3
188 56 2
186 29 2
177 35 1
174 34 4
164 29 1
145 27 2
144 22 2
143 30 2
139 23 1
134 31 5
134 23 2
130 19 2
130 25 1
130 24 1
128 26 1
127 24 1
125 36 1
123 20 1
122 24 5
122 20 1
122 27 1
120 21 4
119 19 2
116 16 2
115 21 5
107 19 4
106 18 2
106 18 1
106 17 2
105 19 1
104 27 1
104 23 1
104 20 4
103 18 2
103 16 2
102 16 6
102 18 2
102 20 6
102 23 1
102 19 5
101 17 1
100 27 1
99 16 1
99 16 2
99 16 4
99 14 1
97 25 2
96 12 6
96 23 4