hhvm / hack-router
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 100 units with 890 lines of code in units (77.7% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (82 lines of code)
    • 8 medium size units (272 lines of code)
    • 13 small units (175 lines of code)
    • 78 very small units (361 lines of code)
0% | 9% | 30% | 19% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
php0% | 9% | 30% | 19% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
router/PrefixMatching0% | 50% | 0% | 9% | 39%
router0% | 0% | 54% | 23% | 22%
PatternParser0% | 0% | 51% | 9% | 39%
uri-patterns0% | 0% | 47% | 6% | 45%
request-parameters0% | 0% | 0% | 47% | 52%
http-exceptions0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
82 13 2
48 6 1
47 9 2
46 5 1
30 4 0
27 1 3
26 5 0
26 6 0
22 3 3
19 4 2
17 2 3
17 4 1
16 2 1
15 1 3
13 3 1
12 1 3
11 3 1
11 1 2
11 1 2
11 2 2
11 1 2
11 2 1
10 2 1
10 1 2
10 1 1
10 2 2
9 3 0
9 1 2
9 1 1
8 1 0
8 1 2
8 2 0
8 1 4
8 1 1
8 1 0
7 2 0
7 2 1
6 1 1
6 1 1
6 1 2
6 1 2
6 1 0
6 1 2
6 2 0
6 1 0
6 1 1
6 1 4
6 2 0
5 1 1
5 1 1