hhvm / type-assert
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 198 units with 1,613 lines of code in units (88.9% of code).
    • 1 very long units (168 lines of code)
    • 0 long units (0 lines of code)
    • 6 medium size units (149 lines of code)
    • 45 small units (636 lines of code)
    • 146 very small units (660 lines of code)
10% | 0% | 9% | 39% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
hack10% | 0% | 9% | 39% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/TypeSpec/__Private12% | 0% | 11% | 44% | 31%
src0% | 0% | 0% | 12% | 87%
src/TypeSpec0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
168 44 1
31 7 1
27 4 1
26 5 1
23 5 1
21 7 1
21 3 2
20 8 1
20 7 1
18 6 1
18 7 1
17 2 1
17 4 1
17 6 1
17 2 1
17 2 1
16 2 1
16 2 1
16 4 1
16 2 1
15 2 0
15 2 1
15 3 0
15 2 1
15 5 1
14 2 1
14 2 1
14 2 1
14 2 1
14 3 1
14 1 1
14 3 1
14 3 1
14 6 1
14 6 1
13 3 1
13 2 1
12 3 1
12 4 1
12 4 1
12 2 1
12 3 1
11 2 1
11 2 1
11 3 1
11 2 1
11 1 3
11 2 1
11 2 1
11 1 3