hhvm / packaging
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 80 units with 1,704 lines of code in units (77.6% of code).
    • 3 very long units (403 lines of code)
    • 8 long units (560 lines of code)
    • 9 medium size units (327 lines of code)
    • 16 small units (231 lines of code)
    • 44 very small units (183 lines of code)
23% | 32% | 19% | 13% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py32% | 23% | 17% | 15% | 11%
hack0% | 59% | 29% | 3% | 7%
js0% | 54% | 0% | 31% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
hhvm1/lambdas32% | 23% | 17% | 13% | 11%
hhvm1/state-machine0% | 59% | 29% | 3% | 7%
lambdas/create-s3-index-html0% | 70% | 0% | 22% | 6%
hhvm10% | 0% | 0% | 100% | 0%
lambdas/hhvm-get-build-status0% | 0% | 0% | 61% | 38%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
179 2 1
117 6 1
107 2 1
100 1 0
81 1 1
74 1 1
74 4 1
66 1 0
62 1 1
52 7 3
51 1 0
48 9 1
48 1 1
45 11 2
42 1 4
39 14 2
32 1 1
28 11 2
24 3 3
21 2 3
20 1 1
20 10 3
18 7 1
17 3 5
15 2 1
14 1 1
14 2 1
13 3 1
13 1 1
13 10 2
13 2 1
13 8 2
13 9 1
12 3 1
12 1 0
11 8 1
10 2 1
10 5 2
9 2 2
9 1 3
8 2 1
8 3 1
8 6 1
7 4 2
6 3 1
6 5 1
6 1 2
5 1 2
5 2 1
5 4 2