facebookresearch / mixup-cifar10
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 115 units with 1,060 lines of code in units (81.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 9 medium size units (258 lines of code)
    • 29 small units (402 lines of code)
    • 77 very small units (400 lines of code)
0% | 0% | 24% | 37% | 37%
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% | 24% | 37% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
models0% | 0% | 15% | 39% | 44%
ROOT0% | 0% | 65% | 29% | 5%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in models/densenet3.py
35 7 7
34 9 3
def __init__()
in models/googlenet.py
32 1 8
30 11 1
def train()
in train.py
29 3 1
def __init__()
in models/densenet_efficient_multi_gpu.py
26 3 5
def test()
in train.py
26 6 1
def __init__()
in models/densenet.py
24 1 6
def backward()
in models/densenet_efficient_multi_gpu.py
22 6 2
def forward()
in models/densenet_efficient_multi_gpu.py
20 1 4
def __init__()
in models/googlenet.py
19 1 1
def forward()
in models/resnet.py
19 12 4
def __init__()
in models/densenet_efficient_multi_gpu.py
18 1 11
def forward()
in models/googlenet.py
17 1 2
def __init__()
in models/densenet_efficient_multi_gpu.py
17 2 6
def __init__()
in models/resnext.py
15 3 5
def backward()
in models/densenet_efficient_multi_gpu.py
15 2 5
def forward()
in models/alldnet.py
14 1 2
def __init__()
in models/resnet.py
14 3 4
14 7 1