aws-samples / aws-shield-advanced-rapid-deployment
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 41 units with 1,236 lines of code in units (23.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 10 medium complex units (649 lines of code)
    • 3 simple units (145 lines of code)
    • 28 very simple units (442 lines of code)
0% | 0% | 52% | 11% | 35%
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% | 52% | 11% | 35%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
fms0% | 0% | 74% | 0% | 25%
shield0% | 0% | 87% | 0% | 12%
utility0% | 0% | 29% | 27% | 43%
route530% | 0% | 30% | 16% | 53%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in code/shield/enableConfigure/lambda/index.py
145 23 2
def tag_check()
in code/fms/fms-mimic-shield-protect-global-accelerator/lambda/tag_check.py
25 22 2
def tag_check()
in code/fms/fms-mimic-shield-protect-route53-hosted-zones/lambda/tag_check.py
25 22 2
def tag_check()
in code/route53/cloudfront-config-proactive-engagement/lambda/check-compliance/tag_check.py
25 22 2
def lambda_handler()
in code/fms/fms-policy-waf-generator/lambda/index.py
118 18 2
def lambda_handler()
in code/fms/fms-mimic-shield-protect-global-accelerator/lambda/index.py
72 18 2
def lambda_handler()
in code/fms/fms-mimic-shield-protect-route53-hosted-zones/lambda/index.py
68 18 2
def simulate_user()
in code/utility/get_fms_waf_policy.py
54 18 17
def simulate_user()
in code/utility/generate_waf_logs.py
50 16 17
def lambda_handler()
in code/route53/route53-associate-shield-protection/lambda/index.py
67 15 2
def generate_rule_match_data()
in code/utility/generate_waf_logs.py
29 10 4
def source_ip_calculate()
in code/utility/generate_waf_logs.py
68 10 3
def lambda_handler()
in code/route53/cloudfront-config-proactive-engagement/lambda/remediate/index.py
48 9 2
def source_ip_calculate()
in code/utility/get_fms_waf_policy.py
22 5 3
def cfn_stack_manage()
in code/route53/cloudfront-config-proactive-engagement/lambda/remediate/cfn_stack_manage.py
64 5 4
def lambda_handler()
in code/route53/cloudfront-config-proactive-engagement/lambda/check-compliance/index.py
39 5 2
def scrub()
in code/utility/get_fms_waf_policy.py
8 4 1
def fake_request()
in code/utility/get_fms_waf_policy.py
20 4 7
def scrub()
in code/utility/generate_waf_logs.py
8 4 1
def user_agent_header()
in code/utility/generate_waf_logs.py
13 4 2