aws-solutions / aws-security-hub-automated-response-and-remediation
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 206 units with 3,528 lines of code in units (29.1% of code).
    • 2 very long units (700 lines of code)
    • 8 long units (478 lines of code)
    • 39 medium size units (1,227 lines of code)
    • 42 small units (657 lines of code)
    • 115 very small units (466 lines of code)
19% | 13% | 34% | 18% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts70% | 15% | 11% | 1% | 0%
py4% | 12% | 41% | 23% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/solution_deploy/lib97% | 0% | 0% | 2% | 0%
source/Orchestrator19% | 23% | 34% | 11% | 11%
source/remediation_runbooks/scripts0% | 13% | 48% | 24% | 12%
source/lib0% | 57% | 42% | 0% | 0%
source/playbooks/NEWPLAYBOOK0% | 88% | 0% | 0% | 11%
source/LambdaLayers0% | 0% | 29% | 36% | 34%
source/playbooks/PCI3210% | 0% | 80% | 0% | 20%
source/playbooks/CIS1200% | 0% | 80% | 0% | 20%
source/playbooks/AFSBP0% | 0% | 82% | 0% | 17%
source/solution_deploy/source0% | 0% | 31% | 59% | 9%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/solution_deploy/lib/solution_deploy-stack.ts
588 4 3
def lambda_handler()
in source/Orchestrator/check_ssm_execution.py
112 32 2
def lambda_handler()
in source/Orchestrator/send_notifications.py
68 17 2
constructor()
in source/lib/ssmplaybook.ts
67 4 3
constructor()
in source/lib/ssmplaybook.ts
63 4 3
def lambda_handler()
in source/Orchestrator/exec_ssm_doc.py
62 16 2
def enable_flow_logs()
in source/remediation_runbooks/scripts/EnableVPCFlowLogs.py
59 17 2
def create_bucket_policy()
in source/remediation_runbooks/scripts/CreateCloudTrailMultiRegionTrail_createcloudtrailbucketpolicy.py
55 2 2
def parse_event()
in source/playbooks/NEWPLAYBOOK/ssmdocs/scripts/newplaybook_parse_input.py
52 14 2
def create_bucket_policy()
in source/remediation_runbooks/scripts/EnableAWSConfig_createconfigbucket.py
52 2 2
constructor()
in source/lib/ssmplaybook.ts
49 10 3
def parse_event()
in source/playbooks/PCI321/ssmdocs/scripts/pci_parse_input.py
48 11 2
def parse_event()
in source/playbooks/CIS120/ssmdocs/scripts/cis_parse_input.py
48 11 2
def parse_event()
in source/playbooks/AFSBP/ssmdocs/scripts/afsbp_parse_input.py
48 11 2
def create_logging_bucket()
in source/remediation_runbooks/scripts/CreateAccessLoggingBucket_createloggingbucket.py
48 6 2
def _add_doc_state_to_answer()
in source/Orchestrator/check_ssm_doc_state.py
47 6 4
def lambda_handler()
in source/Orchestrator/check_ssm_doc_state.py
45 4 2
def lambda_handler()
in source/Orchestrator/get_approval_requirement.py
43 9 2
def update()
in source/LambdaLayers/utils.py
43 22 2
def create_encrypted_topic()
in source/remediation_runbooks/scripts/EnableAWSConfig_createtopic.py
40 6 2