firebase / snippets-web
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
  • 53% duplication:
    • 8,681 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 4,685 duplicated lines
  • 512 duplicates
system53% (4,685 lines)
Duplication per Extension
js54% (4,685 lines)
Duplication per Component (primary)
snippets79% (1,783 lines)
auth-next69% (891 lines)
firestore-next48% (465 lines)
auth36% (443 lines)
firestore21% (205 lines)
storage-next65% (201 lines)
database-next61% (152 lines)
analytics-next75% (149 lines)
analytics58% (97 lines)
storage23% (62 lines)
database30% (55 lines)
messaging-next64% (44 lines)
appcheck-next69% (39 lines)
messaging58% (32 lines)
functions-next45% (23 lines)
appcheck42% (17 lines)
firebaseapp-next38% (14 lines)
perf-next31% (13 lines)
scripts0% (0 lines)
ROOT0% (0 lines)
remoteconfig0% (0 lines)
installations0% (0 lines)
functions0% (0 lines)
perf0% (0 lines)
firebaseapp0% (0 lines)
remoteconfig-next0% (0 lines)

Duplication Between Components (50+ lines)

G auth-next auth-next snippets snippets auth-next--snippets 1648 auth auth auth-next--auth 458 storage-next storage-next snippets--storage-next 400 storage storage snippets--storage 90 firestore-next firestore-next firestore-next--snippets 680 firestore firestore firestore-next--firestore 282 auth--snippets 284 storage-next--storage 92 analytics-next analytics-next analytics-next--snippets 296 analytics analytics analytics-next--analytics 194 firestore--snippets 102 database-next database-next database-next--snippets 282 database database database-next--database 78 analytics--snippets 192 messaging-next messaging-next messaging-next--snippets 84 messaging messaging messaging-next--messaging 64 appcheck-next appcheck-next appcheck-next--snippets 78 database--snippets 50 messaging--snippets 60

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 512 duplicates...
Size#FoldersFilesLinesCode
53 x 2 auth-next
snippets/auth-next/service-worker-sessions
service-worker-sessions.js
auth_svc_intercept.js
61:134 (53%)
8:81 (100%)
view
52 x 2 auth-next
auth
service-worker-sessions.js
service-worker-sessions.js
57:129 (52%)
53:125 (55%)
view
51 x 2 auth
snippets/auth-next/service-worker-sessions
service-worker-sessions.js
auth_svc_intercept.js
57:125 (54%)
8:76 (96%)
view
43 x 2 firestore-next
snippets/firestore-next/test-firestore
test.firestore.js
fs_collection_group_query_data_setup.js
1100:1143 (5%)
10:53 (100%)
view
35 x 2 snippets/storage-next/upload-files
storage-next
storage_upload_handle_error.js
upload-files.js
10:61 (100%)
184:235 (28%)
view
25 x 2 snippets/storage-next/upload-files
storage-next
storage_monitor_upload.js
upload-files.js
10:44 (100%)
139:173 (20%)
view
25 x 2 analytics-next
analytics
ecommerce.js
ecommerce.js
6:36 (15%)
6:36 (17%)
view
24 x 2 analytics
snippets/analytics-next/ecommerce
ecommerce.js
analytics_ecommerce_items.js
6:33 (16%)
9:36 (100%)
view
24 x 2 analytics-next
snippets/analytics-next/ecommerce
ecommerce.js
analytics_ecommerce_items.js
6:33 (14%)
9:36 (100%)
view
23 x 2 firestore-next
firestore
test.solution-arrays.js
test.solution-arrays.js
4:46 (41%)
4:46 (45%)
view
23 x 2 auth-next
snippets/auth-next/link-multiple-accounts
link-multiple-accounts.js
auth_merge_accounts.js
118:156 (23%)
11:49 (100%)
view
22 x 2 auth-next
snippets/auth-next/custom-email-handler
custom-email-handler.js
auth_handle_mgmt_query_params.js
16:54 (41%)
11:49 (100%)
view
21 x 2 firestore-next
snippets/firestore-next/test-solution-geoqueries
test.solution-geoqueries.js
fs_geo_query_hashes.js
37:69 (35%)
11:43 (100%)
view
21 x 2 firestore-next
snippets/firestore-next/test-firestore
test.firestore.js
delete_collection.js
360:393 (2%)
14:47 (100%)
view
21 x 2 firestore-next
snippets/firestore-next/test-firestore
test.firestore.js
example_data.js
406:427 (2%)
10:31 (100%)
view
21 x 2 auth-next
snippets/auth-next/multi-tenancy
multi-tenancy.js
multitenant_account_exists_redirect.js
306:345 (13%)
11:50 (100%)
view
19 x 2 auth-next
snippets/auth-next/facebook
facebook.js
auth_facebook_callback.js
85:116 (22%)
9:40 (100%)
view
19 x 2 firestore-next
snippets/firestore-next/test-firestore
test.firestore.js
city_custom_object.js
7:31 (2%)
8:32 (100%)
view
18 x 2 snippets/storage-next/upload-files
storage-next
storage_upload_string.js
upload-files.js
10:35 (100%)
58:83 (14%)
view
18 x 2 auth-next
snippets/auth-next/multi-tenancy
multi-tenancy.js
multitenant_account_exists_popup.js
265:297 (11%)
11:43 (100%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 22 unit duplicates...
Size#FoldersFilesLinesCode
20 x 2 snippets/auth-next/facebook
auth-next
auth_facebook_callback.js
facebook.js
11:42 
87:118 
view
18 x 2 firestore-next
snippets/firestore-next/test-firestore
test.firestore.js
delete_collection.js
368:394 
22:48 
view
18 x 2 snippets/database-next/read-and-write
database-next
rtdb_social_star_transaction.js
read-and-write.js
10:29 
133:152 
view
17 x 2 snippets/auth-next/google-signin
auth-next
auth_google_callback.js
google-signin.js
11:37 
108:136 
view
15 x 3 auth
auth
auth
github.js
google-signin.js
facebook.js
57:84 
51:77 
54:80 
view
15 x 2 snippets/database-next/read-and-write
database-next
rtdb_social_write_fan_out.js
read-and-write.js
8:30 
80:102 
view
14 x 2 firestore-next
snippets/firestore-next/test-firestore
test.firestore.js
add_rating_transaction.js
1172:1191 
15:34 
view
11 x 2 snippets/auth-next/google-signin
auth-next
auth_google_checksameuser.js
google-signin.js
10:22 
144:156 
view
11 x 2 snippets/auth-next/facebook
auth-next
auth_facebook_checksameuser.js
facebook.js
10:22 
126:138 
view
11 x 2 snippets/auth-next/custom-email-handler
auth-next
auth_handle_recover_email.js
custom-email-handler.js
10:36 
98:124 
view
10 x 2 storage-next
snippets/storage-next/list-files
list-files.js
storage_list_paginate.js
33:54 
10:31 
view
10 x 2 auth-next
auth-next
link-multiple-accounts.js
link-multiple-accounts.js
38:51 
53:66 
view
9 x 2 auth
auth-next
multi-tenancy.js
multi-tenancy.js
176:191 
199:214 
view
9 x 2 snippets/auth-next/custom-email-handler
auth-next
auth_handle_reset_password.js
custom-email-handler.js
10:41 
61:92 
view
8 x 2 auth
auth
link-multiple-accounts.js
link-multiple-accounts.js
41:51 
53:63 
view
8 x 2 messaging
messaging-next
index.js
index.js
45:57 
51:63 
view
7 x 2 firestore-next
snippets/firestore-next/test-firestore
test.firestore.js
transaction.js
529:537 
11:19 
view
7 x 2 perf-next
snippets/perf-next/index
index.js
perf_add_custom_metrics.js
97:109 
10:22 
view
10 x 2 auth
auth-next
phone-auth.js
phone-auth.js
82:101 
94:114 
view
7 x 2 snippets/database-next/read-and-write
database-next
rtdb_write_new_user.js
read-and-write.js
10:17 
8:15 
view