pytorch / builder
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 288 units with 2,109 lines of code in units (53.7% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (141 lines of code)
    • 20 medium size units (626 lines of code)
    • 41 small units (587 lines of code)
    • 225 very small units (755 lines of code)
0% | 6% | 29% | 27% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 7% | 35% | 33% | 23%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
analytics0% | 12% | 33% | 38% | 16%
ROOT0% | 0% | 48% | 16% | 34%
s3_management0% | 0% | 24% | 35% | 39%
manywheel/build_scripts0% | 0% | 0% | 64% | 35%
java0% | 0% | 0% | 0% | 100%
packaging/windows0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
83 26 2
58 22 3
47 5 7
41 6 1
40 11 3
39 3 5
39 2 0
38 12 0
34 7 1
33 4 5
33 2 5
31 12 0
30 11 3
30 6 3
28 10 4
26 11 2
25 9 5
24 6 1
23 8 0
23 9 1
21 1 3
21 3 1
20 9 4
19 1 0
19 4 2
18 7 2
18 7 1
18 9 4
17 8 4
17 4 3
17 1 0
16 2 3
16 7 3
16 9 2
16 4 2
15 5 2
15 3 2
15 7 2
15 7 2
14 6 2
14 8 1
14 5 4
14 5 2
14 10 3
13 3 3
13 3 8
13 4 3
13 5 4
13 3 1
13 7 2