Linux / Drivers / Soc
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,799 units with 34,858 lines of code in units (57.3% of code).
    • 22 very long units (2,747 lines of code)
    • 102 long units (7,070 lines of code)
    • 423 medium size units (13,042 lines of code)
    • 495 small units (7,333 lines of code)
    • 757 very small units (4,666 lines of code)
7% | 20% | 37% | 21% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c7% | 20% | 37% | 21% | 12%
h0% | 0% | 0% | 6% | 93%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
fsl13% | 16% | 32% | 20% | 17%
qcom8% | 19% | 39% | 20% | 12%
tegra9% | 16% | 41% | 19% | 13%
imx16% | 40% | 23% | 15% | 4%
ixp4xx18% | 28% | 20% | 14% | 18%
mediatek6% | 10% | 33% | 32% | 17%
rockchip15% | 22% | 40% | 14% | 6%
ti2% | 29% | 37% | 21% | 10%
bcm6% | 18% | 33% | 33% | 8%
aspeed0% | 40% | 32% | 18% | 8%
renesas0% | 24% | 48% | 11% | 14%
amlogic0% | 22% | 54% | 15% | 7%
xilinx0% | 19% | 41% | 27% | 11%
samsung0% | 13% | 42% | 27% | 16%
apple0% | 49% | 16% | 14% | 20%
dove0% | 24% | 53% | 13% | 8%
sunxi0% | 0% | 65% | 29% | 4%
versatile0% | 0% | 100% | 0% | 0%
atmel0% | 0% | 82% | 0% | 17%
sifive0% | 0% | 58% | 22% | 19%
actions0% | 0% | 63% | 15% | 21%
ux5000% | 0% | 61% | 13% | 25%
lantiq0% | 0% | 100% | 0% | 0%
gemini0% | 0% | 100% | 0% | 0%
litex0% | 0% | 40% | 35% | 24%
canaan0% | 0% | 0% | 68% | 31%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
190 38 2
174 38 1
156 31 2
155 31 1
142 29 3
126 30 9
122 19 3
122 26 1
122 22 1
119 28 3
118 27 5
118 20 2
117 18 1
116 31 1
114 24 1
109 20 1
108 16 3
105 14 1
104 23 1
104 17 1
103 25 2
103 25 2
100 18 1
98 15 1
97 14 2
97 13 3
96 24 5
93 17 1
93 18 2
92 24 3
91 19 1
91 13 1
90 19 1
89 15 1
89 23 2
87 16 1
86 20 5
85 20 1
85 52 3
84 17 1
83 15 1
81 17 2
80 15 2
80 17 2
79 10 1
79 13 1
79 14 1
79 14 6
78 14 1
78 20 2