facebookincubator / flowtorch
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 170 units with 1,145 lines of code in units (29.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (60 lines of code)
    • 8 medium size units (264 lines of code)
    • 17 small units (261 lines of code)
    • 144 very small units (560 lines of code)
0% | 5% | 23% | 22% | 48%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 6% | 21% | 14% | 58%
js0% | 0% | 35% | 64% | 0%
tsx0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
flowtorch0% | 31% | 14% | 27% | 26%
scripts0% | 0% | 73% | 22% | 4%
website/src/theme0% | 0% | 31% | 68% | 0%
flowtorch/bijectors0% | 0% | 0% | 3% | 96%
flowtorch/ops0% | 0% | 0% | 43% | 56%
flowtorch/bijectors/ops0% | 0% | 0% | 0% | 100%
flowtorch/parameters0% | 0% | 0% | 0% | 100%
flowtorch/distributions0% | 0% | 0% | 0% | 100%
flowtorch/nn0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
60 21 2
49 12 3
39 20 1
37 3 1
36 7 1
30 10 1
27 9 2
25 10 1
21 1 2
20 1 1
20 1 1
20 2 1
20 1 1
20 3 2
19 1 1
16 6 3
14 5 2
14 4 1
14 5 1
13 10 2
13 1 0
13 2 3
12 5 3
11 2 1
11 6 1
11 7 2
10 1 7
9 1 0
9 5 2
9 1 0
9 1 0
9 1 0
9 1 0
9 1 0
8 2 1
8 1 0
8 3 1
8 1 0
8 3 1
7 1 0
7 1 0
7 1 1
7 1 0
7 1 0
7 2 2
7 1 0
6 1 0
6 1 0
6 1 4
6 4 1