Linux / Drivers / Phy
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 1,692 units with 37,932 lines of code in units (53.8% of code).
    • 30 very long units (4,321 lines of code)
    • 138 long units (9,366 lines of code)
    • 428 medium size units (13,383 lines of code)
    • 421 small units (6,228 lines of code)
    • 675 very small units (4,634 lines of code)
11% | 24% | 35% | 16% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c11% | 24% | 35% | 16% | 11%
h0% | 0% | 0% | 19% | 80%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
microchip53% | 13% | 16% | 13% | 2%
tegra17% | 19% | 28% | 19% | 14%
qualcomm12% | 31% | 31% | 14% | 9%
ti12% | 27% | 32% | 12% | 14%
ROOT22% | 10% | 31% | 21% | 14%
rockchip10% | 27% | 35% | 12% | 12%
cadence11% | 33% | 34% | 11% | 10%
mscc54% | 0% | 28% | 4% | 12%
allwinner17% | 15% | 36% | 17% | 12%
st9% | 14% | 36% | 26% | 12%
intel10% | 34% | 32% | 9% | 13%
marvell5% | 34% | 38% | 13% | 8%
freescale21% | 11% | 43% | 9% | 13%
broadcom0% | 27% | 36% | 21% | 14%
mediatek0% | 28% | 36% | 17% | 17%
samsung0% | 28% | 46% | 16% | 8%
hisilicon0% | 21% | 54% | 16% | 7%
socionext0% | 25% | 47% | 14% | 13%
renesas0% | 26% | 22% | 31% | 19%
amlogic0% | 19% | 51% | 15% | 13%
motorola0% | 26% | 34% | 24% | 14%
xilinx0% | 25% | 46% | 8% | 18%
lantiq0% | 18% | 60% | 17% | 4%
ralink0% | 24% | 40% | 19% | 14%
ingenic0% | 0% | 40% | 41% | 17%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
377 3 2
370 3 2
208 46 1
180 24 1
167 9 3
166 21 1
149 30 1
147 32 1
146 8 1
141 29 1
132 11 1
128 23 1
124 26 3
123 20 1
119 6 2
118 24 1
117 21 1
115 26 1
113 9 2
111 23 1
110 6 1
110 19 1
109 2 1
108 7 1
108 3 5
107 20 1
107 7 1
104 3 5
104 26 3
103 22 1
100 16 1
99 18 1
97 5 1
97 7 5
93 11 1
93 7 2
93 20 1
92 20 2
92 14 3
91 5 3
90 14 3
89 12 1
89 14 1
87 20 1
87 17 1
85 16 1
84 6 1
84 20 1
83 12 1
83 18 1