aws-quickstart / quickstart-phsa-ipac
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 31 units with 1,292 lines of code in units (42.5% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (120 lines of code)
    • 5 medium complex units (595 lines of code)
    • 3 simple units (109 lines of code)
    • 22 very simple units (468 lines of code)
0% | 9% | 46% | 8% | 36%
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% | 9% | 46% | 8% | 36%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
functions/source/loop0% | 30% | 31% | 11% | 25%
functions/source/preprocess0% | 0% | 72% | 0% | 27%
functions/source/job-creation0% | 0% | 44% | 10% | 44%
functions/source/Keep-job-alive0% | 0% | 0% | 29% | 70%
functions/source/sagemaker-phc-2020-11-16-postprocess0% | 0% | 0% | 0% | 100%
functions/source/sagemaker-phc-2020-11-16-preprocess0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def write_json_on_s3()
in functions/source/loop/loop_lambda.py
120 43 4
def lambda_handler()
in functions/source/loop/loop_lambda.py
124 23 2
def plot_timeline()
in functions/source/preprocess/preprocess.py
154 21 2
def generate_iwp_plot()
in functions/source/preprocess/preprocess.py
143 17 4
def lambda_handler()
in functions/source/job-creation/job_creation.py
114 16 2
def gen_data_dict()
in functions/source/job-creation/job_creation.py
60 15 2
def get_table()
in functions/source/job-creation/job_creation.py
43 10 1
def write_csv_aggregate()
in functions/source/loop/loop_lambda.py
44 7 5
def check_creationtimefile()
in functions/source/Keep-job-alive/keepjobalive.py
22 6 0
def lambda_handler()
in functions/source/preprocess/preprocess.py
56 4 2
def removerow_creationtime()
in functions/source/Keep-job-alive/keepjobalive.py
20 4 2
def estimate_text_size()
in functions/source/preprocess/preprocess.py
7 3 1
def lambda_handler()
in functions/source/Keep-job-alive/keepjobalive.py
27 3 2
def lambda_handler()
in functions/source/sagemaker-phc-2020-11-16-postprocess/sagemaker-phc-2020-11-16-postprocess.py
24 3 2
def write_dataframe_to_csv_on_s3()
in functions/source/loop/loop_lambda.py
10 3 3
def create_aggregate()
in functions/source/loop/loop_lambda.py
10 3 1
def relative_time_in_days()
in functions/source/preprocess/preprocess.py
6 2 2
def get_start_end_time()
in functions/source/preprocess/preprocess.py
9 2 1
def preprocess()
in functions/source/preprocess/preprocess.py
27 2 1
def convert()
in functions/source/job-creation/job_creation.py
7 2 1