pytorch / android-demo-app
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 75 units with 851 lines of code in units (12.8% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 9 medium size units (315 lines of code)
    • 20 small units (309 lines of code)
    • 46 very small units (227 lines of code)
0% | 0% | 37% | 36% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 25% | 35% | 38%
java0% | 0% | 65% | 28% | 6%
h0% | 0% | 60% | 24% | 15%
cpp0% | 0% | 0% | 90% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ImageSegmentation0% | 0% | 84% | 15% | 0%
StreamingASR0% | 0% | 44% | 27% | 27%
Seq2SeqNMT0% | 0% | 35% | 28% | 36%
D2Go0% | 0% | 100% | 0% | 0%
HelloWorldApp0% | 0% | 63% | 36% | 0%
NativeApp0% | 0% | 0% | 74% | 25%
ViT4MNIST0% | 0% | 0% | 56% | 43%
ASLRecognition0% | 0% | 0% | 47% | 52%
SpeechRecognition0% | 0% | 0% | 68% | 31%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
48 8 0
45 5 1
38 1 0
37 4 5
34 7 8
30 5 6
30 4 1
29 10 5
24 2 3
20 5 2
20 4 2
19 2 2
18 2 3
17 4 2
17 4 2
17 2 2
16 2 3
16 1 10
15 1 2
15 4 2
14 3 6
14 1 3
14 3 4
13 2 3
13 4 1
13 7 3
13 2 3
13 1 4
12 1 5
10 1 11
10 3 2
10 1 3
10 1 2
9 1 1
8 2 2
8 2 5
7 2 2
7 1 2
7 1 3
7 1 1
6 1 1
6 2 2
6 1 2
6 1 3
6 1 3
6 1 2
5 1 2
5 3 1
5 1 1
5 1 3