fbsamples / fbinstant-samples
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 89 units with 928 lines of code in units (81.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (307 lines of code)
    • 22 small units (313 lines of code)
    • 57 very small units (308 lines of code)
0% | 0% | 33% | 33% | 33%
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% | 33% | 33% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
common/js/mock0% | 0% | 34% | 27% | 38%
server-examples/nodejs-bot0% | 0% | 72% | 17% | 10%
server-examples/nodejs-backend0% | 0% | 45% | 22% | 32%
tasks0% | 0% | 0% | 85% | 14%
common/js0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
getEntriesAsync: function()
in common/js/mock/fbinstant.6.2.mock.js
45 1 0
module.exports = function()
in server-examples/nodejs-backend/matches.js
38 3 1
function sendMessage()
in server-examples/nodejs-bot/bot.js
32 3 5
getPlayersAsync: function()
in common/js/mock/fbinstant.6.2.mock.js
32 2 0
getConnectedPlayersAsync: function()
in common/js/mock/fbinstant.6.2.mock.js
31 2 0
module.exports = function()
in server-examples/nodejs-bot/bot.js
30 6 1
getCatalogAsync: function()
in common/js/mock/fbinstant.6.2.mock.js
28 1 0
getConnectedPlayerEntriesAsync: function()
in common/js/mock/fbinstant.6.2.mock.js
25 1 0
const validate = function()
in server-examples/nodejs-backend/matches.js
23 4 1
createAlert: function()
in common/js/mock/fbinstant.6.2.mock.js
23 5 2
function()
in tasks/upload.js
20 5 3
module.exports = function()
in tasks/archive.js
19 1 3
module.exports = function()
in tasks/run-dist.js
18 1 3
shareAsync: function()
in common/js/mock/fbinstant.6.2.mock.js
18 1 1
loadMatchData()
in server-examples/nodejs-backend/matches.js
16 2 1
getSupportedAPIs: function()
in common/js/mock/fbinstant.6.2.mock.js
16 5 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
function callSendAPI()
in server-examples/nodejs-bot/bot.js
15 1 1
module.exports = function()
in tasks/run-mock.js
14 1 3