firebase / firebase-functions
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 318 units with 4,889 lines of code in units (67.3% of code).
    • 1 very long units (163 lines of code)
    • 13 long units (915 lines of code)
    • 57 medium size units (1,674 lines of code)
    • 89 small units (1,349 lines of code)
    • 158 very small units (788 lines of code)
3% | 18% | 34% | 27% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts3% | 19% | 34% | 26% | 15%
js0% | 0% | 28% | 49% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src18% | 17% | 26% | 11% | 25%
src/v20% | 33% | 33% | 27% | 4%
src/common0% | 10% | 56% | 23% | 9%
src/providers0% | 0% | 27% | 37% | 35%
integration_test/functions0% | 0% | 56% | 26% | 17%
src/logger0% | 0% | 58% | 24% | 16%
docgen0% | 0% | 32% | 48% | 19%
src/runtime0% | 0% | 38% | 61% | 0%
spec/fixtures0% | 0% | 0% | 63% | 36%
scripts0% | 0% | 0% | 78% | 21%
src/utilities0% | 0% | 0% | 0% | 100%
docgen/theme0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function assertRuntimeOptionsValid()
in src/function-builder.ts
163 37 1
export function onRequest()
in src/v2/providers/https.ts
96 3 3
export function makeCloudFunction()
in src/cloud-functions.ts
95 14 1
export function onRequest()
in src/v2/providers/https.ts
89 3 2
export function onRequest()
in src/v2/providers/https.ts
83 3 2
export function onMessagePublished()
in src/v2/providers/pubsub.ts
73 2 2
export function onMessagePublished()
in src/v2/providers/pubsub.ts
69 2 2
export function onOperation()
in src/v2/providers/storage.ts
69 2 2
export function onMessagePublished()
in src/v2/providers/pubsub.ts
65 2 2
export function onTaskDispatched()
in src/v2/providers/https.ts
57 2 1
export function optionsToTrigger()
in src/cloud-functions.ts
57 3 1
55 3 1
export function onTaskDispatched()
in src/v2/providers/https.ts
54 2 2
export function userRecordConstructor()
in src/common/providers/identity.ts
53 4 1
export function onTaskDispatched()
in src/v2/providers/https.ts
50 2 1
function wrapOnCallHandler()
in src/common/providers/https.ts
47 9 2
export function optionsToEndpoint()
in src/cloud-functions.ts
44 2 1
export function onNewTesterIosDevicePublished()
in src/v2/providers/alerts/appDistribution.ts
42 2 1
async function callScheduleTrigger()
in integration_test/functions/src/index.ts
40 2 2
function createTestMatrix()
in integration_test/functions/src/testLab-utils.ts
40 1 4