hhvm / hh-apidoc
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 101 units with 1,664 lines of code in units (84.2% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (356 lines of code)
    • 21 medium size units (707 lines of code)
    • 19 small units (287 lines of code)
    • 56 very small units (314 lines of code)
0% | 21% | 42% | 17% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
hack0% | 21% | 42% | 17% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 31% | 25% | 15% | 28%
src/DocBlock0% | 45% | 34% | 8% | 11%
src/MarkdownExt0% | 25% | 31% | 17% | 25%
src/PageSections0% | 0% | 62% | 29% | 8%
src/PageSections/_Private0% | 0% | 84% | 6% | 8%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
95 30 1
92 1 0
60 12 2
56 8 0
53 9 2
49 9 0
45 5 1
42 8 2
42 9 0
41 11 3
40 2 1
39 1 0
38 11 2
36 9 1
33 5 0
31 5 0
31 7 2
31 7 0
30 7 3
30 4 2
29 4 4
28 6 1
24 4 2
24 5 1
22 3 2
22 3 0
20 5 2
20 1 3
20 4 1
18 2 2
18 4 0
18 2 3
18 3 1
16 3 2
16 4 2
15 1 0
14 1 1
13 4 1
12 3 0
12 2 0
12 2 2
12 2 3
11 3 1
11 2 3
11 2 2
10 2 1
10 1 2
10 1 0
9 3 0
9 1 0