aws-quickstart / quickstart-phsa-ipac
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 31 units with 1,292 lines of code in units (42.5% of code).
    • 5 very long units (655 lines of code)
    • 4 long units (232 lines of code)
    • 10 medium size units (299 lines of code)
    • 2 small units (33 lines of code)
    • 10 very small units (73 lines of code)
50% | 17% | 23% | 2% | 5%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py50% | 17% | 23% | 2% | 5%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
functions/source/preprocess72% | 13% | 6% | 0% | 7%
functions/source/loop62% | 14% | 17% | 0% | 5%
functions/source/job-creation29% | 30% | 34% | 3% | 3%
functions/source/Keep-job-alive0% | 0% | 65% | 26% | 8%
functions/source/sagemaker-phc-2020-11-16-postprocess0% | 0% | 100% | 0% | 0%
functions/source/sagemaker-phc-2020-11-16-preprocess0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def plot_timeline()
in functions/source/preprocess/preprocess.py
154 21 2
def generate_iwp_plot()
in functions/source/preprocess/preprocess.py
143 17 4
def lambda_handler()
in functions/source/loop/loop_lambda.py
124 23 2
def write_json_on_s3()
in functions/source/loop/loop_lambda.py
120 43 4
def lambda_handler()
in functions/source/job-creation/job_creation.py
114 16 2
def gen_data_dict()
in functions/source/job-creation/job_creation.py
60 15 2
def map_pathogen_name_to_id()
in functions/source/job-creation/job_creation.py
58 2 1
def map_pathogen_id_to_name()
in functions/source/loop/loop_lambda.py
58 2 1
def lambda_handler()
in functions/source/preprocess/preprocess.py
56 4 2
def write_csv_aggregate()
in functions/source/loop/loop_lambda.py
44 7 5
def get_table()
in functions/source/job-creation/job_creation.py
43 10 1
def get_table_fields()
in functions/source/job-creation/job_creation.py
41 1 0
def preprocess()
in functions/source/preprocess/preprocess.py
27 2 1
def lambda_handler()
in functions/source/Keep-job-alive/keepjobalive.py
27 3 2
def modify_template_content()
in functions/source/job-creation/job_creation.py
27 2 2
def lambda_handler()
in functions/source/sagemaker-phc-2020-11-16-postprocess/sagemaker-phc-2020-11-16-postprocess.py
24 3 2
def check_creationtimefile()
in functions/source/Keep-job-alive/keepjobalive.py
22 6 0
def write_timeline()
in functions/source/job-creation/job_creation.py
22 1 2
def update_timeline()
in functions/source/loop/loop_lambda.py
22 1 3
def removerow_creationtime()
in functions/source/Keep-job-alive/keepjobalive.py
20 4 2