aws-ia / workshop-taskcat
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 21 units with 291 lines of code in units (5.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (140 lines of code)
    • 2 medium size units (63 lines of code)
    • 2 small units (40 lines of code)
    • 15 very small units (48 lines of code)
0% | 48% | 21% | 13% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 48% | 21% | 13% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
content/lab_assets/start/lab50% | 54% | 25% | 15% | 4%
content/lab_assets/start/lab40% | 55% | 24% | 15% | 4%
content/lab_assets/start/lab30% | 0% | 0% | 0% | 100%
content/lab_assets/start/lab10% | 0% | 0% | 0% | 100%
content/lab_assets/start/lab20% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in content/lab_assets/start/lab4/cfn-project/lambda_functions/source/Survey/survey.py
70 11 2
def lambda_handler()
in content/lab_assets/start/lab5/cfn-project/lambda_functions/source/Survey/survey.py
70 11 2
def lambda_handler()
in content/lab_assets/start/lab5/cfn-project/lambda_functions/source/SurveySubmit/survey_submit.py
32 4 2
def lambda_handler()
in content/lab_assets/start/lab4/cfn-project/lambda_functions/source/SurveySubmit/survey_submit.py
31 4 2
def get_ddb_table()
in content/lab_assets/start/lab4/cfn-project/lambda_functions/source/SurveySubmit/survey_submit.py
20 2 1
def get_ddb_table()
in content/lab_assets/start/lab5/cfn-project/lambda_functions/source/SurveySubmit/survey_submit.py
20 2 1
def _generate_random_string()
in content/lab_assets/start/lab3/cfn-project/lambda_functions/source/GenRandom/lambda_function.py
8 3 2
def _generate_random_string()
in content/lab_assets/start/lab1/cfn-project/lambda_functions/source/GenRandom/lambda_function.py
8 3 2
def _generate_random_string()
in content/lab_assets/start/lab2/cfn-project/lambda_functions/source/GenRandom/lambda_function.py
8 3 2
def acc_id_from_arn()
in content/lab_assets/start/lab4/cfn-project/lambda_functions/source/SurveySubmit/survey_submit.py
2 1 1
def region_from_arn()
in content/lab_assets/start/lab4/cfn-project/lambda_functions/source/SurveySubmit/survey_submit.py
2 1 1
def table_name_from_arn()
in content/lab_assets/start/lab4/cfn-project/lambda_functions/source/SurveySubmit/survey_submit.py
2 1 1
def no_op()
in content/lab_assets/start/lab3/cfn-project/lambda_functions/source/GenRandom/lambda_function.py
2 1 2
def handler()
in content/lab_assets/start/lab3/cfn-project/lambda_functions/source/GenRandom/lambda_function.py
2 1 2
def acc_id_from_arn()
in content/lab_assets/start/lab5/cfn-project/lambda_functions/source/SurveySubmit/survey_submit.py
2 1 1
def region_from_arn()
in content/lab_assets/start/lab5/cfn-project/lambda_functions/source/SurveySubmit/survey_submit.py
2 1 1
def table_name_from_arn()
in content/lab_assets/start/lab5/cfn-project/lambda_functions/source/SurveySubmit/survey_submit.py
2 1 1
def no_op()
in content/lab_assets/start/lab1/cfn-project/lambda_functions/source/GenRandom/lambda_function.py
2 1 2
def handler()
in content/lab_assets/start/lab1/cfn-project/lambda_functions/source/GenRandom/lambda_function.py
2 1 2
def no_op()
in content/lab_assets/start/lab2/cfn-project/lambda_functions/source/GenRandom/lambda_function.py
2 1 2