facebook / regenerator
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 129 units with 1,844 lines of code in units (84.8% of code).
    • 2 very long units (471 lines of code)
    • 1 long units (55 lines of code)
    • 16 medium size units (497 lines of code)
    • 26 small units (379 lines of code)
    • 84 very small units (442 lines of code)
25% | 2% | 26% | 20% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js25% | 2% | 26% | 20% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/transform/src36% | 0% | 22% | 20% | 20%
packages/runtime0% | 12% | 36% | 20% | 30%
lib0% | 0% | 59% | 18% | 22%
ROOT0% | 0% | 0% | 41% | 58%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
257 37 2
214 35 2
55 16 3
46 9 2
45 24 2
41 4 0
38 9 1
34 13 1
33 4 1
31 5 1
30 9 2
27 7 1
27 12 2
27 4 1
25 2 1
25 5 0
24 5 4
23 5 1
21 2 2
20 5 3
19 4 1
19 6 1
19 4 3
19 3 2
18 7 2
18 7 4
17 8 1
16 7 2
14 3 2
14 4 1
14 2 3
14 3 1
14 3 1
14 6 1
13 4 2
13 4 1
13 2 2
12 4 5
12 1 1
12 1 2
11 3 1
11 1 2
11 1 1
11 2 1
11 4 1
10 2 1
10 2 2
10 3 1
10 1 2
10 2 1