awslabs / fraud-detection-using-machine-learning
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 33 units with 310 lines of code in units (24.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (42 lines of code)
    • 12 small units (168 lines of code)
    • 19 very small units (100 lines of code)
0% | 0% | 13% | 54% | 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% | 0% | 13% | 54% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source0% | 0% | 37% | 34% | 28%
deployment/solution-assistant/src0% | 0% | 0% | 94% | 5%
source/lambda/model-invocation0% | 0% | 0% | 63% | 36%
source/notebooks/src/package0% | 0% | 0% | 0% | 100%
source/scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def bash()
in source/env_setup.py
21 4 1
def env_setup()
in source/env_setup.py
21 6 0
def lambda_handler()
in source/lambda/model-invocation/index.py
18 5 2
def delete_sagemaker_endpoint_config()
in deployment/solution-assistant/src/lambda_function.py
18 3 1
def add_to_logbook()
in source/env_setup.py
16 7 2
def delete_sagemaker_endpoint()
in deployment/solution-assistant/src/lambda_function.py
16 3 1
def on_delete()
in deployment/solution-assistant/src/lambda_function.py
15 2 2
def delete_sagemaker_model()
in deployment/solution-assistant/src/lambda_function.py
13 3 1
def delete_s3_objects()
in deployment/solution-assistant/src/lambda_function.py
13 2 1
def delete_s3_bucket()
in deployment/solution-assistant/src/lambda_function.py
13 2 1
def in_logbook()
in source/env_setup.py
12 5 2
def store_data_prediction()
in source/lambda/model-invocation/index.py
12 6 2
def get_hostname()
in source/env_setup.py
11 2 0
def bucket_delete_retry()
in deployment/solution-assistant/src/lambda_function.py
11 4 1
def get_fraud_prediction()
in source/lambda/model-invocation/index.py
9 2 2
def set_kernel_spec()
in source/scripts/set_kernelspec.py
9 2 3
def get_sagemaker_mode()
in source/env_setup.py
8 2 0
def get_anomaly_prediction()
in source/lambda/model-invocation/index.py
8 1 1
def invoke_endpoint()
in source/notebooks/src/package/generate_endpoint_traffic.py
8 1 1
def generate_traffic()
in source/notebooks/src/package/generate_endpoint_traffic.py
7 4 1