Linux / Drivers / Thermal
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,062 units with 19,317 lines of code in units (62.7% of code).
    • 11 very long units (1,358 lines of code)
    • 45 long units (2,942 lines of code)
    • 233 medium size units (7,175 lines of code)
    • 329 small units (4,949 lines of code)
    • 444 very small units (2,893 lines of code)
7% | 15% | 37% | 25% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c7% | 15% | 37% | 25% | 14%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
qcom18% | 21% | 37% | 15% | 7%
ROOT4% | 16% | 34% | 27% | 18%
tegra15% | 12% | 46% | 16% | 10%
samsung29% | 8% | 19% | 30% | 11%
ti-soc-thermal16% | 0% | 47% | 18% | 16%
intel0% | 14% | 43% | 27% | 14%
st0% | 20% | 14% | 45% | 19%
broadcom0% | 19% | 26% | 40% | 13%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
165 19 2
150 36 1
138 35 1
131 19 1
126 17 1
115 22 1
113 21 1
108 21 1
106 21 1
104 17 1
102 20 1
94 22 6
92 18 1
91 18 1
90 12 2
90 18 1
84 12 1
78 13 2
77 11 4
77 16 1
75 18 1
74 11 1
73 15 1
70 10 1
67 13 3
66 16 2
66 12 4
65 12 2
65 11 1
65 13 1
64 12 1
63 10 1
62 7 1
61 22 1
61 8 1
60 13 2
60 15 1
60 11 1
59 12 4
59 8 1
58 7 1
58 10 1
57 7 1
57 19 3
56 7 5
56 8 2
56 8 1
55 10 4
55 8 1
54 9 3