aws-samples / aws-stepfunctions-examples
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 37 units with 591 lines of code in units (23.9% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (73 lines of code)
    • 7 medium size units (239 lines of code)
    • 13 small units (172 lines of code)
    • 16 very small units (107 lines of code)
0% | 12% | 40% | 29% | 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% | 40% | 29% | 16%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
app-decompose-for-parallelism0% | 20% | 49% | 19% | 11%
app-s3-athena-dataprocessing0% | 0% | 33% | 37% | 28%
app-order-management0% | 0% | 0% | 100% | 0%
app-local-testing-mock-config0% | 0% | 0% | 0% | 100%
app-control-concurrency-with-dynamodb0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in sam/app-decompose-for-parallelism/functions/get_test_run_report/app.py
73 12 2
def lambda_handler()
in sam/app-decompose-for-parallelism/functions/get_test_results_from_state_machine_output/app.py
50 12 2
def lambda_handler()
in sam/app-decompose-for-parallelism/functions/create_batches_in_s3/app.py
47 15 2
def cmd_run_smoke_test()
in sam/app-decompose-for-parallelism/ctl.py
38 6 1
def cmd_init_account()
in sam/app-s3-athena-dataprocessing/ctl.py
38 6 1
def lambda_handler()
in sam/app-decompose-for-parallelism/functions/split_if_required/app.py
22 5 2
def cmd_create_dashboard()
in sam/app-decompose-for-parallelism/ctl.py
22 1 1
def cmd_create_dashboard()
in sam/app-s3-athena-dataprocessing/ctl.py
22 1 1
def lambda_handler()
in sam/app-s3-athena-dataprocessing/functions/list_glue_crawlers/app.py
16 4 2
def lambda_handler()
in sam/app-decompose-for-parallelism/functions/record_metric_data/app.py
15 2 2
def lambda_handler()
in sam/app-decompose-for-parallelism/functions/get_batches_from_s3/app.py
15 4 2
def get_parameter()
in sam/app-decompose-for-parallelism/ctl.py
15 3 2
def get_parameter()
in sam/app-s3-athena-dataprocessing/ctl.py
15 3 2
def describe_stack()
in sam/app-decompose-for-parallelism/ctl.py
13 1 1
def lambda_handler()
in sam/app-s3-athena-dataprocessing/functions/create_s3_folder/app.py
13 4 2
def describe_stack()
in sam/app-s3-athena-dataprocessing/ctl.py
13 1 1
def lambda_handler()
in sam/app-order-management/functions/sqscallbackfunction/app.py
12 2 2
def lambda_handler()
in sam/app-order-management/functions/get_customer_status/app.py
12 5 2
def process_execution_description()
in sam/app-decompose-for-parallelism/ctl.py
11 3 1
def lambda_handler()
in sam/app-s3-athena-dataprocessing/functions/start_glue_crawler/app.py
11 2 2