aws-samples / backup-recovery-with-aws-backup
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 22 units with 638 lines of code in units (16.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (224 lines of code)
    • 5 simple units (182 lines of code)
    • 14 very simple units (232 lines of code)
0% | 0% | 35% | 28% | 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% | 0% | 35% | 28% | 36%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Lambda/BackupOrgPolicyManager/src0% | 0% | 48% | 22% | 28%
Lambda/TagOnRestore/src0% | 0% | 23% | 44% | 32%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __get_tags_by_resource()
in Lambda/TagOnRestore/src/TagOnRestore.py
54 21 4
def lambda_handler()
in Lambda/BackupOrgPolicyManager/src/BackupOrgPolicyManager.py
105 21 2
def check_properties()
in Lambda/BackupOrgPolicyManager/src/BackupOrgPolicyManager.py
65 11 1
def __set_tags_by_resource()
in Lambda/TagOnRestore/src/TagOnRestore.py
29 9 5
def get_policy()
in Lambda/BackupOrgPolicyManager/src/BackupOrgPolicyManager.py
29 9 3
def handle_restore_event_data()
in Lambda/TagOnRestore/src/TagOnRestore.py
38 8 2
def create_and_attach_policies()
in Lambda/BackupOrgPolicyManager/src/BackupOrgPolicyManager.py
50 8 6
def get_resource_tags()
in Lambda/TagOnRestore/src/TagOnRestore.py
36 7 4
def handler()
in Lambda/TagOnRestore/src/lambda_handler.py
16 5 2
def handle_aws_backup_event()
in Lambda/TagOnRestore/src/TagOnRestore.py
19 5 2
def get_resource_id_from_arn()
in Lambda/TagOnRestore/src/TagOnRestore.py
6 4 2
def detach_policy()
in Lambda/BackupOrgPolicyManager/src/BackupOrgPolicyManager.py
17 4 3
def detach_policy_from_target_list()
in Lambda/BackupOrgPolicyManager/src/BackupOrgPolicyManager.py
10 4 3
def setup()
in setup_limit_to_central_vault.py
32 4 5
def parse_arn()
in Lambda/TagOnRestore/src/TagOnRestore.py
16 3 2
def refresh_tags_for_existing_restore_jobs()
in Lambda/TagOnRestore/src/TagOnRestore.py
9 3 2
def __init__()
in Lambda/TagOnRestore/src/TagOnRestore.py
10 2 3
def boto3_client()
in Lambda/BackupOrgPolicyManager/src/BackupOrgPolicyManager.py
21 2 3
def create()
in Lambda/BackupOrgPolicyManager/src/BackupOrgPolicyManager.py
21 2 1
def send()
in Lambda/BackupOrgPolicyManager/src/BackupOrgPolicyManager.py
23 2 6