hhvm / hhast
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 4,900 units with 46,316 lines of code in units (81.3% of code).
    • 19 very long units (2,702 lines of code)
    • 115 long units (7,751 lines of code)
    • 351 medium size units (11,196 lines of code)
    • 707 small units (9,908 lines of code)
    • 3,708 very small units (14,759 lines of code)
5% | 16% | 24% | 21% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
hack5% | 16% | 24% | 21% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
codegen/syntax4% | 14% | 22% | 23% | 34%
src/Linters12% | 15% | 38% | 19% | 14%
src/__Private/codegen19% | 43% | 23% | 8% | 5%
codegen59% | 0% | 14% | 0% | 26%
src/__Private9% | 23% | 34% | 19% | 12%
src/Migrations5% | 40% | 29% | 15% | 8%
src/__Private/LSPLib23% | 0% | 22% | 21% | 32%
src0% | 38% | 25% | 20% | 15%
src/nodes0% | 11% | 16% | 25% | 46%
src/__Private/Resolution0% | 48% | 23% | 22% | 5%
src/__Private/LSPImpl0% | 11% | 47% | 24% | 15%
src/__Private/Wrap0% | 0% | 75% | 0% | 25%
codegen/tokens0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
273 64 2
216 4 5
202 5 0
181 2 0
180 18 10
136 1 5
135 1 5
134 1 5
134 1 5
127 1 5
117 1 5
116 1 5
114 1 5
108 1 5
108 10 2
108 28 5
107 1 5
105 1 5
101 10 2
99 18 0
97 1 5
97 1 0
97 7 0
97 21 1
97 18 2
96 1 5
93 24 2
92 9 2
91 13 1
90 17 2
88 1 5
88 1 5
88 1 5
88 1 5
86 1 5
85 1 5
84 1 5
84 8 0
83 5 3
81 4 1
80 4 1
78 1 5
78 1 5
78 1 5
77 1 5
76 14 1
75 16 1
75 20 1
73 1 5
73 11 1