aws-samples / amazon-mwaa-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 39 units with 545 lines of code in units (27.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 11 medium size units (289 lines of code)
    • 11 small units (169 lines of code)
    • 17 very small units (87 lines of code)
0% | 0% | 53% | 31% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 54% | 31% | 13%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
usecases/image-processing/dags0% | 0% | 54% | 36% | 9%
dags/xgboost-ml-pipeline/1.100% | 0% | 88% | 0% | 11%
dags/xgboost-ml-pipeline/2.00% | 0% | 88% | 0% | 11%
usecases/mwaa-with-codeartifact/infra0% | 0% | 25% | 50% | 25%
usecases/mwaa-with-codeartifact/lambda0% | 0% | 62% | 37% | 0%
dags/metadb_to_secrets_manager/1.100% | 0% | 77% | 0% | 22%
usecases/image-processing/lambda0% | 0% | 0% | 0% | 100%
usecases/mwaa-with-codeartifact/mwaa-ca-bucket-content0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def preprocess_glue()
in dags/xgboost-ml-pipeline/1.10/mwaa-customer-churn-dag.py
32 1 0
def preprocess_glue()
in dags/xgboost-ml-pipeline/2.0/mwaa-customer-churn-dag.py
32 1 0
def create_endpoints()
in usecases/mwaa-with-codeartifact/infra/vpc_stack.py
30 2 1
def write_all_to_aws_sm_fn()
in dags/metadb_to_secrets_manager/1.10/metadb_to_secrets_manager.py
27 5 1
def handler()
in usecases/mwaa-with-codeartifact/lambda/lambda_handler.py
27 2 2
def face_detection()
in usecases/image-processing/dags/1.10/image_processing.py
25 4 2
def face_detection()
in usecases/image-processing/dags/2.0/image_processing.py
25 4 2
def face_detection()
in usecases/image-processing/dags/image_processing.py
25 4 2
def check_duplicate()
in usecases/image-processing/dags/1.10/image_processing.py
22 3 2
def check_duplicate()
in usecases/image-processing/dags/2.0/image_processing.py
22 3 2
def check_duplicate()
in usecases/image-processing/dags/image_processing.py
22 3 2
def __init__()
in usecases/mwaa-with-codeartifact/infra/s3_stack.py
19 1 4
def add_face_index()
in usecases/image-processing/dags/1.10/image_processing.py
16 1 2
def add_face_index()
in usecases/image-processing/dags/2.0/image_processing.py
16 1 2
def add_face_index()
in usecases/image-processing/dags/image_processing.py
16 1 2
def cfn_response()
in usecases/mwaa-with-codeartifact/lambda/lambda_handler.py
16 6 1
def persist_data()
in usecases/image-processing/dags/1.10/image_processing.py
15 1 1
def persist_data()
in usecases/image-processing/dags/2.0/image_processing.py
15 1 1
def persist_data()
in usecases/image-processing/dags/image_processing.py
15 1 1
def __init__()
in usecases/mwaa-with-codeartifact/infra/vpc_stack.py
15 1 4