firebase / superstatic
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 67 units with 1,052 lines of code in units (84.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (85 lines of code)
    • 15 medium size units (497 lines of code)
    • 18 small units (264 lines of code)
    • 33 very small units (206 lines of code)
0% | 8% | 47% | 25% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 8% | 45% | 25% | 20%
ts0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/middleware0% | 16% | 38% | 28% | 15%
src0% | 0% | 38% | 24% | 36%
src/providers0% | 0% | 80% | 15% | 3%
src/cli0% | 0% | 73% | 18% | 7%
src/loaders0% | 0% | 100% | 0% | 0%
src/utils0% | 0% | 0% | 50% | 50%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
module.exports = function()
in src/middleware/files.js
85 17 0
const superstatic = function()
in src/superstatic.js
50 11 1
Redirect.prototype.test = function()
in src/middleware/redirects.js
48 12 1
module.exports = function()
in src/providers/fs.js
46 11 1
function providerResult()
in src/middleware/files.js
44 8 3
35 9 2
module.exports = function()
in src/cli/server.js
34 3 3
module.exports = function()
in src/cli/flags.js
33 1 3
module.exports = function()
in src/loaders/config-file.js
32 11 1
function getI18nLanguages()
in src/middleware/files.js
28 7 1
module.exports = function()
in src/middleware/redirects.js
28 5 0
export function env()
in src/middleware/env.ts
27 7 1
module.exports = function()
in src/middleware/missing.js
24 4 1
function _fetchEtag()
in src/providers/fs.js
24 3 2
const multiStat = function()
in src/providers/fs.js
22 3 1
22 9 1
redirect: normalizeRedirectPath()
in src/middleware/files.js
19 5 1
const Redirect = function()
in src/middleware/redirects.js
18 5 4
const fn = function()
in src/providers/memory.js
18 3 2
18 4 1