aws-samples / amazon-frauddetector-mlops-multiaccount-cdk
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 126 units with 1,172 lines of code in units (72.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (54 lines of code)
    • 14 medium size units (410 lines of code)
    • 23 small units (328 lines of code)
    • 88 very small units (380 lines of code)
0% | 4% | 34% | 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
py0% | 4% | 34% | 27% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/core0% | 17% | 48% | 17% | 16%
infra/src/stages0% | 0% | 58% | 17% | 23%
infra/src/custom_constructs0% | 0% | 51% | 34% | 14%
infra/src/lambda_poller0% | 0% | 34% | 51% | 14%
src/features0% | 0% | 30% | 14% | 55%
infra/src0% | 0% | 0% | 56% | 43%
src0% | 0% | 0% | 30% | 69%
infra/src/stacks0% | 0% | 0% | 57% | 42%
src/rules0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def deploy()
in src/core/fraud_detector_model_based_deploy.py
54 13 7
def run()
in src/core/fraud_detector_train.py
45 5 9
def __init__()
in infra/src/custom_constructs/tool_account_fd_role_construct.py
44 1 7
def get_stage_actions()
in infra/src/stages/train_stage_codebuild_long_polling.py
39 3 5
def _set_common_params()
in infra/src/stages/train_stage_codebuild_long_polling.py
31 2 2
def try_create_variable()
in src/core/fraud_detector_utils.py
30 9 7
def create_or_update_rule()
in src/core/fraud_detector_utils.py
29 2 3
def update_poll_status()
in infra/src/lambda_poller/lambda_function.py
29 3 2
def __init__()
in infra/src/custom_constructs/ci_pipeline_construct.py
26 2 6
def get_stage_actions()
in infra/src/stages/deploy_stage_codebuild.py
25 2 7
def create_or_retrieve_features()
in src/features/feature_variables_dynamic.py
24 5 1
def delete_all_detector_versions()
in src/core/fraud_detector_undeploy.py
23 4 2
def _set_common_params()
in infra/src/stages/deploy_stage_codebuild.py
22 2 2
def get_stage_actions()
in infra/src/stages/generic_stage_codebuild.py
22 1 6
def delete_all_rules()
in src/core/fraud_detector_undeploy.py
21 4 2
def _add_env_stage()
in infra/src/custom_constructs/ml_pipeline_construct.py
20 3 7
def _get_max_rule_version()
in src/core/fraud_detector_utils.py
19 5 3
def wait_until_model_status()
in src/core/fraud_detector_utils.py
19 7 6
def lambda_handler()
in infra/src/lambda_poller/lambda_function.py
18 5 2
def __init__()
in infra/src/stages/repo_action_bitbucket.py
18 1 2