aws-samples / aws-cdk-deep-learning-image-vector-embeddings-at-scale-using-aws-batch
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 26 units with 296 lines of code in units (73.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (88 lines of code)
    • 2 medium size units (60 lines of code)
    • 4 small units (64 lines of code)
    • 19 very small units (84 lines of code)
0% | 29% | 20% | 21% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 29% | 20% | 21% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
batch_job_cdk0% | 100% | 0% | 0% | 0%
src_lambda0% | 0% | 75% | 0% | 25%
src_batch_job/source0% | 0% | 24% | 31% | 44%
src_batch_job0% | 0% | 0% | 73% | 26%
batch_job_cdk/constructs0% | 0% | 0% | 50% | 50%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in batch_job_cdk/stack.py
88 1 4
def handler()
in src_lambda/main.py
39 4 2
def process()
in src_batch_job/source/image_processor.py
21 4 3
def main()
in src_batch_job/main.py
19 2 0
def __init__()
in batch_job_cdk/constructs/batch_lambda_function.py
18 1 7
def preprocess_image()
in src_batch_job/source/model.py
15 1 2
def _dynamodb_itemize()
in src_batch_job/source/image_processor.py
12 1 3
def split()
in src_lambda/main.py
8 3 4
def to_vector()
in src_batch_job/source/model.py
7 1 2
def __init__()
in src_batch_job/source/image_processor.py
7 1 4
def get_mandatory_env()
in src_batch_job/main.py
7 2 1
7 2 1
def correct_channel()
in src_batch_job/source/model.py
6 2 2
def __init__()
in src_batch_job/source/model.py
5 1 1
def _create_instance()
in batch_job_cdk/constructs/instance_profile.py
5 1 1
def __init__()
in batch_job_cdk/constructs/instance_profile.py
5 1 3
def batch()
in src_lambda/main.py
5 2 3
def profile_arn()
in batch_job_cdk/constructs/instance_profile.py
4 2 1
def _s3_read_object()
in src_batch_job/source/image_processor.py
3 1 2
def _vectorize()
in src_batch_job/source/image_processor.py
3 1 2