aws-samples / amazon-textract-a2i-pdf
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 48 units with 712 lines of code in units (85.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (145 lines of code)
    • 7 medium size units (207 lines of code)
    • 9 small units (133 lines of code)
    • 30 very small units (227 lines of code)
0% | 20% | 29% | 18% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 21% | 30% | 16% | 31%
java0% | 0% | 0% | 55% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
multipagepdfa2i0% | 53% | 40% | 5% | 1%
deploy_code/multipagepdfa2i_analyzepdf0% | 0% | 37% | 12% | 49%
deploy_code/multipagepdfa2i_wrapup0% | 0% | 24% | 24% | 50%
deploy_code/multipagepdfa2i_kickoff0% | 0% | 50% | 30% | 19%
deploy_code/multipagepdfa2i_humancomplete0% | 0% | 0% | 35% | 64%
deploy_code/multipagepdfa2i_pngextract/src/main/java0% | 0% | 0% | 55% | 44%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def create_iam_role_for_lambdas()
in multipagepdfa2i/multipagepdfa2i_stack.py
93 3 1
def create_state_machine()
in multipagepdfa2i/multipagepdfa2i_stack.py
52 1 2
def create_lambda_functions()
in multipagepdfa2i/multipagepdfa2i_stack.py
42 2 2
def create_events()
in multipagepdfa2i/multipagepdfa2i_stack.py
34 2 2
def create_services()
in multipagepdfa2i/multipagepdfa2i_stack.py
33 1 1
def lambda_handler()
in deploy_code/multipagepdfa2i_analyzepdf/lambda_function.py
27 5 2
def get_all_possible_files()
in deploy_code/multipagepdfa2i_wrapup/gather_data.py
25 5 1
def run_analyze_document()
in deploy_code/multipagepdfa2i_analyzepdf/lambda_function.py
25 2 1
def lambda_handler()
in deploy_code/multipagepdfa2i_kickoff/lambda_function.py
21 6 2
public ArrayList run()
in deploy_code/multipagepdfa2i_pngextract/src/main/java/PdfFromS3Pdf.java
19 2 3
def line_up_ids()
in deploy_code/multipagepdfa2i_analyzepdf/clean_data.py
18 7 3
def line_up_ids()
in deploy_code/multipagepdfa2i_humancomplete/clean_data.py
18 7 3
def configure_dynamo_table()
in multipagepdfa2i/multipagepdfa2i_stack.py
14 1 4
def curate_data()
in deploy_code/multipagepdfa2i_wrapup/gather_data.py
13 4 2
def extract_event_data()
in deploy_code/multipagepdfa2i_kickoff/lambda_function.py
13 1 1
def return_to_stepfunctions()
in deploy_code/multipagepdfa2i_humancomplete/lambda_function.py
13 1 1
def create_payload()
in deploy_code/multipagepdfa2i_humancomplete/lambda_function.py
13 1 1
def clear_old_s3_data()
in deploy_code/multipagepdfa2i_wrapup/lambda_function.py
12 3 1
def get_child()
in deploy_code/multipagepdfa2i_analyzepdf/clean_data.py
10 4 3
def extract_value()
in deploy_code/multipagepdfa2i_analyzepdf/clean_data.py
10 4 4