pytorch / ci-hud
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 230 units with 3,847 lines of code in units (61.2% of code).
    • 3 very long units (391 lines of code)
    • 13 long units (967 lines of code)
    • 37 medium size units (1,136 lines of code)
    • 48 small units (716 lines of code)
    • 129 very small units (637 lines of code)
10% | 25% | 29% | 18% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js10% | 26% | 28% | 18% | 16%
py0% | 0% | 41% | 31% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src13% | 17% | 32% | 18% | 17%
src/pr0% | 63% | 16% | 11% | 8%
scripts0% | 0% | 41% | 31% | 26%
src/components0% | 0% | 45% | 54% | 0%
src/groups0% | 0% | 0% | 100% | 0%
src/utils0% | 0% | 0% | 0% | 100%
src/status0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
137 21 1
135 31 0
119 9 0
97 8 0
95 12 0
93 23 0
86 14 0
84 10 2
81 2 0
79 6 1
77 6 1
67 3 0
53 5 0
52 1 2
52 6 0
51 9 0
47 5 1
45 5 1
44 13 1
44 14 1
44 3 0
43 4 0
42 4 1
40 6 0
39 16 1
39 15 1
36 7 0
34 2 0
32 2 0
32 6 1
32 12 2
30 1 3
30 5 0
30 6 0
28 8 1
27 7 1
27 4 2
25 10 2
25 4 0
24 7 2
24 5 2
24 6 0
24 4 3
24 1 0
24 3 0
24 4 2
23 5 2
22 5 2
22 1 0
22 2 1