hhvm / hsl
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 531 units with 5,441 lines of code in units (79.8% of code).
    • 1 very long units (203 lines of code)
    • 4 long units (267 lines of code)
    • 38 medium size units (1,147 lines of code)
    • 143 small units (2,003 lines of code)
    • 345 very small units (1,821 lines of code)
3% | 4% | 21% | 36% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
php4% | 2% | 21% | 38% | 33%
hack0% | 32% | 19% | 11% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/legacy_fixme46% | 0% | 15% | 19% | 17%
src/tcp0% | 75% | 0% | 7% | 17%
minitest0% | 32% | 19% | 11% | 35%
src/io0% | 0% | 44% | 22% | 32%
src/os0% | 0% | 33% | 15% | 51%
src/regex0% | 0% | 72% | 17% | 10%
src/network0% | 0% | 100% | 0% | 0%
src/math0% | 0% | 30% | 45% | 24%
src/c0% | 0% | 24% | 66% | 9%
src/async0% | 0% | 20% | 41% | 37%
src/random0% | 0% | 45% | 28% | 25%
src/str0% | 0% | 4% | 26% | 69%
src/keyset0% | 0% | 9% | 72% | 17%
src/dict0% | 0% | 0% | 74% | 25%
src/vec0% | 0% | 0% | 80% | 19%
src/file0% | 0% | 0% | 41% | 58%
src0% | 0% | 0% | 66% | 33%
src/unix0% | 0% | 0% | 46% | 53%
src/locale0% | 0% | 0% | 40% | 60%
src/_Private0% | 0% | 0% | 45% | 54%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
203 121 3
75 11 4
70 13 3
68 16 0
54 14 0
49 5 0
48 15 6
45 6 3
40 3 1
39 6 1
39 4 2
39 9 1
38 7 2
37 6 3
36 8 2
35 6 2
33 4 3
32 5 3
31 4 0
30 4 6
30 5 3
30 7 2
29 6 3
28 4 1
28 5 1
27 5 1
27 6 2
26 4 1
26 3 3
26 8 3
25 5 3
25 7 3
24 4 2
24 7 1
24 4 4
24 3 1
23 7 0
23 2 5
23 4 1
21 12 2
21 4 1
21 6 1
21 5 2
20 5 2
20 5 2
20 4 1
20 3 1
20 5 4
20 5 4
19 5 3