firebase / firebase-js-sdk
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 3,624 units with 49,116 lines of code in units (55.1% of code).
    • 11 very long units (1,360 lines of code)
    • 94 long units (6,086 lines of code)
    • 552 medium size units (16,955 lines of code)
    • 924 small units (13,527 lines of code)
    • 2,043 very small units (11,188 lines of code)
2% | 12% | 34% | 27% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts2% | 12% | 34% | 27% | 22%
js0% | 9% | 40% | 28% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/database6% | 21% | 31% | 23% | 17%
repo-scripts/api-documenter22% | 18% | 27% | 15% | 16%
packages/auth4% | 6% | 24% | 38% | 26%
packages/firestore<1% | 11% | 38% | 27% | 21%
repo-scripts/size-analysis0% | 25% | 44% | 19% | 10%
packages/remote-config0% | 27% | 27% | 27% | 16%
packages/app-check0% | 11% | 44% | 30% | 13%
scripts/build0% | 51% | 25% | 7% | 16%
packages/performance0% | 13% | 19% | 38% | 29%
scripts/ci-test0% | 66% | 0% | 14% | 18%
packages/auth-compat0% | 9% | 33% | 25% | 30%
scripts/ci0% | 28% | 55% | 11% | 4%
packages/firebase0% | 30% | 24% | 18% | 27%
repo-scripts/prune-dts0% | 14% | 66% | 11% | 7%
scripts/release0% | 17% | 26% | 23% | 32%
packages/storage0% | 2% | 40% | 25% | 31%
packages/messaging0% | 3% | 31% | 32% | 31%
packages/functions0% | 16% | 48% | 23% | 12%
packages/analytics0% | 6% | 16% | 41% | 35%
config0% | 36% | 0% | 34% | 29%
packages/util0% | 0% | 36% | 30% | 32%
packages/installations0% | 0% | 23% | 36% | 39%
packages/database-compat0% | 0% | 73% | 6% | 20%
packages/rules-unit-testing0% | 0% | 61% | 25% | 13%
scripts/size_report0% | 0% | 54% | 40% | 5%
scripts/format0% | 0% | 72% | 8% | 19%
packages/firestore-compat0% | 0% | 26% | 18% | 55%
scripts/docgen-compat0% | 0% | 51% | 42% | 5%
scripts0% | 0% | 53% | 25% | 20%
scripts/docgen0% | 0% | 88% | 0% | 11%
packages/app-compat0% | 0% | 40% | 15% | 43%
packages/webchannel-wrapper0% | 0% | 95% | 0% | 4%
repo-scripts/changelog-generator0% | 0% | 75% | 25% | 0%
scripts/extract-deps0% | 0% | 67% | 20% | 12%
packages/logger0% | 0% | 60% | 0% | 39%
packages/app0% | 0% | 19% | 31% | 49%
integration/firestore0% | 0% | 47% | 43% | 8%
packages/component0% | 0% | 27% | 32% | 40%
tools0% | 0% | 0% | 64% | 35%
packages/installations-compat0% | 0% | 0% | 69% | 30%
packages/storage-compat0% | 0% | 0% | 15% | 84%
packages/remote-config-compat0% | 0% | 0% | 40% | 60%
packages/messaging-compat0% | 0% | 0% | 25% | 74%
packages/analytics-compat0% | 0% | 0% | 100% | 0%
packages/app-check-compat0% | 0% | 0% | 100% | 0%
packages/performance-compat0% | 0% | 0% | 0% | 100%
scripts/emulator-testing0% | 0% | 0% | 0% | 100%
packages/functions-compat0% | 0% | 0% | 0% | 100%
packages/template0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function _debugErrorMap()
in packages/auth/src/core/errors.ts
231 1 0
function repoRerunTransactionQueue()
in packages/database/src/core/Repo.ts
127 14 3
private _createEntryPointOrNamespace()
in repo-scripts/api-documenter/src/documenters/MarkdownDocumenter.ts
127 21 1
private _createClassTables()
in repo-scripts/api-documenter/src/documenters/MarkdownDocumenter.ts
119 10 1
protected writeNode()
in repo-scripts/api-documenter/src/markdown/MarkdownEmitter.ts
117 23 3
function viewProcessorGenerateEventCacheAfterServerEvent()
in packages/database/src/core/view/ViewProcessor.ts
116 11 6
export function localStoreApplyRemoteEventToLocalCache()
in packages/firestore/src/local/local_store_impl.ts
110 7 2
function viewProcessorRevertUserWrite()
in packages/database/src/core/view/ViewProcessor.ts
105 13 6
export function repoStart()
in packages/database/src/core/Repo.ts
104 8 3
public load()
in repo-scripts/api-documenter/src/plugin/PluginLoader.ts
103 15 2
export function viewProcessorApplyOperation()
in packages/database/src/core/view/ViewProcessor.ts
101 11 5
private fullLimitUpdateChild_()
in packages/database/src/core/view/filter/LimitedFilter.ts
97 20 5
protected writeNode()
in repo-scripts/api-documenter/src/markdown/CustomMarkdownEmitter.ts
96 17 3
export async function extractDependenciesAndSize()
in repo-scripts/size-analysis/analysis-helper.ts
94 3 2
private _createInterfaceTables()
in repo-scripts/api-documenter/src/documenters/MarkdownDocumenter.ts
90 9 1
open()
in packages/database/src/realtime/BrowserPollConnection.ts
87 15 1
function repoSendTransactionQueue()
in packages/database/src/core/Repo.ts
87 10 3
function viewProcessorApplyUserOverwrite()
in packages/database/src/core/view/ViewProcessor.ts
84 8 7
private handleWebStorageEvent()
in packages/firestore/src/local/shared_client_state.ts
83 20 1
export function onSnapshot()
in packages/firestore/src/api/reference_impl.ts
82 7 2