aws-samples / aws-bikenow-demo
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 85 units with 1,505 lines of code in units (23.9% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (308 lines of code)
    • 25 medium size units (693 lines of code)
    • 23 small units (300 lines of code)
    • 32 very small units (204 lines of code)
0% | 20% | 46% | 19% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx0% | 33% | 19% | 30% | 16%
py0% | 16% | 59% | 13% | 10%
ts0% | 0% | 90% | 0% | 9%
js0% | 0% | 49% | 27% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
assets/src0% | 29% | 27% | 27% | 15%
lambdas/setup_rds_ddl0% | 66% | 22% | 11% | 0%
lambdas/setup_datawarehouse_ddl0% | 62% | 26% | 11% | 0%
lambdas/setup_empty_bucket0% | 0% | 100% | 0% | 0%
lambdas/setup_upload_artifacts0% | 0% | 42% | 31% | 26%
lambdas/api_post_rides0% | 0% | 81% | 18% | 0%
lambdas/api_get_rides0% | 0% | 80% | 19% | 0%
lambdas/setup_update_config0% | 0% | 36% | 34% | 28%
lambdas/api_predict_station_status0% | 0% | 61% | 0% | 38%
lambdas/stream_station_review_to_s30% | 0% | 80% | 0% | 19%
lambdas/api_get_reviews0% | 0% | 80% | 0% | 20%
lambdas/api_post_reviews0% | 0% | 100% | 0% | 0%
lambdas/api_search_stations0% | 0% | 100% | 0% | 0%
lambdas/load_station_detail_to_ddb0% | 0% | 100% | 0% | 0%
lambdas/api_get_quicksight_url0% | 0% | 100% | 0% | 0%
lambdas/stream_station_status_to_es0% | 0% | 75% | 0% | 25%
lambdas/load_station_status_to_ddb0% | 0% | 100% | 0% | 0%
lambdas/stream_station_status_to_s30% | 0% | 0% | 68% | 31%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in lambdas/setup_rds_ddl/index.py
72 10 2
renderHome()
in assets/src/modules/signup/Home.tsx
68 3 0
def lambda_handler()
in lambdas/setup_datawarehouse_ddl/index.py
59 9 2
renderRideModal()
in assets/src/modules/signup/Home.tsx
58 2 0
renderReviewModal()
in assets/src/modules/signup/Home.tsx
51 4 0
def lambda_handler()
in lambdas/api_post_rides/index.py
49 2 2
def lambda_handler()
in lambdas/api_get_rides/index.py
46 3 2
def lambda_handler()
in lambdas/setup_empty_bucket/index.py
36 7 2
function sendResponse()
in lambdas/setup_update_config/index.js
34 1 5
def lambda_handler()
in lambdas/setup_upload_artifacts/index.py
33 7 2
renderBikeStations()
in assets/src/modules/signup/Home.tsx
29 4 1
def lambda_handler()
in lambdas/api_predict_station_status/index.py
29 4 2
def lambda_handler()
in lambdas/stream_station_review_to_s3/index.py
29 5 2
async function loadDashboard()
in assets/src/modules/report/Embed.tsx
28 2 1
def lambda_handler()
in lambdas/api_get_reviews/index.py
28 3 2
def lambda_handler()
in lambdas/api_post_reviews/index.py
27 2 2
def send()
in lambdas/setup_datawarehouse_ddl/cfnresponse/__init__.py
25 3 6
def lambda_handler()
in lambdas/api_search_stations/index.py
25 1 2
def send()
in lambdas/setup_rds_ddl/cfnresponse/__init__.py
25 3 6
def send()
in lambdas/setup_upload_artifacts/cfnresponse/__init__.py
25 3 6