aws-samples / amazon-sagemaker-cv
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 1,295 units with 15,801 lines of code in units (69.4% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (234 lines of code)
    • 28 medium complex units (1,311 lines of code)
    • 115 simple units (3,236 lines of code)
    • 1,149 very simple units (11,020 lines of code)
0% | 1% | 8% | 20% | 69%
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% | 1% | 8% | 21% | 68%
cpp0% | 0% | 7% | 19% | 73%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow/sagemakercv/data0% | 9% | 5% | 38% | 46%
pytorch/sagemakercv/training0% | 15% | 19% | 32% | 33%
pytorch/sagemakercv/utils0% | 2% | 5% | 19% | 72%
pytorch/sagemakercv/detection0% | 0% | 11% | 18% | 69%
pytorch/sagemakercv/core0% | 0% | 18% | 13% | 68%
tensorflow/sagemakercv/core0% | 0% | 7% | 13% | 79%
tensorflow/sagemakercv/detection0% | 0% | 10% | 10% | 78%
pytorch/sagemakercv/data0% | 0% | 8% | 27% | 64%
pytorch/cuda_utils/smcv_utils0% | 0% | 5% | 15% | 78%
pytorch/sagemakercv/layers0% | 0% | 7% | 20% | 71%
pytorch0% | 0% | 51% | 0% | 48%
tensorflow/sagemakercv/training0% | 0% | 4% | 33% | 62%
tensorflow/sagemakercv/utils0% | 0% | 0% | 22% | 77%
pytorch/sagemakercv/inference0% | 0% | 0% | 42% | 57%
tensorflow/sagemakercv/layers0% | 0% | 0% | 0% | 100%
pytorch/cuda_utils0% | 0% | 0% | 0% | 100%
tensorflow0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _rename_basic_resnet_weights()
in pytorch/sagemakercv/utils/c2_model_loading.py
39 36 1
def __call__()
in tensorflow/sagemakercv/data/coco/dataloader.py
113 31 2
def step()
in pytorch/sagemakercv/training/optimizers/fused_novograd.py
82 26 2
def _prepare_batches()
in pytorch/sagemakercv/data/samplers/grouped_batch_sampler.py
26 22 1
def _rename_weights_for_resnet()
in pytorch/sagemakercv/utils/c2_model_loading.py
27 21 2
def to_image_list()
in pytorch/sagemakercv/core/structures/image_list.py
40 20 3
def __call__()
in pytorch/sagemakercv/detection/roi_heads/box_head/loss.py
97 19 3
def forward_for_single_feature_map()
in pytorch/sagemakercv/detection/rpn/inference.py
69 18 5
def __call__()
in pytorch/sagemakercv/core/balanced_positive_negative_sampler.py
117 18 4
def __call__()
in tensorflow/sagemakercv/training/trainers.py
45 17 4
def selective_crop_and_resize()
in tensorflow/sagemakercv/core/spatial_transform_ops.py
107 16 6
def backward()
in pytorch/sagemakercv/layers/nhwc/conv.py
55 15 2
def forward()
in pytorch/sagemakercv/detection/roi_heads/roi_heads.py
23 14 4
def step()
in pytorch/sagemakercv/training/optimizers/mlperf_fp16_optimizer.py
37 14 2
def align_and_update_state_dicts()
in pytorch/sagemakercv/utils/model_serialization.py
32 13 3
def select_over_all_levels()
in pytorch/sagemakercv/detection/rpn/inference.py
23 12 2
def __init__()
in pytorch/sagemakercv/training/optimizers/mlperf_fp16_optimizer.py
45 12 6
def save()
in pytorch/sagemakercv/utils/checkpoint.py
24 12 3
def calc_detection_voc_prec_rec()
in pytorch/sagemakercv/data/datasets/evaluation/voc/voc_eval.py
66 12 3
def call()
in tensorflow/sagemakercv/detection/backbones/resnet.py
29 12 3