aws-samples / amazon-comprehend-semi-structured-documents-annotation-tools
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 41 units with 455 lines of code in units (28.7% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (133 lines of code)
    • 2 medium size units (72 lines of code)
    • 9 small units (114 lines of code)
    • 28 very small units (136 lines of code)
0% | 29% | 15% | 25% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 29% | 15% | 25% | 29%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 29% | 15% | 25% | 29%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in src/pre_human_task_lambda.py
77 14 2
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 do_consolidation()
in src/annotation_consolidation_lambda.py
36 7 5
def plumber_line_to_blocks()
in src/pre_human_task_lambda.py
16 3 5
def get_pdf_blocks()
in src/pre_human_task_lambda.py
15 3 3
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 output_pdf_temp_file_to_s3()
in src/pre_human_task_lambda.py
12 2 6
def get_annotations()
in src/annotation_consolidation_lambda.py
12 1 3
def get_object_from_s3()
in src/s3_helper.py
11 4 2
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 __init__()
in src/s3_helper.py
10 1 2
def get_s3_object()
in src/pre_human_task_lambda.py
9 2 2
def textract_block_to_block_relationship()
in src/pre_human_task_lambda.py
9 4 1
def textract_block_to_block()
in src/pre_human_task_lambda.py
9 2 4
def __init__()
in src/block_helper.py
9 1 7
def analyze_document()
in src/pre_human_task_lambda.py
8 1 1
def get_blocks_from_s3_ref()
in src/annotation_consolidation_lambda.py
8 4 2