facebookincubator / go2chef
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 256 units with 2,455 lines of code in units (74.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (146 lines of code)
    • 30 medium size units (859 lines of code)
    • 48 small units (707 lines of code)
    • 176 very small units (743 lines of code)
0% | 5% | 34% | 28% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 5% | 34% | 28% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
plugin/source0% | 23% | 29% | 28% | 19%
scripts0% | 45% | 36% | 12% | 4%
plugin/step0% | 0% | 41% | 30% | 28%
ROOT0% | 0% | 31% | 14% | 54%
cli0% | 0% | 41% | 38% | 19%
plugin/lib0% | 0% | 24% | 48% | 26%
plugin/logger0% | 0% | 34% | 0% | 65%
util/testutil0% | 0% | 100% | 0% | 0%
util0% | 0% | 0% | 85% | 14%
plugin/config0% | 0% | 0% | 46% | 53%
util/temp0% | 0% | 0% | 54% | 45%
util/hashfile0% | 0% | 0% | 100% | 0%
util/plugconf0% | 0% | 0% | 32% | 67%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
90 20 1
56 10 2
47 10 1
43 7 1
42 8 1
41 11 1
39 10 1
38 5 1
37 5 1
35 8 1
33 7 2
32 6 1
32 7 2
29 8 1
26 4 1
25 6 1
24 8 1
24 4 1
24 8 2
23 6 1
23 4 1
23 7 1
23 3 1
23 7 1
23 7 1
23 6 4
22 4 0
21 5 1
21 5 1
21 3 1
21 3 1
21 3 1
20 6 1
20 3 1
20 3 1
19 6 1
19 5 1
19 3 1
19 5 1
19 4 1
17 5 1
17 3 1
17 3 1
17 3 1
17 4 1
16 4 1
16 3 3
16 4 1
16 4 1
16 3 1