firebase / firebase-tools-ui
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 259 units with 2,711 lines of code in units (17.4% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (141 lines of code)
    • 21 medium size units (639 lines of code)
    • 72 small units (1,047 lines of code)
    • 164 very small units (884 lines of code)
0% | 5% | 23% | 38% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx0% | 9% | 25% | 35% | 29%
ts0% | 0% | 20% | 40% | 39%
js0% | 0% | 28% | 69% | 1%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/components/LogViewer0% | 82% | 0% | 14% | 3%
src/components/Firestore0% | 4% | 34% | 32% | 28%
src/components/Database0% | 0% | 36% | 41% | 21%
src/components/Storage0% | 0% | 13% | 35% | 51%
ROOT0% | 0% | 28% | 69% | 1%
src0% | 0% | 25% | 63% | 10%
src/components/common0% | 0% | 9% | 56% | 34%
src/components/Auth0% | 0% | 0% | 41% | 58%
src/store/auth0% | 0% | 0% | 65% | 34%
src/store0% | 0% | 0% | 26% | 73%
src/store/config0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function parseQuery()
in src/components/LogViewer/QueryBar.tsx
88 15 1
export function withCollectionState()
in src/components/Firestore/Collection.tsx
53 7 1
function summarizeConstraint()
in src/components/Firestore/DocumentPreview/store.tsx
48 9 2
function summarizeExp()
in src/components/Firestore/DocumentPreview/store.tsx
46 25 2
function truncateRequestPathFromLeft()
in src/components/Firestore/Requests/RequestPath/index.tsx
45 11 4
function NodeTabularDisplay$()
in src/components/Database/DataViewer/NodeTabularDisplay.tsx
42 3 3
export function denormalize()
in src/components/Firestore/DocumentEditor/utils.ts
38 6 2
export function useStorageFiles()
in src/components/Storage/api/useStorageFiles.tsx
36 3 0
export function summarize()
in src/components/Firestore/utils.ts
36 13 2
export function useMissingDocuments()
in src/components/Firestore/FirestoreEmulatedApiProvider.tsx
32 3 1
30 5 1
export function fakeReference()
in src/components/Database/testing/models.ts
26 1 6
26 3 3
function getInspectionExpressions()
in src/components/Firestore/Requests/RequestDetails/index.tsx
25 5 2
export function getDetailsRequestData()
in src/components/Firestore/Requests/RequestDetails/index.tsx
25 2 1
function adjustPayloadForArray()
in src/components/Firestore/DocumentPreview/api.tsx
25 8 3
function realtimeToViewModel()
in src/components/Database/DataViewer/common/fetch.ts
24 4 2
export function useTokens()
in src/components/Storage/api/useTokens.tsx
24 3 1
export function getFieldType()
in src/components/Firestore/utils.ts
24 8 1
async function configFetcher()
in src/components/common/EmulatorConfigProvider.tsx
23 4 1