aws-samples / aws-iam-permissions-guardrails
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 33 units with 698 lines of code in units (57.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (70 lines of code)
    • 4 simple units (144 lines of code)
    • 28 very simple units (484 lines of code)
0% | 0% | 10% | 20% | 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% | 10% | 20% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
guardrails0% | 0% | 61% | 24% | 14%
iam_permissions_guardrails/constructs/service_control_policies0% | 0% | 0% | 43% | 56%
ROOT0% | 0% | 0% | 50% | 49%
access-analyzer/step-functions-archive-findings/functions0% | 0% | 0% | 16% | 83%
access-analyzer/step-functions-archive-findings/access_analyzer_example0% | 0% | 0% | 0% | 100%
access-analyzer/iam-role-findings-resolution/iam_access_analyzer_findings_remediation0% | 0% | 0% | 0% | 100%
access-analyzer/iam-role-findings-resolution/functions0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def generate_markdown_from_files()
in guardrails/generate-roles-markdown.py
70 20 1
def should_raise_alert()
in access-analyzer/step-functions-archive-findings/functions/evaluate-access-analyzer-finding/app.py
16 10 3
def main()
in scp_parse.py
30 10 0
def on_update()
in iam_permissions_guardrails/constructs/service_control_policies/attachment_lambda/app.py
70 9 1
def generate_markdown_from_files()
in guardrails/generate-scp-markdown.py
28 7 1
def on_create()
in iam_permissions_guardrails/constructs/service_control_policies/attachment_lambda/app.py
33 5 1
def on_delete()
in iam_permissions_guardrails/constructs/service_control_policies/attachment_lambda/app.py
33 5 1
def formatSCP()
in scp_parse.py
19 5 3
def lambda_handler()
in access-analyzer/iam-role-findings-resolution/functions/access_analyzer_event_bridge_target.py
24 4 2
def on_event()
in iam_permissions_guardrails/constructs/service_control_policies/attachment_lambda/app.py
10 4 2
def convert_string_to_list()
in guardrails/generate-roles-markdown.py
6 3 1
def is_allowed_public()
in access-analyzer/step-functions-archive-findings/functions/evaluate-access-analyzer-finding/app.py
4 3 3
def lookup_s3_tags()
in access-analyzer/step-functions-archive-findings/functions/context-enrichment/app.py
10 3 1
def lookup_tags()
in access-analyzer/step-functions-archive-findings/functions/context-enrichment/app.py
9 3 2
def additional_enrichment()
in access-analyzer/step-functions-archive-findings/functions/context-enrichment/app.py
7 3 2
def create_lambda_function()
in access-analyzer/step-functions-archive-findings/access_analyzer_example/access_analyzer_example_stack.py
23 3 6
def handler()
in access-analyzer/step-functions-archive-findings/functions/notification/app.py
16 2 2
def handler()
in access-analyzer/step-functions-archive-findings/functions/evaluate-access-analyzer-finding/app.py
8 2 2
def lookup_kms_tags()
in access-analyzer/step-functions-archive-findings/functions/context-enrichment/app.py
6 2 1
def disable_iam_access()
in access-analyzer/iam-role-findings-resolution/functions/access_analyzer_event_bridge_target.py
22 2 3