hhvm / hacktest
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 74 units with 1,062 lines of code in units (85.4% of code).
    • 1 very long units (170 lines of code)
    • 3 long units (208 lines of code)
    • 9 medium size units (326 lines of code)
    • 13 small units (170 lines of code)
    • 48 very small units (188 lines of code)
16% | 19% | 30% | 16% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
hack16% | 19% | 30% | 16% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Framework65% | 0% | 0% | 21% | 12%
src/_Private0% | 21% | 49% | 17% | 11%
src/Retriever0% | 36% | 48% | 0% | 14%
src0% | 34% | 0% | 18% | 47%
src/Runner0% | 0% | 66% | 20% | 13%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
170 29 1
87 12 2
65 9 0
56 6 0
49 14 2
48 11 0
38 3 1
37 7 1
35 7 3
35 5 3
31 5 2
27 7 2
26 5 1
15 5 0
15 5 0
15 4 1
15 4 0
15 3 1
14 1 1
13 2 3
13 2 3
11 1 3
11 2 2
11 1 1
11 2 2
11 4 1
10 1 0
9 2 5
8 1 2
8 2 5
7 2 1
7 2 1
7 2 1
7 1 3
6 1 1
6 1 2
5 1 0
5 1 2
5 1 1
4 1 1
4 1 0
4 1 1
4 1 0
4 2 2
3 1 0
3 1 1
3 1 1
3 1 0
3 1 1
3 1 1