aws-samples / serverless-trivia-game
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 216 units with 2,629 lines of code in units (22.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (64 lines of code)
    • 8 simple units (339 lines of code)
    • 207 very simple units (2,226 lines of code)
0% | 0% | 2% | 12% | 84%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
js0% | 0% | 2% | 12% | 84%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
backend/Functions/IoT0% | 0% | 11% | 0% | 88%
backend/Functions/WebSockets0% | 0% | 0% | 29% | 70%
backend/Functions/HTTP0% | 0% | 0% | 14% | 85%
backend/Functions/Main0% | 0% | 0% | 19% | 80%
backend/sendchatlayer0% | 0% | 0% | 44% | 55%
backend/utilslayer0% | 0% | 0% | 100% | 0%
frontend/src/services0% | 0% | 0% | 0% | 100%
frontend/src/store0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
async function scoreResponse()
in backend/Functions/IoT/answer_receive/app.js
64 14 3
Dimensions: buildDimensions()
in backend/utilslayer/logger.js
34 9 2
async function getData()
in backend/sendchatlayer/index.js
46 7 1
async function getScoreboard()
in backend/Functions/HTTP/leaderboard_get/app.js
51 7 2
exports.handler = function()
in backend/Functions/WebSockets/auth/app.js
76 7 3
function AuthPolicy()
in backend/Functions/WebSockets/auth/app.js
23 7 3
const getStatementsForEffect = function()
in backend/Functions/WebSockets/auth/app.js
21 7 2
async function getActiveGames()
in backend/Functions/HTTP/activegames_list/app.js
38 6 1
async function updateXP()
in backend/Functions/Main/playerprogression_put/app.js
50 6 3
async function formatMessage()
in backend/sendchatlayer/index.js
26 5 1
async function ListOnMarketplace()
in backend/Functions/HTTP/game_listonmarketplace/app.js
39 5 3
async function joingame()
in backend/Functions/WebSockets/livegameplayer/app.js
56 5 4
build()
in backend/Functions/WebSockets/auth/app.js
15 5 0
async function persistLeaderboard()
in backend/Functions/IoT/game_end/app.js
40 5 1
function buildUserObject()
in frontend/src/services/Cognito.js
21 4 1
async function sendData()
in backend/sendchatlayer/index.js
31 4 5
async function removeLiveForPlayer()
in backend/Functions/HTTP/game_activate/app.js
15 4 1
async function removeLiveForPlayer()
in backend/Functions/HTTP/activegames_delete/app.js
15 4 1
async function joinGame()
in backend/Functions/HTTP/game_play/app.js
37 4 2
async function getQuestion()
in backend/Functions/IoT/question_send/app.js
24 4 2