aws-samples / amazon-rds-purpose-built-workshop
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 10 units with 374 lines of code in units (51.9% of code).
    • 1 very long units (136 lines of code)
    • 1 long units (54 lines of code)
    • 3 medium size units (116 lines of code)
    • 3 small units (51 lines of code)
    • 2 very small units (17 lines of code)
36% | 14% | 31% | 13% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py36% | 14% | 31% | 13% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ddb-python-script83% | 0% | 0% | 12% | 4%
taxi-ride-workflow/driver-accept-trip0% | 100% | 0% | 0% | 0%
ddb-stream-processor0% | 0% | 51% | 36% | 11%
taxi-ride-workflow/driver-complete-trip0% | 0% | 100% | 0% | 0%
taxi-ride-workflow/rider-book-trip0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 10 longest units
Unit# linesMcCabe index# params
def updateTripInfo()
in src/ddb-python-script/util.py
136 37 2
def lambda_handler()
in src/taxi-ride-workflow/driver-accept-trip/driver-accept-trip.py
54 1 2
def getTripCompletionRecords()
in src/ddb-stream-processor/lambda_function.py
44 41 1
def lambda_handler()
in src/taxi-ride-workflow/driver-complete-trip/driver-complete-trip.py
37 1 2
def lambda_handler()
in src/taxi-ride-workflow/rider-book-trip/rider-book-trip.py
35 2 2
def getTripInfo()
in src/ddb-python-script/util.py
20 4 1
def createInsertSQLQueries()
in src/ddb-stream-processor/lambda_function.py
16 2 1
def lambda_handler()
in src/ddb-stream-processor/lambda_function.py
15 2 2
def pusblishTripCompletionInfo()
in src/ddb-stream-processor/lambda_function.py
10 2 1
def default()
in src/ddb-python-script/util.py
7 3 2