aws-samples / aws-security-workshops
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 11 units with 123 lines of code in units (43.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (26 lines of code)
    • 3 small units (47 lines of code)
    • 7 very small units (50 lines of code)
0% | 0% | 21% | 38% | 40%
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% | 21% | 38% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
detection-ml-wksp/aws_lambda0% | 0% | 21% | 38% | 40%
Alternative Visuals
Longest Units
Top 11 longest units
Unit# linesMcCabe index# params
def handler()
in detection-ml-wksp/aws_lambda/cloudtrail_ingest.py
26 11 2
def handler()
in detection-ml-wksp/aws_lambda/guardduty_ingest.py
19 8 2
def load_workshop_findings()
in detection-ml-wksp/aws_lambda/guardduty_ingest.py
15 4 3
def _extract_source_ips()
in detection-ml-wksp/aws_lambda/guardduty_ingest.py
13 6 2
def load_cloudtrail_log()
in detection-ml-wksp/aws_lambda/cloudtrail_ingest.py
9 1 3
def get_workshop_log_files()
in detection-ml-wksp/aws_lambda/cloudtrail_ingest.py
9 4 3
def get_tuples()
in detection-ml-wksp/aws_lambda/guardduty_ingest.py
9 4 1
def print_short_finding()
in detection-ml-wksp/aws_lambda/guardduty_ingest.py
9 2 1
def print_short_record()
in detection-ml-wksp/aws_lambda/cloudtrail_ingest.py
8 1 1
def get_tuple()
in detection-ml-wksp/aws_lambda/cloudtrail_ingest.py
4 1 1
def print_full_finding()
in detection-ml-wksp/aws_lambda/guardduty_ingest.py
2 1 1