aws / amazon-sagemaker-examples
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 10,278 units with 134,889 lines of code in units (71.4% of code).
    • 6 very complex units (1,545 lines of code)
    • 58 complex units (5,893 lines of code)
    • 423 medium complex units (24,024 lines of code)
    • 715 simple units (19,852 lines of code)
    • 9,076 very simple units (83,575 lines of code)
1% | 4% | 17% | 14% | 61%
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
py1% | 4% | 17% | 14% | 61%
R0% | 0% | 0% | 0% | 100%
java0% | 0% | 0% | 0% | 100%
c0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sagemaker-training-compiler89% | 0% | 0% | 5% | 4%
training12% | 2% | 15% | 19% | 49%
reinforcement_learning0% | 4% | 19% | 14% | 62%
advanced_functionality0% | 9% | 16% | 15% | 58%
sagemaker-python-sdk0% | 8% | 20% | 15% | 55%
sagemaker-debugger0% | 9% | 11% | 18% | 59%
sagemaker_neo_compilation_jobs0% | 11% | 9% | 13% | 65%
end_to_end0% | 26% | 0% | 16% | 56%
aws_sagemaker_studio0% | 2% | 6% | 20% | 70%
introduction_to_amazon_algorithms0% | 0% | 20% | 29% | 50%
hyperparameter_tuning0% | 0% | 10% | 23% | 66%
sagemaker_model_monitor0% | 0% | 28% | 2% | 69%
sagemaker-experiments0% | 0% | 25% | 0% | 74%
sagemaker_batch_transform0% | 0% | 11% | 22% | 65%
step-functions-data-science-sdk0% | 0% | 39% | 0% | 60%
ground_truth_labeling_jobs0% | 0% | 2% | 19% | 78%
frameworks0% | 0% | 8% | 18% | 72%
contrib0% | 0% | 13% | 24% | 61%
prep_data0% | 0% | 71% | 0% | 28%
aws_marketplace0% | 0% | 5% | 0% | 94%
sagemaker-fundamentals0% | 0% | 0% | 38% | 61%
scientific_details_of_algorithms0% | 0% | 0% | 48% | 51%
sagemaker-clarify0% | 0% | 0% | 30% | 69%
sagemaker_edge_manager0% | 0% | 0% | 53% | 46%
use-cases0% | 0% | 0% | 23% | 76%
sagemaker-script-mode0% | 0% | 0% | 3% | 96%
sagemaker-pipelines0% | 0% | 0% | 0% | 100%
sagemaker_processing0% | 0% | 0% | 0% | 100%
introduction_to_applying_machine_learning0% | 0% | 0% | 0% | 100%
patterns0% | 0% | 0% | 0% | 100%
sagemaker-jumpstart0% | 0% | 0% | 0% | 100%
r_examples0% | 0% | 0% | 0% | 100%
sagemaker-inference-recommender0% | 0% | 0% | 0% | 100%
autopilot0% | 0% | 0% | 0% | 100%
sagemaker-lineage0% | 0% | 0% | 0% | 100%
utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in sagemaker-training-compiler/huggingface/pytorch_multiple_gpu_single_node/scripts/run_mlm.py
272 74 0
def main()
in sagemaker-training-compiler/huggingface/pytorch_multiple_gpu_multiple_node/scripts/run_mlm.py
274 74 0
def main()
in sagemaker-training-compiler/huggingface/pytorch_multiple_gpu_single_node/scripts/run_clm.py
258 70 0
def main()
in sagemaker-training-compiler/huggingface/pytorch_multiple_gpu_multiple_node/scripts/run_clm.py
266 70 0
def main()
in training/distributed_training/pytorch/model_parallel/gpt2/train_gpt_simple.py
219 56 0
def main()
in training/distributed_training/pytorch/model_parallel/bert/bert_example/sagemaker_smp_pretrain.py
256 54 0
def train()
in sagemaker-python-sdk/mxnet_horovod_maskrcnn/source/train_mask_rcnn.py
169 48 8
def train()
in sagemaker-python-sdk/mxnet_horovod_fasterrcnn/source/train_faster_rcnn.py
141 43 8
def prepare_model_and_optimizer()
in training/distributed_training/pytorch/model_parallel/bert/bert_example/sagemaker_smp_pretrain.py
99 42 2
def builder()
in reinforcement_learning/rl_network_compression_ray_custom/src/tensorflow_resnet/compressor/resnet.py
186 40 4
def load_tensors()
in sagemaker-debugger/mnist_tensor_plot/tensor_plot.py
57 34 1
def load_tensors()
in aws_sagemaker_studio/sagemaker_debugger/mnist_tensor_plot/tensor_plot.py
57 34 1
def _transform()
in sagemaker-debugger/model_specific_realtime_analysis/bert_attention_head_view/entry_point/data.py
120 33 2
def deploy_model()
in reinforcement_learning/bandits_statlog_vw_customEnv/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
96 32 4
def deploy_model()
in reinforcement_learning/rl_cartpole_coach/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
96 32 4
def deploy_model()
in reinforcement_learning/rl_network_compression_ray_custom/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
96 32 4
def deploy_model()
in reinforcement_learning/rl_hvac_coach_energyplus/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
96 32 4
def deploy_model()
in reinforcement_learning/rl_portfolio_management_coach_customEnv/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
96 32 4
def deploy_model()
in reinforcement_learning/rl_cartpole_ray/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
96 32 4
def deploy_model()
in reinforcement_learning/common/sagemaker_rl/orchestrator/workflow/manager/experiment_manager.py
96 32 4