aws-samples / amazon-sagemaker-cdk-examples
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 25 units with 728 lines of code in units (45.2% of code).
    • 0 very long units (0 lines of code)
    • 6 long units (418 lines of code)
    • 5 medium size units (158 lines of code)
    • 9 small units (118 lines of code)
    • 5 very small units (34 lines of code)
0% | 57% | 21% | 16% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 61% | 18% | 17% | 3%
js0% | 0% | 69% | 0% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dask-fargate/dask_fargate0% | 100% | 0% | 0% | 0%
stepfn-batch0% | 64% | 28% | 0% | 6%
auto-model-deploy/lambda0% | 69% | 0% | 27% | 3%
notebook-teams/multinotebookefs0% | 100% | 0% | 0% | 0%
cron-train0% | 58% | 29% | 11% | 0%
auto-model-deploy0% | 100% | 0% | 0% | 0%
cron-inference0% | 0% | 70% | 29% | 0%
dask-fargate/cdk.out0% | 0% | 69% | 0% | 30%
kinesis-inference0% | 0% | 67% | 32% | 0%
api-lambda-sm0% | 0% | 0% | 100% | 0%
dask-fargate/binderhub0% | 0% | 0% | 69% | 30%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in dask-fargate/dask_fargate/dask_fargate_stack.py
90 11 4
def __init__()
in stepfn-batch/app.py
79 1 4
def deploy_model()
in auto-model-deploy/lambda/deploy-model.py
67 13 1
def __init__()
in notebook-teams/multinotebookefs/multinotebookefs_stack.py
62 5 4
def run_training()
in cron-train/lambda-handler.py
61 1 0
def __init__()
in auto-model-deploy/app.py
59 4 3
def lambda_handler()
in stepfn-batch/lambda-submit.py
35 2 2
def __init__()
in cron-inference/app.py
33 1 3
def __init__()
in cron-train/app.py
31 1 3
function respondCFN()
in dask-fargate/cdk.out/asset.a65ac4beaa2b5a7b20eebf3b7c5c1c886b71428afa377e02dab0d10ab3be57e7/handler.js
30 2 4
def __init__()
in kinesis-inference/app.py
29 1 3
def __init__()
in api-lambda-sm/app.py
18 1 3
def lambda_handler()
in cron-inference/lambda-handler.py
14 1 2
def valid_json()
in auto-model-deploy/lambda/deploy-model.py
14 8 1
def lambda_handler()
in kinesis-inference/lambda-handler.py
14 1 2
def lambda_handler()
in auto-model-deploy/lambda/deploy-model.py
12 2 2
def lambda_handler()
in cron-train/lambda-handler.py
12 2 2
def _load_values()
in dask-fargate/binderhub/binderhub_config.py
12 3 0
def lambda_handler()
in api-lambda-sm/lambda-handler.py
11 1 2
def _merge_dictionaries()
in dask-fargate/binderhub/binderhub_config.py
11 5 2