Linux / Drivers / I2c
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 2,455 units with 49,749 lines of code in units (71.8% of code).
    • 34 very long units (4,395 lines of code)
    • 203 long units (14,127 lines of code)
    • 484 medium size units (15,368 lines of code)
    • 608 small units (8,902 lines of code)
    • 1,126 very small units (6,957 lines of code)
8% | 28% | 30% | 17% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c8% | 28% | 30% | 17% | 13%
h0% | 0% | 0% | 42% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
busses8% | 29% | 31% | 17% | 13%
ROOT12% | 13% | 35% | 22% | 16%
algos23% | 20% | 30% | 10% | 14%
muxes0% | 49% | 16% | 14% | 18%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
195 30 1
189 60 7
189 32 4
177 24 7
174 42 7
165 29 1
161 33 2
149 30 3
147 28 7
147 33 3
141 27 4
139 27 7
131 27 1
124 24 1
122 26 4
116 21 2
113 25 7
112 29 1
112 24 3
111 28 7
111 23 1
108 19 1
108 17 1
108 28 3
107 18 1
107 24 3
107 17 1
106 31 1
105 25 7
104 25 2
104 16 1
103 20 2
102 15 1
101 21 1
100 24 2
100 17 1
100 22 1
99 16 1
99 18 1
99 21 2
98 25 1
98 15 4
97 12 1
97 14 1
97 25 2
97 11 2
94 24 2
94 15 1
93 8 3
92 22 2