firebase / snippets-web
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 607 units with 5,836 lines of code in units (58.4% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (118 lines of code)
    • 29 medium size units (796 lines of code)
    • 172 small units (2,431 lines of code)
    • 404 very small units (2,491 lines of code)
0% | 2% | 13% | 41% | 42%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 2% | 12% | 42% | 43%
ts0% | 0% | 61% | 25% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
auth0% | 4% | 15% | 36% | 43%
auth-next0% | 4% | 9% | 51% | 34%
scripts0% | 0% | 61% | 25% | 13%
storage-next0% | 0% | 26% | 36% | 36%
firestore-next0% | 0% | 24% | 20% | 55%
storage0% | 0% | 22% | 34% | 42%
firestore0% | 0% | 34% | 20% | 44%
appcheck-next0% | 0% | 39% | 44% | 15%
snippets0% | 0% | 6% | 43% | 49%
database-next0% | 0% | 0% | 60% | 39%
analytics-next0% | 0% | 0% | 59% | 40%
database0% | 0% | 0% | 45% | 54%
analytics0% | 0% | 0% | 43% | 56%
messaging-next0% | 0% | 0% | 59% | 40%
messaging0% | 0% | 0% | 60% | 40%
firebaseapp-next0% | 0% | 0% | 76% | 23%
functions-next0% | 0% | 0% | 52% | 47%
appcheck0% | 0% | 0% | 48% | 51%
firebaseapp0% | 0% | 0% | 43% | 56%
functions0% | 0% | 0% | 41% | 58%
perf-next0% | 0% | 0% | 0% | 100%
perf0% | 0% | 0% | 0% | 100%
installations0% | 0% | 0% | 0% | 100%
remoteconfig-next0% | 0% | 0% | 0% | 100%
remoteconfig0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function svcIntercept()
in auth/service-worker-sessions.js
59 8 0
function svcIntercept()
in auth-next/service-worker-sessions.js
59 8 0
function collectSnippets()
in scripts/separate-snippets.ts
47 12 1
capital: deleteField()
in firestore-next/test.firestore.js
43 1 0
function uploadHandleError()
in storage-next/upload-files.js
41 6 1
function uploadHandleError()
in storage/upload-files.js
39 6 1
function queryHashes()
in firestore/test.solution-geoqueries.js
30 5 1
async function main()
in scripts/separate-snippets.ts
30 5 0
function fuiStartOauthOptions()
in auth/firebaseui.js
30 1 0
function monitorUpload()
in storage-next/upload-files.js
30 3 1
async function queryHashes()
in firestore-next/test.solution-geoqueries.js
29 5 1
function monitorUpload()
in storage/upload-files.js
28 3 1
27 1 0
function handleUserManagementQueryParams()
in auth-next/custom-email-handler.js
27 5 0
function fuiHandleAnonymous()
in auth/firebaseui.js
26 2 0
function mergeAccounts()
in auth-next/link-multiple-accounts.js
26 1 1
function accountExistsRedirectTenant()
in auth-next/multi-tenancy.js
26 3 4
function handleUserManagementQueryParams()
in auth/custom-email-handler.js
25 5 0
25 3 3
function nonFirebase()
in appcheck-next/index.js
25 2 0