facebookincubator / FCR
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 533 units with 4,402 lines of code in units (60.9% of code).
    • 0 very long units (0 lines of code)
    • 7 long units (479 lines of code)
    • 56 medium size units (1,737 lines of code)
    • 49 small units (708 lines of code)
    • 421 very small units (1,478 lines of code)
0% | 10% | 39% | 16% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 10% | 39% | 16% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
if/py/gen-py/fbnet/command_runner_asyncio/CommandRunner0% | 13% | 47% | 15% | 23%
fbnet/command_runner0% | 0% | 9% | 19% | 71%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
83 43 2
83 43 2
77 45 2
66 30 2
60 28 2
55 33 2
55 34 2
50 30 2
50 31 2
50 30 2
50 37 2
46 30 2
41 27 2
41 27 2
40 26 2
40 26 2
40 11 1
39 27 2
38 26 2
38 28 2
37 21 2
34 23 2
34 25 2
34 23 2
34 23 2
33 17 1
32 9 1
32 9 1
31 19 2
31 19 2
31 19 2
31 19 2
29 7 4
28 8 1
28 8 1
28 8 1
28 8 1
28 8 1
26 21 2
26 21 2
26 6 4
26 6 4
26 6 4
26 6 4
26 6 4
26 23 2
26 23 2
25 17 1
25 17 2
25 17 2