aws-samples / aws-security-hub-findings-account-data-enrichment
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 46 units with 367 lines of code in units (59.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 8 medium size units (229 lines of code)
    • 2 small units (31 lines of code)
    • 36 very small units (107 lines of code)
0% | 0% | 62% | 8% | 29%
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% | 62% | 8% | 29%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
enrichment_function/schema/aws/securityhub/securityhubfindingsimported0% | 0% | 52% | 8% | 38%
enrichment_function/import_findings0% | 0% | 78% | 7% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in enrichment_function/import_findings/app.py
50 1 2
def get_account_details()
in enrichment_function/import_findings/helper.py
38 9 2
def unmarshall()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
26 12 3
def enrich_finding()
in enrichment_function/import_findings/app.py
24 6 2
def __unmarshall_model()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
24 15 3
def to_dict()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
23 9 1
def to_dict()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/AWSEvent.py
23 9 1
def marshall()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
21 12 2
def __init__()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/AWSEvent.py
20 1 10
def get_client()
in enrichment_function/import_findings/helper.py
11 2 3
def get_resource()
in enrichment_function/import_findings/helper.py
10 2 3
def get_session_for_role()
in enrichment_function/import_findings/helper.py
10 1 2
def __unmarshall_primitive()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
7 3 3
def __unmarshall_date()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
6 2 2
def __unmarshall_datatime()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
6 2 2
def __init__()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
4 1 2
def __eq__()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
4 2 2
def __eq__()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/AWSEvent.py
4 2 2
def findings()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
2 1 1
def findings()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
2 1 2