aws-samples / serverless-trivia-game
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 216 units with 2,629 lines of code in units (22.6% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (247 lines of code)
    • 32 medium size units (926 lines of code)
    • 62 small units (889 lines of code)
    • 118 very small units (567 lines of code)
0% | 9% | 35% | 33% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 9% | 35% | 33% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
backend/Functions/WebSockets0% | 32% | 23% | 28% | 16%
backend/Functions/IoT0% | 11% | 19% | 45% | 24%
backend/Functions/HTTP0% | 8% | 44% | 40% | 6%
backend/Functions/Main0% | 0% | 83% | 6% | 10%
backend/sendchatlayer0% | 0% | 100% | 0% | 0%
frontend/src/services0% | 0% | 22% | 53% | 23%
backend/utilslayer0% | 0% | 100% | 0% | 0%
frontend/src/store0% | 0% | 0% | 15% | 84%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
exports.handler = function()
in backend/Functions/WebSockets/auth/app.js
76 7 3
async function scoreResponse()
in backend/Functions/IoT/answer_receive/app.js
64 14 3
async function joingame()
in backend/Functions/WebSockets/livegameplayer/app.js
56 5 4
async function getScoreboard()
in backend/Functions/HTTP/leaderboard_get/app.js
51 7 2
async function updateXP()
in backend/Functions/Main/playerprogression_put/app.js
50 6 3
async function getData()
in backend/sendchatlayer/index.js
46 7 1
async function persistLeaderboard()
in backend/Functions/IoT/game_end/app.js
40 5 1
async function ListOnMarketplace()
in backend/Functions/HTTP/game_listonmarketplace/app.js
39 5 3
async function getActiveGames()
in backend/Functions/HTTP/activegames_list/app.js
38 6 1
async function joinGame()
in backend/Functions/HTTP/game_play/app.js
37 4 2
async function getGame()
in backend/Functions/HTTP/game_get/app.js
37 3 2
async function sendResponseAsync()
in backend/Functions/Main/webpush_vapid_generate/app.js
36 1 4
Dimensions: buildDimensions()
in backend/utilslayer/logger.js
34 9 2
async function sendData()
in backend/sendchatlayer/index.js
31 4 5
async function savePlayer()
in backend/Functions/HTTP/player_put/app.js
31 3 2
async function getMyGames()
in backend/Functions/HTTP/mygames_list/app.js
31 3 1
async function handleCreate()
in backend/Functions/Main/webpush_vapid_generate/app.js
30 2 1
async function GetQuestions()
in backend/Functions/WebSockets/livegameadmin/app.js
29 2 1
async function updateScoreboard()
in backend/Functions/Main/score_put/app.js
28 4 4
async function formatMessage()
in backend/sendchatlayer/index.js
26 5 1