aws-samples / aws-serverless-workshop-innovator-island
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 17 units with 153 lines of code in units (2.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (72 lines of code)
    • 2 small units (25 lines of code)
    • 13 very small units (56 lines of code)
0% | 0% | 47% | 16% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 40% | 14% | 46%
py0% | 0% | 60% | 20% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
1-app-deploy/ride-controller0% | 0% | 62% | 0% | 37%
3-photos/1-chromakey0% | 0% | 60% | 20% | 18%
5-park-stats/2-simulator0% | 0% | 0% | 50% | 50%
3-photos/2-compositing0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 17 longest units
Unit# linesMcCabe index# params
function sendResponse()
in 1-app-deploy/ride-controller/initDB/app.js
40 1 4
def lambda_handler()
in 3-photos/1-chromakey/app.py
32 4 2
const getRandomPoint = function()
in 5-park-stats/2-simulator/sam-app/simulatorFunction/lib/geo.js
14 1 2
def scale_image()
in 3-photos/1-chromakey/app.py
11 2 1
def upload_file()
in 3-photos/1-chromakey/app.py
10 3 3
const getBuffer = function()
in 3-photos/2-compositing/lambdaFunction/app.js
8 2 1
await updateRide()
in 1-app-deploy/ride-controller/fatController/app.js
7 1 1
await flushBatch()
in 5-park-stats/2-simulator/sam-app/simulatorFunction/lib/dispatch.js
6 1 0
await sendResponse()
in 1-app-deploy/ride-controller/initDB/app.js
6 1 3
function pad()
in 5-park-stats/2-simulator/sam-app/simulatorFunction/simulation.js
5 2 2
await sendSNS()
in 1-app-deploy/ride-controller/fatController/app.js
4 1 2
await main()
in 5-park-stats/2-simulator/sam-app/simulatorFunction/app.js
3 1 0
await initRides()
in 1-app-deploy/ride-controller/initDB/app.js
2 1 0
await initRides()
in 1-app-deploy/ride-controller/initDB/app.js
2 1 0
await sendResponse()
in 1-app-deploy/ride-controller/initDB/app.js
1 1 4
await sendResponse()
in 1-app-deploy/ride-controller/initDB/app.js
1 1 4
await sendResponse()
in 1-app-deploy/ride-controller/initDB/app.js
1 1 4