facebook / remodel
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 1,972 units with 16,680 lines of code in units (93.2% of code).
    • 2 very long units (350 lines of code)
    • 17 long units (1,069 lines of code)
    • 124 medium size units (3,410 lines of code)
    • 317 small units (4,509 lines of code)
    • 1,512 very small units (7,342 lines of code)
2% | 6% | 20% | 27% | 44%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts2% | 6% | 20% | 26% | 44%
js0% | 0% | 18% | 43% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src4% | 10% | 18% | 26% | 40%
src/plugins0% | 2% | 22% | 26% | 48%
src/js/object-mona-parser0% | 0% | 14% | 53% | 32%
features/support0% | 0% | 20% | 20% | 59%
src/js/object-mona-parser/algebraic-type0% | 0% | 45% | 35% | 18%
src/js/object-mona-parser/object-spec0% | 0% | 0% | 100% | 0%
src/js/require-plugin0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
209 4 6
141 3 3
84 3 4
83 5 1
76 4 1
73 2 1
72 2 1
70 3 1
67 1 2
60 1 3
59 1 8
56 1 2
56 2 6
53 3 1
53 1 2
52 2 3
52 3 2
52 23 2
51 4 1
45 2 4
45 1 3
44 4 1
43 1 3
43 5 2
43 1 2
43 1 3
42 1 1
41 4 1
41 7 12
41 1 0
41 7 2
40 5 2
38 1 1
38 1 2
37 1 1
37 1 2
37 3 4
36 3 1
35 2 1
34 3 2
33 1 1
33 2 0
33 4 1
32 1 2
32 1 2
32 1 2
31 1 2
30 4 2
30 1 1
30 1 1