aws-samples / policy-as-code
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 53 units with 1,126 lines of code in units (42.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (74 lines of code)
    • 5 simple units (124 lines of code)
    • 47 very simple units (928 lines of code)
0% | 0% | 6% | 11% | 82%
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% | 9% | 15% | 75%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cdk/app/awsconfig0% | 0% | 26% | 18% | 55%
cdk/ide/lambda_functions0% | 0% | 0% | 40% | 59%
cdk/ide/lib0% | 0% | 0% | 0% | 100%
cdk/cicd0% | 0% | 0% | 0% | 100%
terraform/cicd0% | 0% | 0% | 0% | 100%
cdk/app0% | 0% | 0% | 0% | 100%
utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in cdk/app/awsconfig/S3_block_public_access.py
74 25 2
def evaluate_compliance()
in cdk/app/awsconfig/S3_block_public_access.py
25 10 4
def clean_up_old_evaluations()
in cdk/app/awsconfig/S3_block_public_access.py
28 8 2
def start_instance()
in cdk/ide/lambda_functions/c9DiskResize/lambda_function.py
37 7 1
def poll_create()
in cdk/ide/lambda_functions/c9bootstrap/lambda_function.py
18 6 2
def poll_create()
in cdk/ide/lambda_functions/c9DiskResize/lambda_function.py
16 6 2
def convert_api_configuration()
in cdk/app/awsconfig/S3_block_public_access.py
13 5 1
def get_assume_role_credentials()
in cdk/app/awsconfig/S3_block_public_access.py
17 5 2
def create()
in cdk/ide/lambda_functions/c9bootstrap/lambda_function.py
16 4 2
def create()
in cdk/ide/lambda_functions/c9DiskResize/lambda_function.py
18 4 2
def __init__()
in cdk/app/s3_deployment.py
43 4 4
def is_internal_error()
in cdk/app/awsconfig/S3_block_public_access.py
3 4 1
def main()
in utils/s3_force_delete.py
20 4 0
def create()
in cdk/ide/lambda_functions/c9InstanceProfile/lambda_function.py
16 3 2
def __init__()
in cdk/cicd/Base.py
61 3 5
def run_process()
in cdk/app/awsconfig/S3_block_public_access.py
18 3 1
def get_configuration_item()
in cdk/app/awsconfig/S3_block_public_access.py
8 3 1
def is_applicable()
in cdk/app/awsconfig/S3_block_public_access.py
11 3 2
def __init__()
in terraform/cicd/Base.py
76 3 5
def get_command_output()
in cdk/ide/lambda_functions/c9bootstrap/lambda_function.py
6 2 2