pytorch / audio
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 899 units with 9,925 lines of code in units (46.6% of code).
    • 2 very long units (271 lines of code)
    • 16 long units (1,103 lines of code)
    • 93 medium size units (2,908 lines of code)
    • 166 small units (2,372 lines of code)
    • 622 very small units (3,271 lines of code)
2% | 11% | 29% | 23% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp7% | 10% | 36% | 25% | 19%
h0% | 38% | 33% | 12% | 15%
py0% | 4% | 23% | 25% | 46%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
torchaudio/csrc5% | 18% | 35% | 21% | 18%
torchaudio/pipelines0% | 15% | 43% | 13% | 27%
torchaudio/functional0% | 8% | 15% | 42% | 33%
torchaudio/models0% | 3% | 25% | 19% | 52%
torchaudio/compliance0% | 0% | 43% | 17% | 39%
torchaudio/prototype0% | 0% | 29% | 27% | 43%
torchaudio0% | 0% | 9% | 37% | 53%
ROOT0% | 0% | 34% | 21% | 43%
tools/setup_helpers0% | 0% | 54% | 31% | 14%
torchaudio/backend0% | 0% | 20% | 22% | 56%
torchaudio/datasets0% | 0% | 8% | 23% | 67%
tools0% | 0% | 31% | 37% | 30%
torchaudio/_internal0% | 0% | 0% | 76% | 23%
tools/release_notes0% | 0% | 0% | 0% | 100%
torchaudio/utils0% | 0% | 0% | 0% | 100%
torchaudio/sox_effects0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
170 33 3
101 34 4
100 6 7
99 1 0
83 23 17
82 24 4
71 4 7
69 4 6
68 12 7
68 7 2
67 13 8
63 18 1
61 5 3
60 19 9
55 2 7
53 9 8
53 2 19
51 1 6
48 8 3
48 17 1
47 1 6
46 3 9
46 5 5
45 18 2
45 1 0
45 1 0
42 10 1
42 6 0
42 1 7
42 11 3
41 10 6
41 4 7
41 1 0
41 17 3
40 1 6
39 1 0
38 9 1
38 3 7
37 1 0
37 8 2
36 9 1
36 3 5
35 6 1
35 4 4
34 15 2
34 11 3
34 1 0
34 5 3
33 7 2
33 2 3