hhvm / fbmarkdown
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 374 units with 4,143 lines of code in units (84.9% of code).
    • 4 very long units (464 lines of code)
    • 5 long units (313 lines of code)
    • 40 medium size units (1,324 lines of code)
    • 53 small units (765 lines of code)
    • 272 very small units (1,277 lines of code)
11% | 7% | 31% | 18% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
php11% | 7% | 31% | 18% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/inlines21% | 10% | 33% | 12% | 21%
src/unparsed-blocks7% | 12% | 35% | 15% | 28%
src/render12% | 0% | 18% | 35% | 33%
src/_Private0% | 0% | 83% | 11% | 5%
src/inlines/_Private0% | 0% | 26% | 19% | 53%
src/unparsed-blocks/_Private0% | 0% | 0% | 100% | 0%
src0% | 0% | 0% | 14% | 85%
src/blocks0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
140 34 4
112 16 2
111 21 2
101 25 1
76 19 2
72 12 3
60 13 2
53 11 2
52 14 2
50 11 3
49 11 2
47 9 3
47 8 3
46 4 5
46 12 1
44 13 1
44 12 1
43 7 3
39 8 2
39 7 2
38 8 2
38 12 1
38 9 2
38 7 4
37 10 3
36 7 3
35 10 2
35 9 1
34 10 3
33 8 2
32 9 2
32 5 3
29 5 1
29 9 1
27 4 3
26 5 1
25 7 2
24 6 2
24 3 3
23 2 1
23 7 3
22 3 2
22 4 1
22 6 3
22 8 3
22 8 3
22 6 3
21 4 3
21 1 2
20 3 2