aws-samples / amazon-personalize-samples
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 84 units with 1,117 lines of code in units (30.5% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (139 lines of code)
    • 12 medium size units (341 lines of code)
    • 23 small units (356 lines of code)
    • 47 very small units (281 lines of code)
0% | 12% | 30% | 31% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 12% | 30% | 31% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
operations/filter_rotator/src0% | 58% | 14% | 10% | 16%
operations/ml_ops_ds_sdk/lambda0% | 21% | 12% | 54% | 11%
operations/ml_ops/personalize-step-functions0% | 0% | 40% | 18% | 40%
data_science/diagnose0% | 0% | 52% | 42% | 4%
operations/streaming_events/lambdas0% | 0% | 0% | 100% | 0%
operations/lambda_examples0% | 0% | 0% | 57% | 42%
data_science/offline_performance_evaluation0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in next_steps/operations/filter_rotator/src/filter_rotator_function/filter_rotator.py
85 13 2
def lambda_handler()
in next_steps/operations/ml_ops_ds_sdk/lambda/stepfunction_create_personalize_role.py
54 6 2
def lambda_handler()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/create-campaign/campaign.py
38 5 2
def compute_temporal_loss()
in next_steps/data_science/diagnose/diagnose.py
35 7 4
def lambda_handler()
in next_steps/operations/ml_ops_ds_sdk/lambda/stepfunction-create-schema.py
32 1 2
def create_filter()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/create-filters/filters.py
29 4 3
def compute_distribution_shift()
in next_steps/data_science/diagnose/diagnose.py
29 5 8
def lambda_handler()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/import-data/datasetimport.py
28 2 2
def lambda_handler()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/create-dataset/dataset.py
27 2 2
def diagnose_items()
in next_steps/data_science/diagnose/diagnose.py
27 4 2
def create_schema()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/create-dataset/dataset.py
26 3 2
def diagnose()
in next_steps/data_science/diagnose/diagnose.py
26 3 3
def lambda_handler()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/event-tracker/eventTracker.py
23 2 2
def eval_expression()
in next_steps/operations/filter_rotator/src/filter_rotator_function/template_evaluation.py
21 2 2
def lambda_handler()
in next_steps/operations/ml_ops_ds_sdk/lambda/stepfunction-createdatasetimportjob.py
20 1 2
def lambda_handler()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/create-datasetgroup/datasetgroup.py
20 2 2
def compute_bootstrap_loss()
in next_steps/data_science/diagnose/diagnose.py
20 2 3
def handler()
in next_steps/operations/streaming_events/lambdas/getRecommendations/getRecommendations.py
19 4 2
def lambda_handler()
in next_steps/operations/ml_ops_ds_sdk/lambda/stepfunctioncreatedatasetimportjob.py
19 1 2
def create_solution()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/create-solution/solution.py
19 4 2