aws-samples / aws-security-reference-architecture-examples
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 159 units with 2,694 lines of code in units (21.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 7 medium complex units (470 lines of code)
    • 38 simple units (909 lines of code)
    • 114 very simple units (1,315 lines of code)
0% | 0% | 17% | 33% | 48%
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% | 17% | 33% | 48%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
aws_sra_examples/solutions/securityhub0% | 0% | 67% | 15% | 16%
aws_sra_examples/solutions/guardduty0% | 0% | 15% | 56% | 27%
aws_sra_examples/utils/aws_control_tower0% | 0% | 14% | 42% | 42%
aws_sra_examples/solutions/macie0% | 0% | 0% | 50% | 50%
aws_sra_examples/solutions/ec20% | 0% | 0% | 52% | 47%
aws_sra_examples/solutions/common0% | 0% | 0% | 21% | 78%
aws_sra_examples/solutions/firewall_manager0% | 0% | 0% | 41% | 58%
aws_sra_examples/solutions/s30% | 0% | 0% | 23% | 76%
aws_sra_examples/solutions/cloudtrail0% | 0% | 0% | 18% | 81%
aws_sra_examples/solutions/iam0% | 0% | 0% | 32% | 67%
aws_sra_examples/solutions/config0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def processing_accounts()
in aws_sra_examples/solutions/securityhub/securityhub_enabler_acct/lambda/src/app.py
138 24 5
def process_security_standards()
in aws_sra_examples/solutions/securityhub/securityhub_enabler_acct/lambda/src/app.py
176 21 4
def lambda_handler()
in aws_sra_examples/solutions/securityhub/securityhub_enabler_acct/lambda/src/app.py
34 14 2
def gd_create_members()
in aws_sra_examples/solutions/guardduty/guardduty_org/lambda/src/app.py
33 13 3
def get_all_organization_accounts()
in aws_sra_examples/utils/aws_control_tower/helper_scripts/list_config_recorder_status.py
21 12 2
def update_member_detectors()
in aws_sra_examples/solutions/guardduty/guardduty_org/lambda/src/app.py
35 12 3
def get_validated_securityhub_regions()
in aws_sra_examples/solutions/securityhub/securityhub_enabler_acct/lambda/src/app.py
33 11 2
def get_available_service_regions()
in aws_sra_examples/utils/aws_control_tower/helper_scripts/list_config_recorder_status.py
29 10 3
def update()
in aws_sra_examples/solutions/common/common_register_delegated_administrator/lambda/src/app.py
24 10 2
def get_enabled_regions()
in aws_sra_examples/solutions/ec2/ec2_default_ebs_encryption/lambda/src/app.py
49 10 2
def get_all_organization_accounts()
in aws_sra_examples/solutions/macie/macie_org/lambda/src/app.py
17 9 1
def delete()
in aws_sra_examples/solutions/macie/macie_org/lambda/src/app.py
43 9 2
def get_all_organization_accounts()
in aws_sra_examples/solutions/guardduty/guardduty_org/lambda/src/app.py
17 9 1
def enable_organization_admin_account()
in aws_sra_examples/solutions/guardduty/guardduty_org/lambda/src/app.py
21 9 2
def associate_admin_account()
in aws_sra_examples/solutions/firewall_manager/firewall_manager_org/lambda/src/app.py
39 9 1
def get_available_service_regions()
in aws_sra_examples/solutions/macie/macie_org/lambda/src/app.py
23 8 3
def configure_guardduty()
in aws_sra_examples/solutions/guardduty/guardduty_org/lambda/src/app.py
39 8 7
def check_for_detectors()
in aws_sra_examples/solutions/guardduty/guardduty_org/lambda/src/app.py
23 8 2
def delete()
in aws_sra_examples/solutions/guardduty/guardduty_org/lambda/src/app.py
43 8 2
def get_config_recorder_status()
in aws_sra_examples/utils/aws_control_tower/helper_scripts/list_config_recorder_status.py
32 7 0