aws-solutions / aws-security-hub-automated-response-and-remediation
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 206 units with 3,528 lines of code in units (29.1% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (112 lines of code)
    • 9 medium complex units (460 lines of code)
    • 14 simple units (471 lines of code)
    • 182 very simple units (2,485 lines of code)
0% | 3% | 13% | 13% | 70%
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% | 4% | 17% | 15% | 63%
ts0% | 0% | 0% | 5% | 94%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/Orchestrator0% | 19% | 23% | 26% | 30%
source/LambdaLayers0% | 0% | 13% | 4% | 82%
source/remediation_runbooks/scripts0% | 0% | 4% | 17% | 77%
source/playbooks/NEWPLAYBOOK0% | 0% | 88% | 0% | 11%
source/playbooks/PCI3210% | 0% | 80% | 0% | 20%
source/playbooks/CIS1200% | 0% | 80% | 0% | 20%
source/playbooks/AFSBP0% | 0% | 82% | 0% | 17%
source/lib0% | 0% | 0% | 21% | 78%
source/solution_deploy/source0% | 0% | 0% | 31% | 68%
source/solution_deploy/lib0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in source/Orchestrator/check_ssm_execution.py
112 32 2
def update()
in source/LambdaLayers/utils.py
43 22 2
def lambda_handler()
in source/Orchestrator/send_notifications.py
68 17 2
def enable_flow_logs()
in source/remediation_runbooks/scripts/EnableVPCFlowLogs.py
59 17 2
def lambda_handler()
in source/Orchestrator/exec_ssm_doc.py
62 16 2
def parse_event()
in source/playbooks/NEWPLAYBOOK/ssmdocs/scripts/newplaybook_parse_input.py
52 14 2
def flush()
in source/LambdaLayers/applogger.py
32 12 1
def parse_event()
in source/playbooks/PCI321/ssmdocs/scripts/pci_parse_input.py
48 11 2
def parse_event()
in source/playbooks/CIS120/ssmdocs/scripts/cis_parse_input.py
48 11 2
def parse_event()
in source/playbooks/AFSBP/ssmdocs/scripts/afsbp_parse_input.py
48 11 2
constructor()
in source/lib/ssmplaybook.ts
49 10 3
def lambda_handler()
in source/Orchestrator/get_approval_requirement.py
43 9 2
def format_details_for_output()
in source/Orchestrator/send_notifications.py
17 7 1
def _get_alternate_workflow()
in source/Orchestrator/get_approval_requirement.py
18 7 1
def add_ssl_bucket_policy()
in source/remediation_runbooks/scripts/SetSSLBucketPolicy.py
34 7 2
def list_public_snapshots()
in source/remediation_runbooks/scripts/GetPublicEBSSnapshots.py
28 7 1
def _add_doc_state_to_answer()
in source/Orchestrator/check_ssm_doc_state.py
47 6 4
def _doc_is_active()
in source/Orchestrator/get_approval_requirement.py
23 6 2
def lambda_handler()
in source/solution_deploy/source/createCustomAction.py
39 6 2
def __init__()
in source/LambdaLayers/metrics.py
24 6 2