hhvm / hhvm-third-party
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,278 units with 56,956 lines of code in units (29.7% of code).
    • 80 very long units (25,118 lines of code)
    • 129 long units (9,226 lines of code)
    • 282 medium size units (9,059 lines of code)
    • 507 small units (7,364 lines of code)
    • 1,280 very small units (6,189 lines of code)
44% | 16% | 15% | 12% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp44% | 15% | 11% | 15% | 13%
c46% | 18% | 21% | 8% | 5%
cc27% | 12% | 28% | 22% | 8%
h10% | 0% | 0% | 26% | 63%
rb0% | 0% | 59% | 26% | 14%
pas0% | 0% | 24% | 63% | 12%
pl0% | 0% | 52% | 30% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ragel/src/ragel44% | 15% | 10% | 15% | 14%
pcre77% | 3% | 8% | 6% | 3%
pcre/sljit34% | 21% | 27% | 9% | 7%
libmbfl/filters10% | 35% | 33% | 16% | 4%
libmbfl/mbfl0% | 28% | 0% | 29% | 42%
ragel/src/contrib0% | 0% | 59% | 26% | 14%
ragel/src/aapl0% | 0% | 0% | 41% | 58%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
6262 2791 0
2372 315 2
2276 573 2
1818 1 1
722 1 1
546 1 1
380 14 2
341 1 1
287 102 6
261 149 5
240 59 3
238 88 6
237 87 6
236 107 5
221 75 6
197 64 3
197 80 3
196 32 2
188 79 8
181 60 6
173 20 0
173 21 0
170 26 0
163 54 9
162 58 7
151 73 6
151 36 7
150 27 0
149 27 0
149 2 0
146 27 0
144 27 0
143 27 0
143 21 0
143 16 0
142 16 0
142 27 0
140 46 2
140 46 2
139 48 6
136 44 2
135 48 7
134 18 0
130 23 8
129 31 6
128 20 0
125 48 6
124 21 0
124 36 3
124 16 0