amazon-research / video-contrastive-learning
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 126 units with 1,899 lines of code in units (78.9% of code).
    • 0 very long units (0 lines of code)
    • 8 long units (568 lines of code)
    • 18 medium size units (568 lines of code)
    • 32 small units (456 lines of code)
    • 68 very small units (307 lines of code)
0% | 29% | 29% | 24% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 29% | 29% | 24% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 51% | 29% | 16% | 2%
liblinear0% | 40% | 27% | 18% | 13%
dataset0% | 24% | 32% | 16% | 26%
models0% | 19% | 22% | 36% | 21%
tools/data/k4000% | 0% | 86% | 13% | 0%
utils0% | 0% | 26% | 33% | 39%
tools/feature_visualization0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in eval_retrieve_knn_pred.py
97 23 0
def parse_options()
in liblinear/liblinear.py
84 2 2
def predict()
in liblinear/liblinearutil.py
79 8 4
def train_vclr()
in train_vclr.py
73 5 11
def main()
in eval_svm_feature_perf.py
67 9 0
def __getitem__()
in dataset/dataset_kinetics.py
60 12 2
def train()
in liblinear/liblinearutil.py
55 6 3
def __init__()
in models/resnet_mlp.py
53 16 13
def __init__()
in liblinear/liblinear.py
43 7 4
def extract_frames()
in tools/data/k400/extract_frames.py
43 12 2
def gen_feature_nodearray()
in liblinear/liblinear.py
42 11 2
def svm_read_problem()
in liblinear/commonutil.py
42 4 2
def parse_option()
in utils/util.py
40 1 0
def _forward_impl()
in models/resnet_mlp.py
40 9 4
def extract_each_class()
in tools/data/k400/extract_frames_parallel.py
34 9 3
def main()
in eval_svm_feature_extract.py
33 4 1
def main()
in train_vclr.py
29 4 2
def __init__()
in dataset/dataset_kinetics.py
29 7 4
def __getitem__()
in dataset/dataset_downstream.py
27 8 2
def main()
in eval_retrieval_feature_extract.py
26 3 1