aws-samples / amazon-sagemaker-bert-classify-pytorch
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 64 units with 497 lines of code in units (85.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (125 lines of code)
    • 1 medium size units (32 lines of code)
    • 7 small units (97 lines of code)
    • 54 very small units (243 lines of code)
0% | 25% | 6% | 19% | 48%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 25% | 6% | 19% | 48%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 25% | 6% | 19% | 48%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run_train()
in src/bert_train.py
70 11 7
def main()
in src/main.py
55 1 0
def __init__()
in src/builder.py
32 4 15
def __init__()
in src/bert_train.py
16 8 8
def validate()
in src/bert_train.py
16 2 4
def predict_fn()
in src/serve.py
16 5 2
def model_fn()
in src/serve.py
15 1 1
def download_file()
in src/s3_util.py
12 3 4
11 3 1
def get_network()
in src/builder.py
11 3 1
def upload_file()
in src/s3_util.py
10 3 4
def _get_bucketname_key()
in src/s3_util.py
10 2 1
def download_object()
in src/s3_util.py
10 2 3
def upload_files()
in src/s3_util.py
10 4 5
def __init__()
in src/bert_model.py
10 5 6
def download_files()
in src/s3_util.py
8 2 5
def create_checkpoint()
in src/bert_train.py
8 2 3
8 3 1
def get_trainer()
in src/builder.py
8 2 1
def list_files()
in src/s3_util.py
7 2 2