aws-samples / aws-iam-permissions-guardrails
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 33 units with 698 lines of code in units (57.1% of code).
    • 1 very long units (114 lines of code)
    • 3 long units (207 lines of code)
    • 7 medium size units (193 lines of code)
    • 4 small units (65 lines of code)
    • 18 very small units (119 lines of code)
16% | 29% | 27% | 9% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py16% | 29% | 27% | 9% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
access-analyzer/step-functions-archive-findings/access_analyzer_example82% | 0% | 16% | 0% | 1%
iam_permissions_guardrails/constructs/service_control_policies0% | 43% | 41% | 0% | 15%
guardrails0% | 61% | 24% | 0% | 14%
access-analyzer/iam-role-findings-resolution/iam_access_analyzer_findings_remediation0% | 97% | 0% | 0% | 2%
access-analyzer/iam-role-findings-resolution/functions0% | 0% | 76% | 23% | 0%
ROOT0% | 0% | 50% | 32% | 16%
access-analyzer/step-functions-archive-findings/functions0% | 0% | 0% | 32% | 67%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in access-analyzer/step-functions-archive-findings/access_analyzer_example/access_analyzer_example_stack.py
114 1 4
def generate_markdown_from_files()
in guardrails/generate-roles-markdown.py
70 20 1
def on_update()
in iam_permissions_guardrails/constructs/service_control_policies/attachment_lambda/app.py
70 9 1
def __init__()
in access-analyzer/iam-role-findings-resolution/iam_access_analyzer_findings_remediation/iam_access_analyzer_findings_remediation_stack.py
67 1 4
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 main()
in scp_parse.py
30 10 0
def generate_markdown_from_files()
in guardrails/generate-scp-markdown.py
28 7 1
def lambda_handler()
in access-analyzer/iam-role-findings-resolution/functions/access_analyzer_event_bridge_target.py
24 4 2
def create_lambda_function()
in access-analyzer/step-functions-archive-findings/access_analyzer_example/access_analyzer_example_stack.py
23 3 6
def disable_iam_access()
in access-analyzer/iam-role-findings-resolution/functions/access_analyzer_event_bridge_target.py
22 2 3
def formatSCP()
in scp_parse.py
19 5 3
def handler()
in access-analyzer/step-functions-archive-findings/functions/notification/app.py
16 2 2
def should_raise_alert()
in access-analyzer/step-functions-archive-findings/functions/evaluate-access-analyzer-finding/app.py
16 10 3
def send_notifications()
in access-analyzer/iam-role-findings-resolution/functions/access_analyzer_event_bridge_target.py
14 1 6
def lookup_s3_tags()
in access-analyzer/step-functions-archive-findings/functions/context-enrichment/app.py
10 3 1
def handler()
in access-analyzer/step-functions-archive-findings/functions/context-enrichment/app.py
10 1 2
def on_event()
in iam_permissions_guardrails/constructs/service_control_policies/attachment_lambda/app.py
10 4 2
def appendSCP()
in scp_parse.py
10 2 2
def lookup_tags()
in access-analyzer/step-functions-archive-findings/functions/context-enrichment/app.py
9 3 2