aws-samples / amazon-comprehend-s3-object-lambda-functions
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 61 units with 687 lines of code in units (51.7% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (51 lines of code)
    • 7 medium size units (217 lines of code)
    • 16 small units (225 lines of code)
    • 37 very small units (194 lines of code)
0% | 7% | 31% | 32% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 7% | 31% | 32% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 11% | 41% | 16% | 30%
src/clients0% | 0% | 11% | 64% | 24%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
51 5 2
48 4 2
def handle_exception()
in src/exception_handlers.py
44 9 4
def _trim_to_max_bytes()
in src/processors.py
27 12 3
def redact()
in src/processors.py
27 8 3
def download_file_from_presigned_url()
in src/clients/s3_client.py
26 9 3
23 7 3
def redact()
in src/handler.py
22 6 7
def __init__()
in src/clients/comprehend_client.py
20 2 6
def __init__()
in src/clients/s3_client.py
17 1 3
def _contains_error()
in src/clients/s3_client.py
17 9 2
def contains_pii_entities()
in src/clients/comprehend_client.py
15 4 3
def detect_pii_documents()
in src/clients/comprehend_client.py
15 4 3
def respond_back_with_data()
in src/clients/s3_client.py
15 2 6
def _handle_unsupported_file_exception()
in src/exception_handlers.py
14 3 4
def _update_doc_with_pii_entities()
in src/clients/comprehend_client.py
14 4 3
def validate()
in src/validators.py
13 3 1
13 8 2
def de_segment()
in src/processors.py
13 2 2
def respond_back_with_error()
in src/clients/s3_client.py
13 2 6