aws-samples / aws-ct-vpc-flowlogs
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 24 units with 510 lines of code in units (40.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (86 lines of code)
    • 3 simple units (71 lines of code)
    • 18 very simple units (353 lines of code)
0% | 0% | 16% | 13% | 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% | 16% | 13% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
code0% | 0% | 16% | 13% | 69%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def toggle_flowlog()
in code/ct_flowlog_activator.py
43 13 7
def lambda_handler()
in code/ct_flowlog_activator.py
18 12 2
def lambda_handler()
in code/ct_flowlog_lifecycle.py
25 12 2
def parse_flowlog_tag()
in code/ct_flowlog_activator.py
27 9 2
def child_handler()
in code/ct_flowlog_activator.py
21 6 2
def get_accounts_by_ou()
in code/ct_flowlog_lifecycle.py
23 6 2
def delete_flowlog()
in code/ct_flowlog_activator.py
29 5 4
def eventbridge_handler()
in code/ct_flowlog_activator.py
15 5 2
def cfn_handler()
in code/ct_flowlog_activator.py
15 5 2
def primary_handler()
in code/ct_flowlog_activator.py
18 5 1
def get_flow_log_status()
in code/ct_flowlog_activator.py
23 4 4
def parse_ec2_tag()
in code/ct_flowlog_activator.py
12 4 1
def create_flowlog()
in code/ct_flowlog_activator.py
19 4 7
def get_vpc_by_region()
in code/ct_flowlog_activator.py
29 4 3
def get_subnet_by_region()
in code/ct_flowlog_activator.py
27 4 3
def list_stack_instance_by_region()
in code/ct_flowlog_activator.py
19 4 3
def sendCfnResponse()
in code/ct_flowlog_activator.py
26 4 7
def list_stack_instance_by_account()
in code/ct_flowlog_lifecycle.py
20 4 3
def list_stack_instance_region()
in code/ct_flowlog_lifecycle.py
20 4 2
def flow_log_handler()
in code/ct_flowlog_activator.py
18 3 8