aws-samples / aws-ml-jp
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 193 units with 3,040 lines of code in units (63.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 13 medium complex units (714 lines of code)
    • 19 simple units (606 lines of code)
    • 161 very simple units (1,720 lines of code)
0% | 0% | 23% | 19% | 56%
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% | 0% | 23% | 19% | 56%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sagemaker/sagemaker-inference0% | 0% | 36% | 10% | 53%
vision/amazon-sagemaker-pytorch-detectron20% | 0% | 26% | 16% | 56%
sagemaker/workshop0% | 0% | 52% | 0% | 47%
autogluon/tabular-prediction0% | 0% | 18% | 28% | 52%
sagemaker/sagemaker-experiments0% | 0% | 39% | 0% | 60%
sagemaker/hpo-pytorch-mnist0% | 0% | 46% | 0% | 53%
sagemaker/distributed-training0% | 0% | 0% | 70% | 29%
nlp/nlp_amazon_review0% | 0% | 0% | 25% | 75%
ai-services/forecast0% | 0% | 0% | 0% | 100%
inference/edge0% | 0% | 0% | 0% | 100%
mlops/edge-deploy0% | 0% | 0% | 0% | 100%
mlops/sagemaker-pipelines0% | 0% | 0% | 0% | 100%
sagemaker/tensorflow2-training-and-serving0% | 0% | 0% | 0% | 100%
sagemaker/sagemaker-processing0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def evaluate()
in vision/amazon-sagemaker-pytorch-detectron2/container_training/sku-110k/evaluation/coco.py
79 25 1
def train()
in sagemaker/hpo-pytorch-mnist/mnist.py
52 17 1
def train()
in sagemaker/sagemaker-inference/pytorch/code_inf1/train.py
53 17 1
def train()
in sagemaker/sagemaker-inference/pytorch/code_byoc/train.py
52 17 1
def train()
in sagemaker/sagemaker-inference/pytorch/code_async/train.py
52 17 1
def train()
in sagemaker/sagemaker-inference/pytorch/code_lambda/train.py
52 17 1
def train()
in sagemaker/sagemaker-inference/pytorch/code_mme/train.py
52 17 1
def train()
in sagemaker/sagemaker-experiments/pytorch_mnist/src/mnist_train.py
52 17 1
def summarize()
in vision/amazon-sagemaker-pytorch-detectron2/container_training/sku-110k/evaluation/coco.py
67 14 1
def _eval_predictions()
in vision/amazon-sagemaker-pytorch-detectron2/container_training/sku-110k/evaluation/coco.py
51 13 3
def train()
in autogluon/tabular-prediction/AutoGluon-Tabular-with-SageMaker/container-training/train.py
74 13 1
def cnn_model_fn()
in sagemaker/workshop/lab_bring-your-own-model/tensorflow/cnn_mnist_after.py
39 12 3
def cnn_model_fn()
in sagemaker/workshop/lab_bring-your-own-model/tensorflow/cnn_mnist_before.py
39 12 3
def _train_impl()
in vision/amazon-sagemaker-pytorch-detectron2/container_training/sku-110k/training.py
58 10 1
def train()
in sagemaker/distributed-training/train_pytorch_smdataparallel_maskrcnn.py
55 9 2
def enable_sm_oneclick_deploy()
in sagemaker/sagemaker-inference/pytorch/code_inf1/train.py
18 8 1
def enable_sm_oneclick_deploy()
in sagemaker/sagemaker-inference/pytorch/code_byoc/train.py
18 8 1
def enable_sm_oneclick_deploy()
in sagemaker/sagemaker-inference/pytorch/code_async/train.py
18 8 1
def enable_sm_oneclick_deploy()
in sagemaker/sagemaker-inference/pytorch/code_mme/train.py
18 8 1
def __init__()
in nlp/nlp_amazon_review/GluonNLP_BERT/src/bert/data/transform.py
20 7 8