aws-samples / document-processing-pipeline-for-regulated-industries
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 205 units with 2,082 lines of code in units (81.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (16 lines of code)
    • 19 simple units (467 lines of code)
    • 185 very simple units (1,599 lines of code)
0% | 0% | <1% | 22% | 76%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 0% | <1% | 25% | 73%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
code/extension_detector0% | 0% | 22% | 77% | 0%
code/lambda_layer/pipeline0% | 0% | 0% | 19% | 80%
code/comprehend_sync0% | 0% | 0% | 61% | 38%
code/lambda_layer/metadata-services0% | 0% | 0% | 29% | 70%
code/document_classifier0% | 0% | 0% | 63% | 36%
code/document_registrar0% | 0% | 0% | 25% | 75%
code/textract_async0% | 0% | 0% | 7% | 92%
infrastructure/lib0% | 0% | 0% | 0% | 100%
code/metadata0% | 0% | 0% | 0% | 100%
code/textract_sync0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in code/extension_detector/extension_detector.py
16 11 2
def __init__()
in code/lambda_layer/pipeline/python/trp.py
14 10 3
def lambda_handler()
in code/document_classifier/document_classifier.py
15 10 2
def processRecord()
in code/extension_detector/extension_detector.py
14 10 4
def __init__()
in code/lambda_layer/pipeline/python/trp.py
16 9 3
def __init__()
in code/lambda_layer/pipeline/python/trp.py
25 9 3
def __init__()
in code/lambda_layer/pipeline/python/trp.py
21 9 3
def _parse()
in code/lambda_layer/pipeline/python/trp.py
24 8 2
def getLinesInReadingOrder()
in code/lambda_layer/pipeline/python/trp.py
19 8 1
def _parseDocumentPagesAndBlockMap()
in code/lambda_layer/pipeline/python/trp.py
18 8 1
def writeTextractOutputs()
in code/lambda_layer/pipeline/python/og.py
18 7 2
def createLineage()
in code/lambda_layer/metadata-services/python/datastore.py
42 7 10
def processRequest()
in code/document_classifier/document_classifier.py
18 7 1
def getJobResults()
in code/textract_async/textract_processor.py
10 7 3
def batchSendToComprehend()
in code/comprehend_sync/comprehend_processor.py
26 7 3
def runComprehend()
in code/comprehend_sync/comprehend_processor.py
66 7 3
def __init__()
in code/lambda_layer/pipeline/python/metadata.py
18 6 5
def queryDocumentId()
in code/lambda_layer/metadata-services/python/datastore.py
46 6 4
def processRequest()
in code/extension_detector/extension_detector.py
40 6 4
def lambda_handler()
in code/document_registrar/document_registrar.py
17 6 2