fbsamples / fbinstant-samples
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 89 units with 928 lines of code in units (81.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 1 simple units (30 lines of code)
    • 88 very simple units (898 lines of code)
0% | 0% | 0% | 3% | 96%
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% | 0% | 3% | 96%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
server-examples/nodejs-bot0% | 0% | 0% | 34% | 65%
common/js/mock0% | 0% | 0% | 0% | 100%
tasks0% | 0% | 0% | 0% | 100%
server-examples/nodejs-backend0% | 0% | 0% | 0% | 100%
common/js0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
module.exports = function()
in server-examples/nodejs-bot/bot.js
30 6 1
function()
in tasks/upload.js
20 5 3
getSupportedAPIs: function()
in common/js/mock/fbinstant.6.2.mock.js
16 5 0
createAlert: function()
in common/js/mock/fbinstant.6.2.mock.js
23 5 2
const validate = function()
in server-examples/nodejs-backend/matches.js
23 4 1
getQueryString: function()
in common/js/mock/fbinstant.6.2.mock.js
12 4 0
module.exports = function()
in server-examples/nodejs-backend/matches.js
38 3 1
function()
in server-examples/nodejs-backend/matches.js
9 3 2
const getEncodedData = function()
in server-examples/nodejs-backend/matches.js
14 3 1
function sendMessage()
in server-examples/nodejs-bot/bot.js
32 3 5
log: function()
in common/js/mock/fbinstant.6.2.mock.js
10 3 0
getFromLocalStorage: function()
in common/js/mock/fbinstant.6.2.mock.js
16 3 2
module.exports = function()
in tasks/replace-sdk.js
15 2 3
loadMatchData()
in server-examples/nodejs-backend/matches.js
16 2 1
function()
in server-examples/nodejs-backend/matches.js
6 2 1
function()
in server-examples/nodejs-backend/matches.js
6 2 1
function receivedGameplay()
in server-examples/nodejs-bot/bot.js
7 2 1
incrementStatsAsync: function()
in common/js/mock/fbinstant.6.2.mock.js
14 2 1
getConnectedPlayersAsync: function()
in common/js/mock/fbinstant.6.2.mock.js
31 2 0
getPlayersAsync: function()
in common/js/mock/fbinstant.6.2.mock.js
32 2 0