firebase / functions-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 127 units with 1,592 lines of code in units (25.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (73 lines of code)
    • 21 medium size units (552 lines of code)
    • 43 small units (637 lines of code)
    • 62 very small units (330 lines of code)
0% | 4% | 34% | 40% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 4% | 34% | 40% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
stripe0% | 47% | 16% | 21% | 14%
fcm-notifications0% | 0% | 51% | 31% | 16%
fulltext-search-firestore0% | 0% | 48% | 43% | 7%
exif-images0% | 0% | 73% | 0% | 26%
testlab-to-slack0% | 0% | 100% | 0% | 0%
authenticated-json-api0% | 0% | 43% | 48% | 7%
coupon-on-purchase0% | 0% | 85% | 0% | 14%
presence-firestore0% | 0% | 41% | 52% | 6%
linkedin-auth0% | 0% | 36% | 36% | 26%
spotify-auth0% | 0% | 39% | 39% | 21%
email-confirmation0% | 0% | 44% | 26% | 28%
instagram-auth0% | 0% | 31% | 49% | 19%
username-password-auth0% | 0% | 23% | 57% | 18%
delete-unused-accounts-cron0% | 0% | 67% | 0% | 32%
quickstarts0% | 0% | 0% | 68% | 31%
text-moderation0% | 0% | 0% | 70% | 29%
authorized-https-endpoint0% | 0% | 0% | 43% | 56%
moderate-images0% | 0% | 0% | 100% | 0%
remote-config-diff0% | 0% | 0% | 100% | 0%
template-handlebars0% | 0% | 0% | 48% | 51%
google-sheet-sync0% | 0% | 0% | 64% | 36%
survey-app-update0% | 0% | 0% | 100% | 0%
github-to-slack0% | 0% | 0% | 0% | 100%
ffmpeg-convert-audio0% | 0% | 0% | 0% | 100%
generate-thumbnail0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function startDataListeners()
in stripe/public/javascript/app.js
73 13 0
Demo.prototype.displayAllUsers = function()
in fcm-notifications/public/main.js
46 4 0
function rtdb_and_local_fs_presence()
in presence-firestore/public/index.js
31 2 0
async function createFirebaseAccount()
in spotify-auth/functions/index.js
30 2 5
Demo.prototype.onAuthStateChanged = function()
in fcm-notifications/public/main.js
30 5 1
async function createFirebaseAccount()
in linkedin-auth/functions/index.js
30 2 5
29 3 1
Demo.prototype.onAuthStateChanged = function()
in email-confirmation/public/main.js
28 5 1
function imageMagickOutputToObject()
in exif-images/functions/index.js
26 3 1
function postToSlack()
in testlab-to-slack/functions/index.js
26 1 2
function reportError()
in stripe/functions/index.js
26 2 2
async function createFirebaseAccount()
in instagram-auth/functions/index.js
26 2 4
Demo.prototype.listMessages = function()
in authenticated-json-api/public/main.js
25 4 1
async function getFirebaseUser()
in fulltext-search-firestore/functions/index.js
25 6 3
function getSlackmoji()
in testlab-to-slack/functions/index.js
24 10 1
function authenticate()
in username-password-auth/functions/index.js
24 5 2
Demo.prototype.authenticatedRequest = function()
in authenticated-json-api/public/main.js
21 3 3
function searchAlgoliaAuthenticated()
in fulltext-search-firestore/public/index.js
21 1 1
async function searchTypesenseAuthenticated()
in fulltext-search-firestore/public/index.js
21 1 1
async function sendCouponViaFCM()
in coupon-on-purchase/functions/index.js
21 3 2