facebookincubator / automerge
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 322 units with 4,792 lines of code in units (89.8% of code).
    • 3 very long units (400 lines of code)
    • 10 long units (627 lines of code)
    • 57 medium size units (1,748 lines of code)
    • 67 small units (968 lines of code)
    • 185 very small units (1,049 lines of code)
8% | 13% | 36% | 20% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js8% | 13% | 36% | 20% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
backend12% | 15% | 38% | 18% | 15%
ROOT0% | 100% | 0% | 0% | 0%
frontend0% | 4% | 36% | 27% | 31%
src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
163 116 7
136 77 4
101 59 8
76 20 2
67 3 1
64 46 5
64 22 2
62 46 2
62 11 2
60 13 2
59 9 1
57 25 3
56 26 2
49 13 3
48 20 3
47 17 3
44 17 2
40 17 2
38 11 3
38 18 2
37 21 4
37 8 3
37 16 2
37 12 1
36 8 3
36 14 1
36 11 6
36 14 0
36 14 4
35 8 3
35 16 2
35 35 2
34 10 1
34 20 4
34 17 2
34 13 2
33 18 3
32 9 3
32 24 2
30 12 2
30 12 3
30 7 3
30 9 1
29 10 3
29 12 1
29 15 1
28 10 2
28 17 2
28 13 2
27 14 2