aws-samples / document-processing-pipeline-for-regulated-industries
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 205 units with 2,082 lines of code in units (81.0% of code).
    • 1 very long units (229 lines of code)
    • 2 long units (124 lines of code)
    • 23 medium size units (665 lines of code)
    • 29 small units (475 lines of code)
    • 150 very small units (589 lines of code)
10% | 5% | 31% | 22% | 28%
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% | 6% | 35% | 25% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infrastructure/lib100% | 0% | 0% | 0% | 0%
code/comprehend_sync0% | 44% | 32% | 8% | 15%
code/textract_async0% | 43% | 33% | 10% | 12%
code/lambda_layer/metadata-services0% | 0% | 70% | 17% | 12%
code/metadata0% | 0% | 87% | 0% | 12%
code/lambda_layer/pipeline0% | 0% | 13% | 30% | 56%
code/textract_sync0% | 0% | 73% | 17% | 9%
code/extension_detector0% | 0% | 57% | 42% | 0%
code/document_registrar0% | 0% | 47% | 52% | 0%
code/document_classifier0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in infrastructure/lib/textract-pipeline-stack.ts
229 1 3
def runComprehend()
in code/comprehend_sync/comprehend_processor.py
66 7 3
def processRequest()
in code/textract_async/textract_processor.py
58 5 1
def updateDocumentStatus()
in code/lambda_layer/metadata-services/python/datastore.py
47 4 6
def queryDocumentId()
in code/lambda_layer/metadata-services/python/datastore.py
46 6 4
def createLineage()
in code/lambda_layer/metadata-services/python/datastore.py
42 7 10
def startDocumentTracking()
in code/lambda_layer/metadata-services/python/datastore.py
40 4 8
def processRequest()
in code/extension_detector/extension_detector.py
40 6 4
def registerDocument()
in code/lambda_layer/metadata-services/python/datastore.py
36 4 9
def processCreateRequest()
in code/document_registrar/document_registrar.py
32 3 5
def lambda_handler()
in code/metadata/lineage.py
31 5 2
def batchSendToComprehend()
in code/comprehend_sync/comprehend_processor.py
26 7 3
def __init__()
in code/lambda_layer/pipeline/python/trp.py
25 9 3
def processRequest()
in code/textract_sync/textract_processor.py
25 5 3
def lambda_handler()
in code/metadata/registry.py
25 4 2
def updateDocumentStatus()
in code/metadata/pipeline.py
25 3 3
def lambda_handler()
in code/metadata/pipeline.py
25 5 2
def _parse()
in code/lambda_layer/pipeline/python/trp.py
24 8 2
def startJob()
in code/textract_async/textract_starter.py
24 1 5
def postLineage()
in code/metadata/lineage.py
24 5 2