aws-samples / amazon-textract-serverless-large-scale-document-processing
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 339 units with 2,876 lines of code in units (89.3% of code).
    • 1 very long units (226 lines of code)
    • 0 long units (0 lines of code)
    • 30 medium size units (836 lines of code)
    • 54 small units (860 lines of code)
    • 254 very small units (954 lines of code)
7% | 0% | 29% | 29% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts100% | 0% | 0% | 0% | 0%
py0% | 0% | 31% | 32% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
textract-pipeline/lib100% | 0% | 0% | 0% | 0%
src0% | 0% | 29% | 33% | 37%
textract-pipeline/lambda/asyncprocessor0% | 0% | 70% | 19% | 9%
textract-pipeline/lambda/helper0% | 0% | 27% | 34% | 38%
textract-pipeline/lambda/textractor0% | 0% | 13% | 29% | 56%
textract-pipeline/lambda/jobresultprocessor0% | 0% | 76% | 19% | 3%
textract-pipeline/lambda/documentprocessor0% | 0% | 66% | 23% | 10%
textract-pipeline/lambda/s3batchprocessor0% | 0% | 67% | 32% | 0%
textract-pipeline/lambda/syncprocessor0% | 0% | 38% | 61% | 0%
textract-pipeline/lambda/s3processor0% | 0% | 0% | 71% | 28%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in textract-pipeline/lib/textract-pipeline-stack.ts
226 1 3
def startJob()
in textract-pipeline/lambda/asyncprocessor/lambda_function.py
39 5 7
def startJob()
in src/asyncproc.py
39 5 7
def processRequest()
in textract-pipeline/lambda/asyncprocessor/lambda_function.py
38 8 1
def processRequest()
in src/asyncproc.py
38 8 1
def processItems()
in textract-pipeline/lambda/asyncprocessor/lambda_function.py
36 8 3
def processItems()
in src/asyncproc.py
36 8 3
def processRequest()
in textract-pipeline/lambda/jobresultprocessor/lambda_function.py
33 2 1
def processRequest()
in src/jobresultsproc.py
33 2 1
def processRequest()
in textract-pipeline/lambda/s3batchprocessor/lambda_function.py
31 3 1
def processRequest()
in src/s3batchproc.py
31 3 1
def getFileNames()
in textract-pipeline/lambda/helper/python/helper.py
27 7 5
def callTextract()
in textract-pipeline/lambda/syncprocessor/lambda_function.py
27 5 5
def getJobResults()
in textract-pipeline/lambda/jobresultprocessor/lambda_function.py
27 6 2
def callTextract()
in src/syncproc.py
27 5 5
def getJobResults()
in src/jobresultsproc.py
27 6 2
def getFileNames()
in src/helper.py
27 7 5
def createDocument()
in textract-pipeline/lambda/helper/python/datastore.py
24 3 4
def __init__()
in textract-pipeline/lambda/textractor/python/trp.py
24 8 3
def _parse()
in textract-pipeline/lambda/textractor/python/trp.py
24 8 2