awslabs / aws-security-automation
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 40 units with 850 lines of code in units (41.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 17 medium size units (577 lines of code)
    • 16 small units (239 lines of code)
    • 7 very small units (34 lines of code)
0% | 0% | 67% | 28% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 67% | 28% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
force_user_mfa0% | 0% | 80% | 16% | 2%
EC2 Auto Clean Room Forensics/Lambda-Functions0% | 0% | 66% | 29% | 4%
IAM Access Denied Responder/generate-security-messages0% | 0% | 83% | 16% | 0%
CloudTrailRemediation0% | 0% | 25% | 63% | 10%
IAM Access Denied Responder/publish-security-messages0% | 0% | 0% | 82% | 17%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in force_user_mfa/ForceUserMFA.py
50 14 2
def publish_iam_user_history()
in IAM Access Denied Responder/generate-security-messages/index.py
47 12 2
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/createForensicInstance.py
46 2 2
def publish_user_history()
in IAM Access Denied Responder/generate-security-messages/index.py
46 12 2
def enable_mfa()
in force_user_mfa/ForceUserMFA.py
45 8 3
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/snapshotForRemediation.py
41 1 2
def mfa_store_policy()
in force_user_mfa/ForceUserMFA.py
41 2 3
def log_event()
in force_user_mfa/ForceUserMFA.py
39 2 1
def access_denied_handler()
in IAM Access Denied Responder/generate-security-messages/index.py
31 10 2
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/attachVolume.py
30 2 2
def verifyLogTable()
in CloudTrailRemediation/CloudTrailRemediation.py
26 4 0
def create_virtual_mfa()
in force_user_mfa/ForceUserMFA.py
24 4 2
def deleteUser()
in force_user_mfa/ForceUserMFA.py
24 1 2
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/sendForensicReport.py
22 3 2
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/SendErrorNotification.py
22 3 2
def store_mfa()
in force_user_mfa/ForceUserMFA.py
22 2 4
def formatMyMessage()
in EC2 Auto Clean Room Forensics/Lambda-Functions/sendIsolationNotification.py
21 1 2
def lambda_handler()
in CloudTrailRemediation/CloudTrailRemediation.py
20 2 2
def publish_to_slack_handler()
in IAM Access Denied Responder/publish-security-messages/index.py
19 4 2
def formatMyMessage()
in EC2 Auto Clean Room Forensics/Lambda-Functions/sendForensicReport.py
18 1 4