hhvm / hsl-experimental
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 169 units with 1,298 lines of code in units (62.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 11 medium size units (289 lines of code)
    • 29 small units (429 lines of code)
    • 129 very small units (580 lines of code)
0% | 0% | 22% | 33% | 44%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
php0% | 0% | 22% | 33% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
datetime/DateTime0% | 0% | 30% | 26% | 42%
datetime/_Private0% | 0% | 18% | 53% | 27%
datetime0% | 0% | 25% | 20% | 54%
str/utf80% | 0% | 0% | 35% | 64%
str/grapheme0% | 0% | 0% | 33% | 66%
debug0% | 0% | 0% | 0% | 100%
datetime/MonoTime0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
38 10 1
34 2 8
32 2 0
30 13 9
26 1 8
24 4 4
21 1 8
21 1 8
21 1 8
21 1 8
21 1 8
20 1 7
20 1 8
20 1 8
20 1 8
19 1 2
19 1 7
19 1 8
18 1 7
17 1 4
16 4 4
15 3 3
14 1 1
14 1 1
14 1 1
14 1 1
14 1 1
14 3 3
13 3 1
13 3 1
12 4 1
12 1 0
12 2 2
12 1 1
12 1 1
12 3 3
11 2 0
11 1 0
11 2 1
11 2 1
10 5 0
10 1 5
10 1 3
9 1 2
9 3 3
8 1 1
8 1 1
8 1 1
8 1 1
8 1 0