facebookincubator / later
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 190 units with 1,948 lines of code in units (76.9% of code).
    • 1 very long units (102 lines of code)
    • 3 long units (185 lines of code)
    • 18 medium size units (526 lines of code)
    • 32 small units (473 lines of code)
    • 136 very small units (662 lines of code)
5% | 9% | 27% | 24% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py5% | 9% | 27% | 24% | 33%
pyi0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
later/unittest/backport5% | 10% | 28% | 23% | 32%
later/unittest0% | 0% | 24% | 37% | 38%
later0% | 0% | 0% | 22% | 77%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
102 24 1
74 20 6
59 15 2
52 12 2
44 19 2
42 3 3
35 5 13
32 14 3
31 12 2
31 16 3
30 6 1
30 13 3
29 11 2
28 8 3
28 9 2
25 13 2
25 5 7
24 10 5
24 4 10
24 7 4
23 7 5
21 7 1
20 11 4
20 7 1
19 3 3
19 8 1
18 6 2
18 8 3
18 6 1
18 10 2
18 7 1
17 8 3
17 4 1
16 4 3
15 3 1
15 3 1
15 4 3
14 5 2
14 6 1
14 6 3
14 7 1
13 10 1
13 9 2
13 4 3
12 5 2
12 2 2
12 2 2
12 4 3
12 3 2
11 2 4