aws-samples / amazon-forecast-samples
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 49 units with 735 lines of code in units (36.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (27 lines of code)
    • 4 simple units (196 lines of code)
    • 44 very simple units (512 lines of code)
0% | 0% | 3% | 26% | 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% | 0% | 3% | 26% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
notebooks/common/util0% | 0% | 16% | 0% | 83%
ml_ops/visualization_blog/lambdas/updateresources0% | 0% | 0% | 91% | 8%
ml_ops/visualization_blog/lambdas/createforecast0% | 0% | 0% | 62% | 37%
workshops/pre_POC_workshop/local_util0% | 0% | 0% | 0% | 100%
ml_ops/visualization_blog/lambdas/createdatasetimportjob0% | 0% | 0% | 0% | 100%
ml_ops/visualization_blog/lambdas/createpredictor0% | 0% | 0% | 0% | 100%
ml_ops/visualization_blog/lambdas/deleteforecast0% | 0% | 0% | 0% | 100%
ml_ops/visualization_blog/lambdas/createdatasetgroup0% | 0% | 0% | 0% | 100%
ml_ops/visualization_blog/lambdas/s3lambda0% | 0% | 0% | 0% | 100%
ml_ops/visualization_blog/lambdas/createdataset0% | 0% | 0% | 0% | 100%
ml_ops/visualization_blog/shared/python0% | 0% | 0% | 0% | 100%
ml_ops/visualization_blog/lambdas/deletedatasetimport0% | 0% | 0% | 0% | 100%
ml_ops/visualization_blog/lambdas/deletepredictor0% | 0% | 0% | 0% | 100%
ml_ops/visualization_blog/lambdas/notify0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def read_explainability_export()
in notebooks/common/util/fcst_utils.py
27 11 2
def get_readings()
in ml_ops/visualization_blog/lambdas/updateresources/update.py
74 9 2
def lambda_handler()
in ml_ops/visualization_blog/lambdas/createforecast/forecast.py
61 8 2
def transform()
in ml_ops/visualization_blog/lambdas/updateresources/update.py
27 8 5
def lambda_handler()
in ml_ops/visualization_blog/lambdas/updateresources/update.py
34 8 2
def wait_till_delete()
in notebooks/common/util/fcst_utils.py
14 5 3
def _get_time_min_max()
in workshops/pre_POC_workshop/local_util/analysis.py
19 4 4
def _get_velocity_per_item()
in workshops/pre_POC_workshop/local_util/analysis.py
15 4 5
def create_bucket()
in notebooks/common/util/fcst_utils.py
17 4 2
def take_action()
in ml_ops/visualization_blog/shared/python/actions.py
6 3 1
def lambda_handler()
in ml_ops/visualization_blog/lambdas/createdataset/dataset.py
22 3 2
def lambda_handler()
in ml_ops/visualization_blog/lambdas/deleteforecast/deleteforecast.py
22 3 2
def lambda_handler()
in ml_ops/visualization_blog/lambdas/createpredictor/predictor.py
30 3 2
def post_metric()
in ml_ops/visualization_blog/lambdas/createforecast/forecast.py
36 3 1
def get_message()
in ml_ops/visualization_blog/lambdas/notify/notify.py
6 3 1
def wait()
in notebooks/common/util/fcst_utils.py
9 3 2
def get_or_create_iam_role()
in notebooks/common/util/fcst_utils.py
38 3 1
def create_text_widget()
in notebooks/common/util/notebook_utils.py
8 3 3
def update()
in notebooks/common/util/notebook_utils.py
11 3 2
def take_action_delete()
in ml_ops/visualization_blog/shared/python/actions.py
4 2 1