firebase / firebase-tools
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 6% duplication:
    • 40,856 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,485 duplicated lines
  • 272 duplicates
system6% (2,485 lines)
Duplication per Extension
ts6% (2,224 lines)
js3% (146 lines)
html42% (79 lines)
yaml27% (36 lines)
Duplication per Component (primary)
src/commands9% (508 lines)
src/emulator4% (488 lines)
scripts/storage-emulator-integration29% (305 lines)
scripts25% (274 lines)
src/gcp7% (176 lines)
src/deploy3% (166 lines)
src/init8% (116 lines)
src/extensions3% (102 lines)
src1% (91 lines)
src/management10% (80 lines)
templates70% (55 lines)
scripts/publish35% (36 lines)
src/firestore3% (34 lines)
templates/init23% (24 lines)
standalone1% (12 lines)
templates/extensions32% (12 lines)
src/serve3% (6 lines)
scripts/integration-helpers0% (0 lines)
scripts/firepit-builder0% (0 lines)
scripts/build0% (0 lines)
scripts/assets0% (0 lines)
scripts/test-project0% (0 lines)
templates/setup0% (0 lines)
templates/hosting0% (0 lines)
src/throttler0% (0 lines)
src/remoteconfig0% (0 lines)
src/appdistribution0% (0 lines)
src/hosting0% (0 lines)
src/functions0% (0 lines)
src/database0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 272 duplicates...
Size#FoldersFilesLinesCode
23 x 2 templates
templates
loginSuccess.html
loginSuccessGithub.html
1:27 (92%)
1:27 (92%)
view
23 x 2 scripts/storage-emulator-integration
scripts/storage-emulator-integration
tests.ts
tests.ts
763:788 (2%)
1219:1244 (2%)
view
22 x 2 scripts
scripts
gen-auth-api-spec.ts
gen-auth-api-spec.ts
467:488 (4%)
507:528 (4%)
view
22 x 2 scripts
scripts
gen-auth-api-spec.ts
gen-auth-api-spec.ts
557:578 (4%)
597:618 (4%)
view
22 x 2 scripts
scripts
gen-auth-api-spec.ts
gen-auth-api-spec.ts
320:341 (4%)
360:381 (4%)
view
20 x 2 scripts/storage-emulator-integration
scripts/storage-emulator-integration
tests.ts
tests.ts
399:418 (1%)
502:521 (1%)
view
19 x 2 src/commands
src/commands
ext-dev-deprecate.ts
ext-dev-undeprecate.ts
24:44 (32%)
19:39 (39%)
view
18 x 2 src/gcp
src/gcp
cloudfunctions.ts
run.ts
325:345 (4%)
231:251 (11%)
view
17 x 2 src/firestore
src/firestore
delete.ts
delete.ts
201:221 (5%)
240:260 (5%)
view
17 x 2 src/deploy/extensions
src/deploy/extensions
secrets.ts
secrets.ts
103:119 (9%)
176:192 (9%)
view
16 x 2 scripts
scripts
gen-auth-api-spec.ts
gen-auth-api-spec.ts
513:528 (3%)
563:578 (3%)
view
16 x 2 scripts
scripts
gen-auth-api-spec.ts
gen-auth-api-spec.ts
513:528 (3%)
603:618 (3%)
view
16 x 2 scripts
scripts
gen-auth-api-spec.ts
gen-auth-api-spec.ts
473:488 (3%)
603:618 (3%)
view
16 x 2 scripts
scripts
gen-auth-api-spec.ts
gen-auth-api-spec.ts
473:488 (3%)
563:578 (3%)
view
15 x 2 src/gcp
src/gcp
cloudfunctions.ts
cloudfunctionsv2.ts
153:168 (3%)
209:224 (4%)
view
15 x 2 src/deploy/extensions
src/deploy/extensions
prepare.ts
prepare.ts
45:59 (16%)
63:77 (16%)
view
15 x 2 scripts
scripts
gen-auth-api-spec.ts
gen-auth-api-spec.ts
495:510 (2%)
585:600 (2%)
view
15 x 2 scripts
scripts
gen-auth-api-spec.ts
gen-auth-api-spec.ts
398:412 (2%)
425:439 (2%)
view
15 x 2 scripts/storage-emulator-integration
scripts/storage-emulator-integration
tests.ts
tests.ts
824:840 (1%)
946:962 (1%)
view
15 x 2 src/commands
src/commands
functions-config-set.ts
functions-config-unset.ts
13:27 (40%)
14:28 (44%)
view
Duplicated Units
The list of top 7 duplicated units.
See data for all 7 unit duplicates...
Size#FoldersFilesLinesCode
16 x 2 src/gcp
src/gcp
cloudfunctionsv2.ts
cloudfunctions.ts
209:225 
153:169 
view
8 x 3 src/gcp
src/gcp
src/database
firedata.ts
rules.ts
metadata.ts
12:21 
12:21 
10:19 
view
8 x 2 src
src
projectUtils.ts
getProjectNumber.ts
85:93 
8:16 
view
7 x 2 src/commands
src/commands
apps-create.ts
apps-create.ts
77:84 
116:123 
view
7 x 2 src/emulator/auth
src/emulator/auth
utils.ts
utils.ts
94:102 
112:119 
view
6 x 2 src
src
utils.ts
utils.ts
578:584 
589:595 
view
6 x 2 src/deploy/functions
src
prepareFunctionsUpload.ts
archiveDirectory.ts
50:56 
168:174 
view