aws-samples / aws-document-classifier-and-splitter
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 51 units with 769 lines of code in units (67.9% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (139 lines of code)
    • 10 medium size units (253 lines of code)
    • 14 small units (204 lines of code)
    • 25 very small units (173 lines of code)
0% | 18% | 32% | 26% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 18% | 32% | 26% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
workflow3_local0% | 44% | 13% | 23% | 18%
workflow2_docsplitter/sam-app/functions/getalbinfo_function0% | 0% | 100% | 0% | 0%
workflow2_docsplitter/sam-app/functions/docsplitter_function0% | 0% | 48% | 31% | 19%
workflow1_endpointbuilder/sam-app/functions/function1_createtableandfunction3trigger0% | 0% | 42% | 57% | 0%
workflow1_endpointbuilder/sam-app/functions/function3_processobjectsandupdaterows0% | 0% | 37% | 27% | 34%
workflow1_endpointbuilder/sam-app/functions/function4_checktablestatus0% | 0% | 70% | 0% | 29%
workflow1_endpointbuilder/sam-app/functions/function2_inserttablerowswithobjectkeys0% | 0% | 70% | 0% | 29%
workflow1_endpointbuilder/sam-app/functions/function5_createcsv0% | 0% | 67% | 0% | 32%
workflow1_endpointbuilder/sam-app/functions/function7_checkclassifierstatus0% | 0% | 0% | 60% | 39%
workflow1_endpointbuilder/sam-app/functions/function9_checkendpointstatus0% | 0% | 0% | 66% | 33%
workflow1_endpointbuilder/sam-app/functions/function6_trainclassifier0% | 0% | 0% | 54% | 45%
workflow2_docsplitter/sample_request_folder0% | 0% | 0% | 57% | 42%
workflow1_endpointbuilder/sam-app/functions/function8_buildendpoint0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def create_comprehend_role()
in workflow3_local/local_endpointbuilder.py
78 8 3
def get_endpoint_arn()
in workflow3_local/local_endpointbuilder.py
61 4 4
def lambda_handler()
in workflow2_docsplitter/sam-app/functions/docsplitter_function/index.py
44 4 2
def lambda_handler()
in workflow2_docsplitter/sam-app/functions/getalbinfo_function/index.py
29 2 2
def send()
in workflow2_docsplitter/sam-app/functions/getalbinfo_function/index.py
25 4 7
def create_dataset_table()
in workflow1_endpointbuilder/sam-app/functions/function1_createtableandfunction3trigger/index.py
25 1 2
def main()
in workflow3_local/local_docsplitter.py
22 3 3
def update_dynamodb_row()
in workflow1_endpointbuilder/sam-app/functions/function3_processobjectsandupdaterows/index.py
22 1 6
def check_table()
in workflow1_endpointbuilder/sam-app/functions/function4_checktablestatus/index.py
22 4 2
def insert_table_rows()
in workflow1_endpointbuilder/sam-app/functions/function2_inserttablerowswithobjectkeys/index.py
22 4 3
def add_image_to_csv()
in workflow3_local/local_endpointbuilder.py
21 6 2
def create_csv()
in workflow1_endpointbuilder/sam-app/functions/function5_createcsv/index.py
21 4 2
def lambda_handler()
in workflow1_endpointbuilder/sam-app/functions/function1_createtableandfunction3trigger/index.py
19 3 2
def split_input_pdf_by_class()
in workflow3_local/local_docsplitter.py
18 2 4
def create_training_dataset()
in workflow3_local/local_endpointbuilder.py
17 2 4
def create_output_pdfs()
in workflow2_docsplitter/sam-app/functions/docsplitter_function/index.py
16 2 2
def process_file()
in workflow1_endpointbuilder/sam-app/functions/function3_processobjectsandupdaterows/index.py
16 3 3
def get_processed_images()
in workflow3_local/local_endpointbuilder.py
15 8 1
def create_function3_trigger()
in workflow1_endpointbuilder/sam-app/functions/function1_createtableandfunction3trigger/index.py
15 1 1
def check_endpoint()
in workflow1_endpointbuilder/sam-app/functions/function9_checkendpointstatus/index.py
14 3 1