aws-samples / amazon-sagemaker-mlops-with-featurestore-and-datawrangler
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 935 lines of code in units (20.5% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (147 lines of code)
    • 7 medium size units (253 lines of code)
    • 14 small units (227 lines of code)
    • 61 very small units (308 lines of code)
0% | 15% | 27% | 24% | 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% | 15% | 27% | 24% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infra0% | 53% | 0% | 21% | 24%
repos/serving/lambdas0% | 18% | 53% | 13% | 15%
repos/features_ingestion_pipeline/pipelines0% | 0% | 75% | 0% | 24%
lambdas/functions/auto_approval0% | 0% | 89% | 0% | 10%
repos/features_ingestion_pipeline/infra0% | 0% | 29% | 28% | 42%
repos/serving/infra0% | 0% | 0% | 46% | 53%
demo-workspace/utils0% | 0% | 0% | 56% | 43%
repos/build_pipeline/infra0% | 0% | 0% | 54% | 45%
repos/build_pipeline/pipelines0% | 0% | 0% | 26% | 73%
repos/build_pipeline/lambdas0% | 0% | 0% | 68% | 31%
repos/serving/pipelines0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
demo-workspace/tensorflow0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def launch_role_policies()
in infra/service_catalog_stack.py
95 1 2
def lambda_handler()
in repos/serving/lambdas/functions/xgboost_inference/lambda_function.py
52 4 2
def create_pipeline()
in repos/features_ingestion_pipeline/pipelines/feature_ingestion_pipeline.py
47 1 4
def lambda_handler()
in repos/serving/lambdas/functions/processing-job-execution/lambda_function.py
44 4 2
def lambda_handler()
in repos/serving/lambdas/functions/read-ddb/lambda_function.py
37 6 2
def lambda_handler()
in repos/serving/lambdas/functions/read-sm/lambda_function.py
37 6 2
def process_sns_message()
in lambdas/functions/auto_approval/lambda.py
35 4 1
def lambda_handler()
in repos/serving/lambdas/functions/execute-state-machine/lambda_function.py
32 4 2
def get_fg_conf()
in repos/features_ingestion_pipeline/infra/feature_store_utils.py
21 6 3
def get_session()
in repos/features_ingestion_pipeline/infra/sm_pipeline_utils.py
20 1 2
def get_session()
in repos/build_pipeline/infra/sm_pipeline_utils.py
20 1 2
def get_session()
in repos/serving/infra/sm_pipeline_utils.py
20 1 2
def get_processing_output()
in repos/serving/infra/model_endpoint_construct.py
20 5 3
def lambda_handler()
in repos/serving/lambdas/functions/processing-job-status-check/lambda_function.py
20 4 2
def generate_query()
in repos/build_pipeline/pipelines/xgboost_pipeline.py
19 2 2
def send_pipeline_execution_success()
in repos/serving/lambdas/functions/processing-job-status-check/lambda_function.py
18 1 1
def get_and_upload_data()
in demo-workspace/utils/get_datasets.py
16 2 2
def code_asset_upload()
in infra/utils.py
14 1 3
def get_fg_conf()
in demo-workspace/utils/feature_store_utils.py
14 2 3
def __init__()
in infra/cicd_construct.py
13 1 0