aws-samples / amazon-textract-transformer-pipeline
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 211 units with 2,505 lines of code in units (35.4% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (140 lines of code)
    • 9 medium complex units (577 lines of code)
    • 17 simple units (525 lines of code)
    • 184 very simple units (1,263 lines of code)
0% | 5% | 23% | 20% | 50%
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% | 5% | 23% | 20% | 50%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pipeline/review0% | 64% | 21% | 0% | 13%
notebooks/src0% | 0% | 33% | 23% | 42%
pipeline/postprocessing0% | 0% | 48% | 13% | 38%
pipeline/ocr0% | 0% | 24% | 25% | 49%
notebooks/util0% | 0% | 10% | 9% | 80%
annotation/fn-SMGT-Post0% | 0% | 0% | 100% | 0%
pipeline/fn-trigger0% | 0% | 0% | 77% | 22%
pipeline/enrichment0% | 0% | 0% | 74% | 25%
annotation0% | 0% | 0% | 0% | 100%
pipeline0% | 0% | 0% | 0% | 100%
notebooks/preproc0% | 0% | 0% | 0% | 100%
annotation/fn-SMGT-Pre0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def handler()
in pipeline/review/fn-review-callback/main.py
140 27 2
def train()
in notebooks/src/code/train.py
88 25 3
def handler()
in pipeline/postprocessing/fn-postprocess/main.py
107 24 2
def handle_request()
in pipeline/ocr/fn-call-textract/main.py
99 21 2
def predict_fn()
in notebooks/src/code/inference.py
62 21 2
def to_dict()
in pipeline/postprocessing/fn-postprocess/util/boxes.py
34 15 2
def to_dict()
in notebooks/util/postproc/boxes.py
34 15 2
def handler()
in pipeline/review/fn-start-review/main.py
46 14 2
def get_model()
in notebooks/src/code/train.py
56 14 2
def input_fn()
in notebooks/src/code/inference.py
51 12 2
def fetch_textract_result()
in pipeline/ocr/fn-call-textract/main.py
32 10 2
def handler()
in pipeline/ocr/fn-call-textract/main.py
35 9 2
def handler()
in pipeline/enrichment/fn-call-sagemaker/main.py
23 9 2
def dataset_inputs()
in notebooks/src/code/data/base.py
32 9 1
def __init__()
in notebooks/util/project.py
23 9 2
def handler()
in annotation/fn-SMGT-Post/main.py
98 8 2
def torch_call()
in notebooks/src/code/data/mlm.py
52 8 2
def __init__()
in pipeline/ocr/sfn_semaphore/fn-acquire-lock/main.py
33 7 2
def __init__()
in pipeline/postprocessing/fn-postprocess/main.py
29 7 5
def __init__()
in notebooks/src/code/inference.py
15 7 2