facebookresearch / fair_self_supervision_benchmark
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 263 units with 5,329 lines of code in units (64.3% of code).
    • 0 very complex units (0 lines of code)
    • 5 complex units (1,385 lines of code)
    • 16 medium complex units (957 lines of code)
    • 32 simple units (1,035 lines of code)
    • 210 very simple units (1,952 lines of code)
0% | 25% | 17% | 19% | 36%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 25% | 17% | 19% | 36%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
self_supervision_benchmark/modeling0% | 58% | 16% | 15% | 9%
extra_scripts0% | 0% | 22% | 20% | 57%
tools0% | 0% | 71% | 0% | 28%
self_supervision_benchmark/data0% | 0% | 16% | 24% | 59%
self_supervision_benchmark/utils0% | 0% | 14% | 18% | 66%
tools/svm0% | 0% | 0% | 62% | 37%
self_supervision_benchmark/core0% | 0% | 0% | 58% | 41%
self_supervision_benchmark/metrics0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def create_model()
in self_supervision_benchmark/modeling/jigsaw/alexnet_jigsaw_finetune_linear.py
316 38 4
def create_model()
in self_supervision_benchmark/modeling/colorization/alexnet_colorize_finetune_linear.py
257 32 4
def create_model()
in self_supervision_benchmark/modeling/colorization/resnet_colorize_finetune_linear.py
269 31 4
def create_model()
in self_supervision_benchmark/modeling/jigsaw/resnet_jigsaw_finetune_linear.py
278 30 4
def create_model()
in self_supervision_benchmark/modeling/supervised/resnet_supervised_finetune_linear.py
265 30 4
def _rename_basic_resnet_weights()
in extra_scripts/pickle_caffe2_to_pytorch.py
25 24 1
def _rename_basic_resnet_weights()
in extra_scripts/pickle_pytorch_to_caffe2.py
24 23 1
def create_model()
in self_supervision_benchmark/modeling/supervised/caffenet_bvlc_supervised_finetune_linear.py
211 22 4
def get_images_labels_info()
in extra_scripts/create_voc_data_files.py
45 16 2
def create_model()
in self_supervision_benchmark/modeling/colorization/alexnet_colorize_finetune_full.py
126 16 4
def train_net()
in tools/train_net.py
101 15 1
def _rename_weights_for_resnet()
in extra_scripts/pickle_caffe2_to_pytorch.py
26 15 2
def preprocess_image()
in self_supervision_benchmark/data/data_input.py
31 15 2
def extract_features()
in tools/extract_features.py
67 13 1
def create_threads()
in self_supervision_benchmark/data/dataloader.py
38 13 1
def main()
in extra_scripts/generate_jigsaw_permutations.py
59 12 0
def load_model_from_params_file()
in self_supervision_benchmark/utils/checkpoints.py
26 12 3
def add_parameter_update_ops()
in self_supervision_benchmark/modeling/model_builder.py
60 12 1
def random_crop()
in self_supervision_benchmark/data/data_transformation.py
32 12 4
def get_imgs_labels_info()
in extra_scripts/create_coco_data_files.py
40 11 3