firebase / firebaseopensource.com
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 68 units with 902 lines of code in units (25.0% of code).
    • 1 very long units (117 lines of code)
    • 2 long units (126 lines of code)
    • 5 medium size units (156 lines of code)
    • 17 small units (266 lines of code)
    • 43 very small units (237 lines of code)
12% | 13% | 17% | 29% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts13% | 8% | 18% | 31% | 27%
js0% | 95% | 0% | 0% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
functions/src18% | 10% | 13% | 30% | 26%
frontend0% | 100% | 0% | 0% | 0%
frontend/assets0% | 0% | 42% | 32% | 25%
shared0% | 0% | 0% | 47% | 52%
frontend/plugins0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private sanitizeHtml()
in functions/src/content.ts
117 13 5
getProjectConfig()
in functions/src/project.ts
68 8 1
export default async()
in frontend/nuxt.config.js
58 3 0
export default async function()
in frontend/assets/getRoutes.ts
47 8 0
private htmlToSections()
in functions/src/content.ts
29 1 1
async storeProjectContent()
in functions/src/project.ts
27 5 2
arraysToMaps()
in functions/src/project.ts
27 6 2
function splitWords()
in frontend/assets/utils.ts
26 12 1
filterProjectSections()
in functions/src/project.ts
20 4 1
static parseProjectId()
in shared/util.ts
18 3 1
name: $()
in functions/src/content.ts
18 3 1
inferPlatforms()
in functions/src/project.ts
18 3 1
getProjectContent()
in functions/src/project.ts
18 1 2
lowercaseMapKeys()
in functions/src/project.ts
18 5 1
export async function getProjectConfigs()
in frontend/assets/dbUtils.ts
17 3 2
static async loadGlobalConfig()
in functions/src/config.ts
16 3 0
public static async build()
in functions/src/cron.ts
16 1 0
async storeProjectReleases()
in functions/src/project.ts
15 5 1
private sanitizeRelativeLink()
in functions/src/content.ts
14 3 3
async listAllProjectIds()
in functions/src/project.ts
14 1 0