facebook / nailgun
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 330 units with 2,921 lines of code in units (75.4% of code).
    • 1 very long units (188 lines of code)
    • 4 long units (289 lines of code)
    • 27 medium size units (774 lines of code)
    • 43 small units (611 lines of code)
    • 255 very small units (1,059 lines of code)
6% | 9% | 26% | 20% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c38% | 0% | 27% | 22% | 11%
java0% | 11% | 24% | 18% | 45%
py0% | 11% | 33% | 27% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
nailgun-client/c38% | 0% | 27% | 22% | 11%
nailgun-server/src/main/java/com/facebook/nailgun0% | 12% | 23% | 18% | 45%
nailgun-client/py0% | 11% | 33% | 27% | 26%
nailgun-server/src/main/java/com/facebook/nailgun/builtins0% | 0% | 34% | 20% | 45%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
188 44 3
91 16 2
73 15 0
63 12 0
62 11 3
47 7 0
42 12 1
41 6 3
36 17 1
34 8 2
34 7 6
34 8 3
33 7 0
30 6 3
30 8 1
29 5 0
29 5 0
28 5 0
27 5 0
27 1 1
26 8 3
26 5 1
24 10 1
23 1 3
23 5 1
23 6 0
22 4 0
22 4 1
21 6 1
21 5 3
21 4 1
21 3 2
20 3 1
20 5 3
19 6 2
19 4 1
19 4 0
17 2 1
17 6 1
17 1 0
16 6 1
16 6 3
16 3 3
16 5 0
16 3 0
15 5 1
15 4 1
15 4 0
14 4 3
14 3 0