facebookresearch / gan_of_gan
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 45 units with 614 lines of code in units (57.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (325 lines of code)
    • 13 small units (172 lines of code)
    • 22 very small units (117 lines of code)
0% | 0% | 52% | 28% | 19%
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% | 52% | 28% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 0% | 55% | 27% | 17%
face_align0% | 0% | 0% | 48% | 51%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in models_all.py
49 1 3
def find_latent_from_images()
in one_shot_domain_adaptation.py
43 10 3
def finetune_weights_from_images()
in one_shot_domain_adaptation.py
43 11 4
def regenerate_img()
in one_shot_domain_adaptation.py
34 7 5
def forward()
in models_all.py
32 11 2
def generate_fake_images()
in one_shot_domain_adaptation.py
31 6 3
def initialize_models_all()
in one_shot_domain_adaptation.py
29 2 1
def reinitialize_requires_grad_diff_layers()
in one_shot_domain_adaptation.py
22 20 2
def generate_new_imgs()
in one_shot_domain_adaptation.py
21 4 4
def __init__()
in losses.py
21 8 3
def __init__()
in models_all.py
19 4 3
def forward()
in models_all.py
16 9 3
def __init__()
in models_all.py
15 1 0
def __init__()
in models_all.py
14 1 0
def crop_and_rotate_img()
in one_shot_domain_adaptation.py
13 3 4
def get_landmarks()
in face_align/landmarks_detector_dlib.py
13 5 2
def __init__()
in models_all.py
13 4 5
def upscale2d()
in models_all.py
13 3 3
def __init__()
in models_all.py
12 1 0
def read_image_to_numpy()
in one_shot_domain_adaptation.py
11 5 1