aws-samples / amazon-comprehend-semi-structured-documents-annotation-tools
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 41 units with 455 lines of code in units (28.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (169 lines of code)
    • 1 simple units (36 lines of code)
    • 37 very simple units (250 lines of code)
0% | 0% | 37% | 7% | 54%
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% | 37% | 7% | 54%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 0% | 37% | 7% | 54%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def blocks_from_native_pdf()
in src/pre_human_task_lambda.py
56 18 4
def blocks_from_scanned_pdf()
in src/pre_human_task_lambda.py
36 18 3
def lambda_handler()
in src/pre_human_task_lambda.py
77 14 2
def do_consolidation()
in src/annotation_consolidation_lambda.py
36 7 5
def get_object_from_s3()
in src/s3_helper.py
11 4 2
def textract_block_to_block_relationship()
in src/pre_human_task_lambda.py
9 4 1
def get_blocks_from_s3_ref()
in src/annotation_consolidation_lambda.py
8 4 2
def lambda_handler()
in src/annotation_consolidation_lambda.py
14 4 2
def is_scanned_pdf()
in src/pre_human_task_lambda.py
12 3 3
def get_pdf_blocks()
in src/pre_human_task_lambda.py
15 3 3
def plumber_line_to_blocks()
in src/pre_human_task_lambda.py
16 3 5
def resize_and_convert_to_bytes()
in src/pre_human_task_lambda.py
11 3 3
def extend_bounding_box()
in src/block_helper.py
11 3 2
def write_content()
in src/s3_helper.py
5 2 4
def get_s3_object()
in src/pre_human_task_lambda.py
9 2 2
def output_pdf_temp_file_to_s3()
in src/pre_human_task_lambda.py
12 2 6
def textract_block_to_block()
in src/pre_human_task_lambda.py
9 2 4
def JSONHandler()
in src/block_helper.py
5 2 1
def __init__()
in src/block_helper.py
3 2 3
def extend_geometry()
in src/block_helper.py
5 2 2