aws-samples / aws-cdk-adverse-event-detection-app
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 27 units with 411 lines of code in units (13.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (52 lines of code)
    • 6 medium size units (187 lines of code)
    • 6 small units (96 lines of code)
    • 14 very small units (76 lines of code)
0% | 12% | 45% | 23% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 12% | 45% | 23% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda0% | 100% | 0% | 0% | 0%
ae0% | 0% | 64% | 30% | 4%
cloud90% | 0% | 44% | 21% | 33%
sagemaker/src0% | 0% | 45% | 28% | 25%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in lambda/inference.py
52 12 2
def __init__()
in ae/dynamodb_stack.py
41 1 7
def train()
in sagemaker/src/hf_train_deploy.py
40 3 1
def stream_connect()
in cloud9/stream.py
39 17 3
def locate()
in cloud9/stream.py
24 10 1
def __init__()
in ae/ae_stack.py
22 4 5
def __init__()
in ae/glue_stack.py
21 2 5
def __init__()
in ae/modeling_stack.py
20 2 5
def __init__()
in ae/s3_stack.py
20 1 4
def delete_all_rules()
in cloud9/stream.py
16 4 3
def set_rules()
in cloud9/stream.py
15 3 3
def input_fn()
in sagemaker/src/hf_train_deploy.py
14 6 2
def predict_fn()
in sagemaker/src/hf_train_deploy.py
11 2 2
def gen_dict_extract()
in cloud9/stream.py
10 7 2
def get_bearer_token()
in cloud9/stream.py
10 2 1
def get_all_rules()
in cloud9/stream.py
9 2 2
def _get_dataset()
in sagemaker/src/hf_train_deploy.py
9 3 4
def drug_types()
in cloud9/stream.py
6 5 2
def set_seed()
in sagemaker/src/hf_train_deploy.py
6 2 1
def __init__()
in cloud9/stream.py
5 1 3