awslabs / ec2-spot-labs
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 80 units with 1,282 lines of code in units (10.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (129 lines of code)
    • 9 simple units (198 lines of code)
    • 68 very simple units (955 lines of code)
0% | 0% | 10% | 15% | 74%
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% | 10% | 15% | 74%
java0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ec2-spot-sagemaker-managed-spot-training0% | 0% | 21% | 18% | 59%
ec2-spot-interruption-handler0% | 0% | 0% | 54% | 45%
ec2-spot-tensorflow-checkpoint0% | 0% | 0% | 21% | 78%
paginated-api-call-examples0% | 0% | 0% | 32% | 67%
ec2-spot-deep-learning-training0% | 0% | 0% | 0% | 100%
ec2-spot-asg-handling-interruptions0% | 0% | 0% | 0% | 100%
ec2-spot-interruption-logging-insights0% | 0% | 0% | 0% | 100%
tensorflow-serving-load-testing-sample0% | 0% | 0% | 0% | 100%
ec2-spot-price-monitoring-with-lambda0% | 0% | 0% | 0% | 100%
ec2-spot-history-notebook0% | 0% | 0% | 0% | 100%
ec2-spot-duration0% | 0% | 0% | 0% | 100%
aws-compute-optimizer0% | 0% | 0% | 0% | 100%
builder-sessions0% | 0% | 0% | 0% | 100%
ec2-spot-analyze-costs0% | 0% | 0% | 0% | 100%
ecs-spot-agent0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def greengrass_infinite_infer_run()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-built-in-object-detection/tools/birdsOnEdge.py
56 19 0
def list_image()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-built-in-object-detection/tools/im2rec.py
24 11 3
def image_encode()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-built-in-object-detection/tools/im2rec.py
49 11 4
def get_interruption_handling_properties()
in ec2-spot-interruption-handler/spot-interruption-handler/index.py
22 10 1
def model_fn()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-custom-tensorflow/container/cifar10/cifar10.py
42 10 3
def make_list()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-built-in-object-detection/tools/im2rec.py
24 7 1
def read_list()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-built-in-object-detection/tools/im2rec.py
20 7 1
def handler()
in ec2-spot-interruption-handler/spot-interruption-handler/index.py
30 6 2
def describe_spot_instance_requests()
in paginated-api-call-examples/boto3/example.py
8 6 1
def get_spot_instance_requsts_from_fleet()
in paginated-api-call-examples/boto3/example.py
8 6 1
def downloadfile()
in ec2-spot-tensorflow-checkpoint/tensorflow_checkpoint.py
16 6 2
def write_worker()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-built-in-object-detection/tools/im2rec.py
28 6 3
def handler()
in ec2-spot-price-monitoring-with-lambda/ec2-spot-price-monitoring.py
35 5 2
def load_data()
in ec2-spot-deep-learning-training/download_cifar10.py
25 5 1
def get_last_spot_price_exceeding_the_bid()
in ec2-spot-duration/get_spot_duration.py
20 5 6
def runParallelRequests()
in tensorflow-serving-load-testing-sample/python/submit_mc_tf_k8s_requests.py
25 5 3
def run()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-built-in-object-detection/tools/birdsOnEdge.py
10 5 1
def cifar10_resnet_v2_generator()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-custom-tensorflow/container/cifar10/resnet_model.py
37 5 3
def download_and_extract()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-custom-tensorflow/utils/generate_cifar10_tfrecords.py
20 5 2
def main()
in ec2-spot-sagemaker-managed-spot-training/sagemaker-custom-tensorflow/utils/generate_cifar10_tfrecords.py
17 5 1