facebookresearch / FashionPlus
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 293 units with 3,460 lines of code in units (84.0% of code).
    • 0 very long units (0 lines of code)
    • 8 long units (450 lines of code)
    • 42 medium size units (1,195 lines of code)
    • 64 small units (949 lines of code)
    • 179 very small units (866 lines of code)
0% | 13% | 34% | 27% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 13% | 34% | 27% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
generation/models0% | 11% | 33% | 31% | 23%
generation0% | 70% | 29% | 0% | 0%
generation/data0% | 20% | 10% | 27% | 41%
classification/data_dict0% | 11% | 40% | 25% | 22%
separate_vae/models0% | 10% | 37% | 35% | 16%
generation/options0% | 39% | 46% | 10% | 2%
separate_vae/options0% | 52% | 30% | 14% | 3%
separate_vae0% | 0% | 100% | 0% | 0%
separate_vae/util0% | 0% | 30% | 39% | 30%
generation/util0% | 0% | 44% | 23% | 32%
classification0% | 0% | 56% | 0% | 43%
separate_vae/data0% | 0% | 15% | 25% | 58%
postprocess0% | 0% | 0% | 63% | 36%
preprocess0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def initialize()
in generation/models/pix2pixHD_model.py
77 31 2
def generation_from_decoded_mask()
in generation/decode_clothing_features.py
60 10 15
def __getitem__()
in generation/data/pickle_dataset.py
54 12 2
def compute_updated_feature()
in classification/data_dict/shape_and_feature/update_demo.py
53 2 1
def forward()
in separate_vae/models/separate_clothing_encoder_models.py
52 9 6
def forward()
in generation/models/pix2pixHD_model.py
52 16 6
def initialize()
in separate_vae/options/base_options.py
51 1 1
def initialize()
in generation/options/base_options.py
51 6 1
def __init__()
in generation/models/networks.py
50 7 6
def display_current_results()
in separate_vae/util/visualizer.py
47 13 4
def batch_generation_from_update()
in separate_vae/decode_masks.py
44 11 7
def option_parser()
in classification/data_dict/shape_and_feature/classifier_options.py
39 1 0
def __init__()
in separate_vae/models/pix2pixhd_networks.py
36 6 12
def forward_and_reparameterize()
in generation/models/networks.py
36 20 4
def load_network()
in generation/models/base_model.py
35 13 5
def initialize()
in separate_vae/models/separate_clothing_encoder_models.py
34 13 2
def load_network()
in classification/model.py
33 8 4
def __init__()
in generation/models/networks.py
33 6 7
def load_network()
in separate_vae/models/separate_clothing_encoder_models.py
32 12 5
def initialize()
in generation/options/train_options.py
32 5 1