pytorch / cppdocs
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 238 units with 2,205 lines of code in units (0.2% of code).
    • 2 very long units (213 lines of code)
    • 5 long units (306 lines of code)
    • 10 medium size units (306 lines of code)
    • 36 small units (503 lines of code)
    • 185 very small units (877 lines of code)
9% | 13% | 13% | 22% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js9% | 13% | 13% | 22% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
_static15% | 18% | 10% | 16% | 39%
_static/js0% | 7% | 19% | 30% | 43%
_static/collapsible-lists/js0% | 0% | 31% | 64% | 4%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
111 29 1
102 20 1
76 28 4
63 16 1
58 41 3
55 15 0
54 15 2
42 1 0
40 5 0
40 8 2
32 6 0
30 9 0
28 6 0
25 9 3
25 5 2
22 5 1
22 6 2
20 12 1
19 4 3
19 5 2
18 6 1
18 6 1
18 4 0
17 1 1
17 5 1
16 11 3
16 4 1
15 5 2
15 5 3
14 5 1
14 1 0
14 5 1
14 4 1
14 3 0
13 2 1
13 3 2
13 3 0
13 3 1
13 9 1
12 3 1
12 2 1
12 2 0
12 8 1
12 5 1
12 5 3
11 3 0
11 3 1
11 2 0
11 6 1
11 2 1