amazon-research / network-deconvolution-pp
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 819 units with 10,919 lines of code in units (63.1% of code).
    • 1 very complex units (218 lines of code)
    • 2 complex units (151 lines of code)
    • 40 medium complex units (2,108 lines of code)
    • 92 simple units (2,448 lines of code)
    • 684 very simple units (5,994 lines of code)
1% | 1% | 19% | 22% | 54%
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
py2% | 1% | 19% | 21% | 55%
cpp0% | 0% | 32% | 50% | 16%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Classification26% | 0% | 24% | 19% | 29%
Segmentation0% | 13% | 0% | 11% | 75%
MaskRCNN/pytorch/maskrcnn_benchmark0% | <1% | 14% | 22% | 61%
Classification/models0% | 0% | 25% | 21% | 52%
MaskRCNN/pytorch/tools0% | 0% | 43% | 47% | 9%
Segmentation/models/segmentation0% | 0% | 24% | 20% | 54%
Segmentation/models0% | 0% | 20% | 21% | 58%
Segmentation/datasets0% | 0% | 25% | 41% | 33%
MaskRCNN/pytorch0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main_worker()
in Classification/main_imagenet.py
218 67 3
def main()
in Segmentation/train.py
112 37 1
def _rename_basic_resnet_weights()
in MaskRCNN/pytorch/maskrcnn_benchmark/utils/c2_model_loading.py
39 36 1
def forward()
in Classification/models/rfnorm.py
102 23 2
def _prepare_batches()
in MaskRCNN/pytorch/maskrcnn_benchmark/data/samplers/grouped_batch_sampler.py
26 22 1
def _rename_weights_for_resnet()
in MaskRCNN/pytorch/maskrcnn_benchmark/utils/c2_model_loading.py
27 21 2
def eval_net()
in Classification/net_util.py
84 21 2
def forward()
in Classification/models/rfnorm.py
108 19 3
def forward()
in MaskRCNN/pytorch/maskrcnn_benchmark/layers/deconv.py
68 18 2
def forward()
in Segmentation/models/segmentation/deconv.py
68 18 2
def forward()
in Classification/models/deconv.py
68 18 2
def forward_for_single_feature_map()
in MaskRCNN/pytorch/maskrcnn_benchmark/modeling/rpn/inference.py
69 17 4
def train()
in Classification/main_imagenet.py
47 17 6
def __init__()
in MaskRCNN/pytorch/maskrcnn_benchmark/modeling/roi_heads/box_head/roi_box_feature_extractors.py
71 16 2
def __init__()
in Classification/models/resnet_imagenet.py
48 16 12
def forward()
in MaskRCNN/pytorch/maskrcnn_benchmark/layers/deconv.py
72 15 3
def __init__()
in Segmentation/datasets/cityscapes.py
51 15 9
def __init__()
in Segmentation/models/resnetd.py
44 15 10
def forward()
in Classification/models/deconv.py
72 15 3
def convert_cityscapes_instance_only()
in MaskRCNN/pytorch/tools/cityscapes/convert_cityscapes_to_coco.py
91 14 2