firebase / extensions
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 242 units with 3,770 lines of code in units (37.1% of code).
    • 3 very long units (325 lines of code)
    • 12 long units (826 lines of code)
    • 33 medium size units (1,126 lines of code)
    • 50 small units (716 lines of code)
    • 144 very small units (777 lines of code)
8% | 21% | 29% | 18% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts9% | 23% | 30% | 16% | 20%
js8% | 21% | 25% | 22% | 22%
java0% | 0% | 65% | 31% | 3%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
firestore-send-email27% | 0% | 46% | 7% | 18%
firestore-counter6% | 41% | 15% | 20% | 16%
firestore-bigquery-export0% | 18% | 39% | 16% | 25%
firestore-shorten-urls-bitly0% | 0% | 21% | 55% | 23%
storage-resize-images0% | 0% | 40% | 31% | 27%
firestore-translate-text0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async function preparePayload()
in firestore-send-email/functions/lib/index.js
111 28 1
async function preparePayload()
in firestore-send-email/functions/src/index.ts
111 28 1
public async rescheduleWorkers()
in firestore-counter/functions/src/controller.ts
103 10 0
public run()
in firestore-counter/functions/src/worker.ts
85 12 0
protected maybeAggregate()
in firestore-counter/functions/src/worker.ts
82 14 0
run()
in firestore-counter/functions/lib/worker.js
76 12 0
async rescheduleWorkers()
in firestore-counter/functions/lib/controller.js
76 10 0
async initializeSchemaViewResources()
in firestore-bigquery-export/scripts/gen-schema-view/src/schema.ts
73 5 4
async function processCollectionGroup()
in firestore-bigquery-export/scripts/import/src/run.ts
72 7 1
public async aggregateOnce()
in firestore-counter/functions/src/controller.ts
70 10 2
maybeAggregate()
in firestore-counter/functions/lib/worker.js
69 14 0
public async aggregateContinuously()
in firestore-counter/functions/src/controller.ts
61 7 3
async aggregateOnce()
in firestore-counter/functions/lib/controller.js
59 10 2
public static planAggregations()
in firestore-counter/functions/src/planner.ts
52 5 2
async function processDocuments()
in firestore-bigquery-export/scripts/import/src/worker.ts
51 2 2
export function buildLatestSnapshotViewQuery()
in firestore-bigquery-export/firestore-bigquery-change-tracker/src/bigquery/snapshot.ts
50 10 4
private updateTemplates()
in firestore-send-email/functions/src/templates.ts
50 11 1
export async function parseConfig()
in firestore-bigquery-export/scripts/import/src/config.ts
49 11 0
async function parseConfig()
in firestore-bigquery-export/scripts/import/src/index.ts
48 10 0
async function deliver()
in firestore-send-email/functions/src/index.ts
48 13 2