facebookresearch / video-long-term-feature-banks
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 273 units with 4,091 lines of code in units (54.5% of code).
    • 2 very long units (296 lines of code)
    • 7 long units (518 lines of code)
    • 52 medium size units (1,545 lines of code)
    • 59 small units (890 lines of code)
    • 153 very small units (842 lines of code)
7% | 12% | 37% | 21% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 12% | 37% | 21% | 20%
h0% | 0% | 0% | 0% | 100%
cc0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/models31% | 15% | 20% | 20% | 12%
lib/utils0% | 13% | 41% | 24% | 19%
tools0% | 38% | 29% | 22% | 9%
lib/datasets0% | 4% | 47% | 18% | 28%
lib/core0% | 0% | 38% | 47% | 13%
caffe2_customized_ops/video0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def create_model()
in lib/models/resnet_video.py
191 21 6
def spacetime_nonlocal()
in lib/models/nonlocal_helper.py
105 13 9
def initialize_master_gpu_model_params()
in lib/utils/checkpoints.py
98 20 3
def train()
in tools/train_net.py
79 4 1
def get_flops_params()
in lib/utils/misc.py
77 21 1
def NLCore()
in lib/models/lfb_helper.py
75 9 10
def obtain_arc()
in lib/models/resnet_video.py
70 7 1
def _create_execution_context()
in lib/datasets/data_input_helper.py
63 12 6
def get_lfb()
in tools/lfb_loader.py
56 10 2
def merge_ava_3shift_score_files()
in lib/utils/metrics.py
47 8 3
def images_and_boxes_preprocessing()
in lib/datasets/data_input_helper.py
44 18 5
41 5 4
39 5 5
def random_crop_list()
in lib/datasets/image_processor.py
38 16 5
def load_annotations()
in lib/datasets/epic.py
38 8 1
def load_boxes_and_labels()
in lib/datasets/ava.py
38 17 4
def get_minibatch_info()
in lib/datasets/charades.py
38 10 2
def __init__()
in lib/utils/metrics.py
37 3 5
def run_evaluation()
in lib/utils/ava_eval_helper.py
37 5 5
def add_parameter_update_ops()
in lib/models/model_builder_video.py
37 5 1