hhvm / xhp-lib
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 232 units with 1,741 lines of code in units (49.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (60 lines of code)
    • 9 medium size units (274 lines of code)
    • 28 small units (406 lines of code)
    • 194 very small units (1,001 lines of code)
0% | 3% | 15% | 23% | 57%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
hack0% | 3% | 15% | 23% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
core0% | 10% | 28% | 27% | 33%
Reflection0% | 0% | 31% | 32% | 35%
html/tags/t0% | 0% | 36% | 0% | 63%
ChildValidation0% | 0% | 0% | 28% | 71%
exceptions0% | 0% | 0% | 66% | 33%
html0% | 0% | 0% | 42% | 57%
html/tags/r0% | 0% | 0% | 28% | 71%
html/tags/f0% | 0% | 0% | 31% | 68%
html/tags/m0% | 0% | 0% | 35% | 64%
html/tags/d0% | 0% | 0% | 0% | 100%
html/tags/s0% | 0% | 0% | 0% | 100%
html/tags/h0% | 0% | 0% | 0% | 100%
html/tags/c0% | 0% | 0% | 0% | 100%
html/tags/a0% | 0% | 0% | 0% | 100%
html/tags/b0% | 0% | 0% | 0% | 100%
html/tags/l0% | 0% | 0% | 0% | 100%
html/tags/p0% | 0% | 0% | 0% | 100%
html/tags/o0% | 0% | 0% | 0% | 100%
html/tags/v0% | 0% | 0% | 0% | 100%
html/tags/n0% | 0% | 0% | 0% | 100%
html/tags/i0% | 0% | 0% | 0% | 100%
html/tags/e0% | 0% | 0% | 0% | 100%
html/tags/u0% | 0% | 0% | 0% | 100%
html/tags/q0% | 0% | 0% | 0% | 100%
html/tags/k0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
60 14 2
50 14 2
41 11 0
40 6 3
29 10 1
24 7 0
24 3 0
23 1 0
22 6 0
21 3 0
19 7 1
18 5 1
18 6 0
18 1 2
18 7 0
17 5 1
17 2 0
17 2 0
16 4 0
16 4 1
16 1 2
16 1 0
16 1 0
14 3 0
14 3 0
14 2 0
14 6 0
13 1 0
13 2 0
12 3 0
12 1 0
12 2 0
11 3 0
11 2 1
11 2 0
11 1 0
11 3 0
11 1 2
10 1 0
10 1 0
10 1 0
10 1 2
10 1 2
10 1 1
10 2 0
9 2 0
9 2 2
9 2 1
9 2 2
9 2 2