awslabs / sagemaker-privacy-for-nlp
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 59 units with 574 lines of code in units (33.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 7 medium size units (167 lines of code)
    • 16 small units (217 lines of code)
    • 36 very small units (190 lines of code)
0% | 0% | 29% | 37% | 33%
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% | 29% | 37% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/sagemaker/src/package/model0% | 0% | 46% | 16% | 37%
source0% | 0% | 37% | 34% | 28%
source/sagemaker/src/package/container_build0% | 0% | 56% | 19% | 24%
source/sagemaker/src/package/data_privatization0% | 0% | 14% | 47% | 38%
deployment/solution-assistant/src0% | 0% | 0% | 87% | 12%
source/sagemaker/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 log_stream()
in source/sagemaker/src/package/container_build/logs.py
32 6 4
def evaluate_model()
in source/sagemaker/src/package/model/inference.py
30 2 5
def bash()
in source/env_setup.py
21 4 1
def env_setup()
in source/env_setup.py
21 6 0
def train()
in source/sagemaker/src/package/data_privatization/container/train.py
21 4 5
def train()
in source/sagemaker/src/package/model/train.py
21 4 5
def calculate_metrics()
in source/sagemaker/src/package/model/inference.py
21 2 3
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 privatize_example()
in source/sagemaker/src/package/data_privatization/data_privatization.py
16 5 4
def delete_sagemaker_endpoint()
in deployment/solution-assistant/src/lambda_function.py
16 3 1
def create_clean_counter()
in source/sagemaker/src/package/data_privatization/data_privatization.py
15 6 2
def train_one_epoch()
in source/sagemaker/src/package/data_privatization/container/train.py
14 2 4
def train_one_epoch()
in source/sagemaker/src/package/model/train.py
14 2 4
def parse_args()
in source/sagemaker/src/package/data_privatization/data_privatization.py
13 1 0
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 get_hostname()
in source/env_setup.py
11 2 0