facebookincubator / go-qfext
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 84 units with 1,037 lines of code in units (85.8% of code).
    • 1 very long units (129 lines of code)
    • 1 long units (69 lines of code)
    • 15 medium size units (420 lines of code)
    • 10 small units (153 lines of code)
    • 57 very small units (266 lines of code)
12% | 6% | 40% | 14% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go12% | 6% | 40% | 14% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd100% | 0% | 0% | 0% | 0%
ROOT0% | 7% | 44% | 17% | 30%
example0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
129 16 0
69 18 1
42 9 1
40 10 1
38 10 1
34 3 0
30 7 1
29 8 5
27 5 4
26 5 1
25 8 1
23 6 1
22 4 1
21 4 1
21 5 1
21 7 3
21 4 1
20 4 1
19 5 1
18 4 2
17 3 1
16 2 1
13 2 1
13 3 1
13 3 1
12 3 1
12 3 1
10 2 1
8 2 2
8 2 1
8 3 1
8 2 1
8 2 1
8 2 1
8 2 2
7 1 1
7 2 1
7 2 1
7 2 1
7 2 1
6 1 1
6 2 1
6 2 2
6 2 2
6 1 4
6 2 1
6 1 1
5 1 1
5 1 0
4 1 1