aws-samples / aws-security-hub-workshop
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 10 units with 303 lines of code in units (62.9% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (76 lines of code)
    • 5 medium size units (171 lines of code)
    • 3 small units (50 lines of code)
    • 1 very small units (6 lines of code)
0% | 25% | 56% | 16% | 1%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 27% | 52% | 18% | 2%
js0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda0% | 25% | 56% | 16% | 1%
Alternative Visuals
Longest Units
Top 10 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in lambda/ec2-non-compliant-ami-sechub.py
76 3 2
def lambda_handler()
in lambda/isolate-ec2-security-group.py
46 16 2
def create_security_sg()
in lambda/isolate-ec2-security-group.py
43 4 1
def raise_sechub_event()
in lambda/find-secrets-without-rotation.py
30 1 3
function postMessage()
in lambda/sechub-to-slack.js
26 2 2
def lambda_handler()
in lambda/find-secrets-without-rotation.py
26 1 2
def lambda_handler()
in lambda/enrich-sec-hub-finding.py
18 4 2
def postEnrichmentNote()
in lambda/enrich-sec-hub-finding.py
17 2 3
def enrichEc2Type()
in lambda/enrich-sec-hub-finding.py
15 7 1
def lambda_handler()
in lambda/inspector-run-assessment.py
6 1 2