firebase / functions-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 127 units with 1,592 lines of code in units (25.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (73 lines of code)
    • 2 simple units (49 lines of code)
    • 124 very simple units (1,470 lines of code)
0% | 0% | 4% | 3% | 92%
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% | 4% | 3% | 92%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
stripe0% | 0% | 47% | 0% | 52%
fulltext-search-firestore0% | 0% | 0% | 18% | 81%
testlab-to-slack0% | 0% | 0% | 48% | 52%
fcm-notifications0% | 0% | 0% | 0% | 100%
authenticated-json-api0% | 0% | 0% | 0% | 100%
username-password-auth0% | 0% | 0% | 0% | 100%
quickstarts0% | 0% | 0% | 0% | 100%
text-moderation0% | 0% | 0% | 0% | 100%
instagram-auth0% | 0% | 0% | 0% | 100%
linkedin-auth0% | 0% | 0% | 0% | 100%
spotify-auth0% | 0% | 0% | 0% | 100%
exif-images0% | 0% | 0% | 0% | 100%
presence-firestore0% | 0% | 0% | 0% | 100%
authorized-https-endpoint0% | 0% | 0% | 0% | 100%
email-confirmation0% | 0% | 0% | 0% | 100%
coupon-on-purchase0% | 0% | 0% | 0% | 100%
template-handlebars0% | 0% | 0% | 0% | 100%
delete-unused-accounts-cron0% | 0% | 0% | 0% | 100%
google-sheet-sync0% | 0% | 0% | 0% | 100%
moderate-images0% | 0% | 0% | 0% | 100%
remote-config-diff0% | 0% | 0% | 0% | 100%
survey-app-update0% | 0% | 0% | 0% | 100%
github-to-slack0% | 0% | 0% | 0% | 100%
ffmpeg-convert-audio0% | 0% | 0% | 0% | 100%
generate-thumbnail0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function startDataListeners()
in stripe/public/javascript/app.js
73 13 0
function getSlackmoji()
in testlab-to-slack/functions/index.js
24 10 1
async function getFirebaseUser()
in fulltext-search-firestore/functions/index.js
25 6 3
req.onload = function()
in username-password-auth/public/main.js
17 5 0
function authenticate()
in username-password-auth/functions/index.js
24 5 2
Demo.prototype.onAuthStateChanged = function()
in fcm-notifications/public/main.js
30 5 1
Demo.prototype.onAuthStateChanged = function()
in email-confirmation/public/main.js
28 5 1
function getIdTokenFromRequest()
in template-handlebars/functions/firebaseUser.js
16 5 2
Demo.prototype.listMessages = function()
in authenticated-json-api/public/main.js
25 4 1
function search()
in fulltext-search-firestore/public/index.js
20 4 1
Guestbook.prototype.saveMessage = function()
in text-moderation/public/main.js
18 4 1
Demo.prototype.displayAllUsers = function()
in fcm-notifications/public/main.js
46 4 0
Demo.prototype.saveToken = function()
in fcm-notifications/public/main.js
16 4 0
Demo.prototype.authenticatedRequest = function()
in authenticated-json-api/public/main.js
21 3 3
29 3 1
function imageMagickOutputToObject()
in exif-images/functions/index.js
26 3 1
Guestbook.prototype.displayMessage = function()
in text-moderation/public/main.js
16 3 4
Guestbook.prototype.toggleButton = function()
in text-moderation/public/main.js
7 3 0
function moderateMessage()
in text-moderation/functions/index.js
11 3 1
async function sendCouponViaFCM()
in coupon-on-purchase/functions/index.js
21 3 2