facebook / netconsd
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 112 units with 1,739 lines of code in units (61.9% of code).
    • 1 very long units (108 lines of code)
    • 5 long units (328 lines of code)
    • 17 medium size units (553 lines of code)
    • 26 small units (376 lines of code)
    • 63 very small units (374 lines of code)
6% | 18% | 31% | 21% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c6% | 19% | 32% | 21% | 20%
h0% | 0% | 53% | 0% | 46%
cc0% | 0% | 0% | 75% | 25%
py0% | 0% | 0% | 41% | 58%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ncrx13% | 25% | 32% | 13% | 15%
ROOT0% | 10% | 31% | 33% | 25%
util0% | 27% | 30% | 15% | 26%
include0% | 0% | 53% | 0% | 46%
modules0% | 0% | 0% | 68% | 31%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
108 28 2
75 16 2
75 23 2
65 17 3
57 13 5
56 12 3
50 17 4
48 9 2
42 9 2
41 13 3
41 6 1
40 6 2
37 10 2
32 9 2
29 5 2
28 1 2
26 5 2
25 5 2
23 5 3
23 2 4
23 6 1
23 2 1
22 5 2
20 3 2
19 3 3
19 5 1
18 5 2
18 5 3
17 3 2
17 4 1
17 2 1
16 6 4
16 2 2
15 6 3
14 2 2
14 4 1
13 2 1
13 6 1
13 4 1
13 2 3
13 2 2
12 2 1
12 1 0
12 1 1
11 2 1
11 3 1
11 2 2
11 3 2
11 3 1
10 3 2