aws-solutions / maintaining-personalized-experiences-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 440 units with 4,401 lines of code in units (48.3% of code).
    • 2 very long units (494 lines of code)
    • 4 long units (287 lines of code)
    • 33 medium size units (964 lines of code)
    • 82 small units (1,212 lines of code)
    • 319 very small units (1,444 lines of code)
11% | 6% | 21% | 27% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py11% | 6% | 22% | 27% | 32%
java0% | 0% | 0% | 21% | 78%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infrastructure/personalize36% | 8% | 10% | 20% | 23%
scheduler/cdk26% | 0% | 23% | 18% | 31%
cdk_solution_helper_py/helpers_cdk0% | 10% | 30% | 25% | 32%
scheduler/common0% | 15% | 9% | 38% | 36%
aws_lambda/shared0% | 0% | 26% | 38% | 35%
aws_lambda/s3_event0% | 0% | 94% | 0% | 5%
aws_lambda/sns_notification0% | 0% | 0% | 48% | 51%
cdk_solution_helper_py/helpers_common0% | 0% | 0% | 25% | 74%
infrastructure0% | 0% | 0% | 0% | 100%
aws_lambda/create_config0% | 0% | 0% | 0% | 100%
aws_lambda/prepare_input0% | 0% | 0% | 0% | 100%
aws_lambda/create_recommender0% | 0% | 0% | 0% | 100%
aws_lambda/create_solution0% | 0% | 0% | 0% | 100%
aws_lambda/create_batch_segment_job0% | 0% | 0% | 0% | 100%
aws_lambda/create_dataset0% | 0% | 0% | 0% | 100%
aws_lambda/create_batch_inference_job0% | 0% | 0% | 0% | 100%
aws_lambda/create_solution_version0% | 0% | 0% | 0% | 100%
aws_lambda/create_filter0% | 0% | 0% | 0% | 100%
aws_lambda/create_timestamp0% | 0% | 0% | 0% | 100%
aws_lambda/create_dataset_group0% | 0% | 0% | 0% | 100%
aws_lambda/create_event_tracker0% | 0% | 0% | 0% | 100%
aws_lambda/create_dataset_import_job0% | 0% | 0% | 0% | 100%
aws_lambda/create_campaign0% | 0% | 0% | 0% | 100%
aws_lambda/create_schema0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in source/infrastructure/personalize/stack.py
391 8 5
def __init__()
in source/scheduler/cdk/aws_solutions/scheduler/cdk/construct.py
103 2 4
def _set_permissions()
in source/infrastructure/personalize/aws_lambda/functions/create_dataset_group.py
97 1 1
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 _transact_put()
in source/scheduler/common/aws_solutions/scheduler/common/base.py
62 12 2
def visit()
in source/scheduler/cdk/aws_solutions/scheduler/cdk/construct.py
47 4 2
def synthesize()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py
40 9 2
def send_configuration_error()
in source/aws_lambda/s3_event/handler.py
39 3 1
def _validate_cron()
in source/scheduler/common/aws_solutions/scheduler/common/schedule.py
38 6 1
def patch_nested()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py
37 9 1
def _validate_solutions()
in source/aws_lambda/shared/personalize_service.py
37 9 2
def _validate_datasets()
in source/aws_lambda/shared/personalize_service.py
35 6 1
def _get_metadata()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/interfaces.py
33 8 1
def try_bundle()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/bundling.py
33 11 3
def _resource_stable()
in source/aws_lambda/shared/notifiers/base.py
33 9 3
def lambda_handler()
in source/aws_lambda/s3_event/handler.py
33 5 2
def sync()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/build_s3_cdk_dist.py
32 7 1
def _set_permissions()
in source/infrastructure/personalize/aws_lambda/functions/create_batch_segment_job.py
32 1 1
def _set_permissions()
in source/infrastructure/personalize/aws_lambda/functions/create_batch_inference_job.py
32 1 1