opensearch-project / opensearch-js
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
  • 25% duplication:
    • 5,670 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,441 duplicated lines
  • 2,901 duplicates
system25% (1,441 lines)
Duplication per Extension
js25% (1,441 lines)
Duplication per Component (primary)
api/api53% (1,237 lines)
scripts/utils13% (140 lines)
lib5% (64 lines)
lib/pool0% (0 lines)
api0% (0 lines)
ROOT0% (0 lines)
scripts0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 2,901 duplicates...
Size#FoldersFilesLinesCode
19 x 2 scripts/utils
scripts/utils
generateApis.js
generateMain.js
76:95 (5%)
178:197 (9%)
view
18 x 2 scripts/utils
scripts/utils
generateMain.js
generateRequestTypes.js
178:195 (8%)
50:67 (13%)
view
18 x 2 scripts/utils
scripts/utils
generateApis.js
generateRequestTypes.js
76:93 (4%)
50:67 (13%)
view
14 x 2 api/api
api/api
create.js
update.js
41:61 (45%)
41:61 (45%)
view
13 x 2 lib
lib
Connection.js
Connection.js
254:267 (5%)
272:285 (5%)
view
13 x 2 api/api
api/api
snapshot.js
snapshot.js
189:210 (5%)
343:364 (5%)
view
13 x 2 api/api
api/api
snapshot.js
snapshot.js
121:142 (5%)
189:210 (5%)
view
13 x 2 api/api
api/api
snapshot.js
snapshot.js
189:210 (5%)
253:274 (5%)
view
13 x 2 scripts/utils
scripts/utils
generateMain.js
generateMain.js
49:62 (6%)
81:94 (6%)
view
13 x 2 api/api
api/api
snapshot.js
snapshot.js
121:142 (5%)
253:274 (5%)
view
13 x 2 api/api
api/api
snapshot.js
snapshot.js
121:142 (5%)
343:364 (5%)
view
13 x 2 api/api
api/api
snapshot.js
snapshot.js
253:274 (5%)
343:364 (5%)
view
12 x 2 api/api
api/api
mget.js
search_template.js
41:60 (38%)
41:60 (38%)
view
12 x 2 api/api
api/api
get.js
get_source.js
41:58 (42%)
41:58 (42%)
view
12 x 2 api/api
api/api
msearch_template.js
search_template.js
41:60 (38%)
41:60 (38%)
view
12 x 2 api/api
api/api
mget.js
msearch_template.js
41:60 (38%)
41:60 (38%)
view
12 x 2 api/api
api/api
mget.js
msearch.js
41:60 (38%)
41:60 (38%)
view
12 x 2 api/api
api/api
msearch.js
search_template.js
41:60 (38%)
41:60 (38%)
view
12 x 2 api/api
api/api
msearch.js
msearch_template.js
41:60 (38%)
41:60 (38%)
view
11 x 2 api/api
api/api
bulk.js
search_template.js
41:59 (35%)
41:59 (35%)
view
Duplicated Units
The list of top 8 duplicated units.
See data for all 8 unit duplicates...
Size#FoldersFilesLinesCode
31 x 2 api/api
api/api
create.js
update.js
40:78 
40:78 
view
27 x 2 api/api
api/api
get.js
exists.js
40:74 
40:74 
view
26 x 2 api/api
api/api
count.js
mtermvectors.js
40:73 
40:73 
view
22 x 3 api/api
api/api
api/api
reindex_rethrottle.js
update_by_query_rethrottle.js
delete_by_query_rethrottle.js
40:69 
40:69 
40:69 
view
19 x 2 api/api
api/api
field_caps.js
search_shards.js
40:64 
40:64 
view
14 x 2 api/api
api/api
get_script_context.js
get_script_languages.js
40:59 
40:59 
view
14 x 2 api/api
api/api
ping.js
info.js
40:59 
40:59 
view
9 x 2 lib
lib
Helpers.js
Helpers.js
342:351 
626:635 
view