aws-solutions / improving-forecast-accuracy-with-machine-learning
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 586 units with 5,947 lines of code in units (61.7% of code).
    • 2 very long units (615 lines of code)
    • 3 long units (183 lines of code)
    • 60 medium size units (1,653 lines of code)
    • 111 small units (1,583 lines of code)
    • 410 very small units (1,913 lines of code)
10% | 3% | 27% | 26% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py10% | 3% | 27% | 26% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infrastructure/forecast48% | 0% | 18% | 18% | 14%
cdk_solution_helper_py/helpers_cdk0% | 9% | 33% | 25% | 32%
forecast-shared/shared0% | 2% | 27% | 31% | 38%
glue/jobs0% | 0% | 40% | 24% | 35%
synthetic0% | 0% | 41% | 16% | 42%
lambdas/notification0% | 0% | 100% | 0% | 0%
lambdas/sns0% | 0% | 0% | 68% | 32%
cdk_solution_helper_py/helpers_common0% | 0% | 0% | 24% | 75%
infrastructure/quicksight0% | 0% | 0% | 55% | 44%
lambdas/createdatasetgroup0% | 0% | 0% | 100% | 0%
lambdas/createquicksightanalysis0% | 0% | 0% | 100% | 0%
infrastructure0% | 0% | 0% | 100% | 0%
lambdas/createforecast0% | 0% | 0% | 54% | 45%
lambdas/createpredictor0% | 0% | 0% | 55% | 45%
lambdas/createdatasetimportjob0% | 0% | 0% | 0% | 100%
lambdas/creategluetablename0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in source/infrastructure/forecast/stack.py
429 5 5
def __init__()
in source/infrastructure/forecast/forecast/parameters.py
186 1 3
def patch_lambda()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py
64 20 1
def source_code_package()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/build_s3_cdk_dist.py
64 6 3
def __init__()
in source/forecast-shared/shared/quicksight_custom_resources/util/quicksight_application.py
55 5 2
def aggregate_forecast_data()
in source/glue/jobs/forecast_etl.py
48 4 1
def _forecast_role()
in source/infrastructure/forecast/aws_lambda/policies/factory.py
46 7 4
def notification()
in source/lambdas/notification/handler.py
43 7 2
def export()
in source/forecast-shared/shared/Predictor/predictor.py
42 5 2
def synthesize()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py
40 9 2
def export()
in source/forecast-shared/shared/Forecast/forecast.py
38 5 2
def patch_nested()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py
37 9 1
def ready()
in source/forecast-shared/shared/DatasetGroup/dataset_group.py
36 10 1
def try_bundle()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/bundling.py
33 11 3
def sync()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/build_s3_cdk_dist.py
32 7 1
def _create_data_set()
in source/forecast-shared/shared/quicksight_custom_resources/util/dataset.py
31 3 3
def s3_solutions_read_access()
in source/infrastructure/forecast/etl/policies.py
31 1 1
def _create_downloader()
in source/infrastructure/forecast/forecast/downloader.py
31 1 1
def s3_solutions_access()
in source/infrastructure/forecast/sagemaker/policies.py
31 1 1
def _detect_header()
in source/glue/jobs/forecast_etl.py
31 14 1