aws-quickstart / quickstart-aws-utility-meter-data-analytics-platform
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 78 units with 988 lines of code in units (21.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (138 lines of code)
    • 10 medium size units (348 lines of code)
    • 11 small units (185 lines of code)
    • 55 very small units (317 lines of code)
0% | 13% | 35% | 18% | 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% | 13% | 35% | 18% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
assets/functions/ml_pipeline0% | 20% | 40% | 11% | 27%
meter-data0% | 32% | 12% | 21% | 34%
assets/functions/adapter0% | 0% | 94% | 0% | 5%
assets/functions/meter_forecast0% | 0% | 52% | 21% | 25%
assets/functions/get_anomaly0% | 0% | 100% | 0% | 0%
assets/functions/redshift0% | 0% | 45% | 32% | 21%
assets/glue/scripts0% | 0% | 0% | 31% | 68%
cis-data0% | 0% | 0% | 65% | 34%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in assets/functions/ml_pipeline/prepare_training/app.py
81 9 2
def generate_records()
in meter-data/generate_meter_data.py
57 13 5
def lambda_handler()
in assets/functions/adapter/mrasco/app.py
50 12 2
def lambda_handler()
in assets/functions/ml_pipeline/prepare_batch/app.py
50 5 2
def lambda_handler()
in assets/functions/meter_forecast/app.py
46 7 2
def lambda_handler()
in assets/functions/get_anomaly/app.py
41 7 2
def lambda_handler()
in assets/functions/ml_pipeline/load_pipeline_parameter/app.py
32 3 2
def lambda_handler()
in assets/functions/ml_pipeline/upload_result/app.py
31 3 2
def process_batch()
in assets/functions/ml_pipeline/batch_anomaly_detection/app.py
26 4 5
def lambda_handler()
in assets/functions/redshift/consumption/app.py
25 4 2
def lambda_handler()
in assets/functions/ml_pipeline/split_batch/app.py
25 1 2
def load_db()
in meter-data/generate_meter_data.py
22 8 1
def fit_predict_model()
in assets/functions/ml_pipeline/batch_anomaly_detection/app.py
20 1 2
def create_db()
in meter-data/generate_meter_data.py
20 5 2
def encode_request()
in assets/functions/meter_forecast/app.py
19 4 2
def generate()
in cis-data/generate_cis_data.py
19 5 0
def load_redshift_cred()
in assets/functions/redshift/consumption/app.py
18 4 0
def main()
in meter-data/generate_meter_data.py
17 3 2
def aggregate_and_write_data_to_s3()
in assets/glue/scripts/business_aggregate_monthly.py
15 1 2
def aggregate_and_write_data_to_s3()
in assets/glue/scripts/business_aggregate_weekly.py
15 1 2