hhvm / hack-router-codegen
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 72 units with 1,056 lines of code in units (78.0% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (172 lines of code)
    • 15 medium size units (477 lines of code)
    • 15 small units (199 lines of code)
    • 39 very small units (208 lines of code)
0% | 16% | 45% | 18% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
hack0% | 16% | 45% | 18% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 22% | 53% | 6% | 17%
src/privateimpl0% | 0% | 57% | 31% | 10%
src/uriparameters/spec0% | 0% | 0% | 64% | 35%
src/uriparameters0% | 0% | 0% | 74% | 25%
src/uribuilder0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
63 5 1
57 3 1
52 6 0
46 3 0
43 1 0
41 4 0
35 2 1
35 1 0
34 3 1
33 3 0
31 2 4
30 10 2
28 5 0
27 3 1
27 1 2
23 1 1
23 1 0
21 4 1
19 3 2
16 4 1
15 2 3
15 4 1
14 1 1
13 1 1
13 1 4
12 1 1
12 1 1
12 1 1
12 1 1
12 1 0
12 3 0
11 1 0
11 1 1
9 1 5
9 1 5
9 1 2
9 2 2
8 1 3
8 1 3
7 1 3
7 1 2
7 1 2
6 1 1
6 1 0
6 1 0
6 1 2
6 1 1
6 1 1
6 1 1
5 1 1