GerritCodeReview / zoekt
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
  • 2% duplication:
    • 7,453 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 222 duplicated lines
  • 17 duplicates
system2% (222 lines)
Duplication per Extension
go2% (222 lines)
Duplication per Component (primary)
web6% (51 lines)
ROOT1% (41 lines)
query5% (31 lines)
cmd/zoekt-mirror-github10% (20 lines)
cmd/zoekt-mirror-bitbucket-server13% (20 lines)
shards3% (18 lines)
gitindex3% (18 lines)
cmd/zoekt11% (10 lines)
cmd/zoekt-test7% (7 lines)
cmd/zoekt-repo-index2% (6 lines)
cmd/zoekt-git-index0% (0 lines)
cmd/zoekt-archive-index0% (0 lines)
cmd/zoekt-git-clone0% (0 lines)
cmd/zoekt-mirror-gerrit0% (0 lines)
cmd/zoekt-hg-index0% (0 lines)
cmd/zoekt-webserver0% (0 lines)
cmd/zoekt-mirror-gitiles0% (0 lines)
cmd0% (0 lines)
cmd/zoekt-indexserver0% (0 lines)
cmd/zoekt-index0% (0 lines)
cmd/zoekt-mirror-gitlab0% (0 lines)
ctags0% (0 lines)
build0% (0 lines)
Longest Duplicates
The list of 17 longest duplicates.
See data for all 17 duplicates...
Size#FoldersFilesLinesCode
10 x 2 cmd/zoekt
shards
main.go
shards.go
50:63 (11%)
532:544 (2%)
view
10 x 2 cmd/zoekt-mirror-github
cmd/zoekt-mirror-github
main.go
main.go
241:255 (5%)
263:277 (5%)
view
10 x 2 cmd/zoekt-mirror-bitbucket-server
cmd/zoekt-mirror-bitbucket-server
main.go
main.go
191:208 (6%)
220:237 (6%)
view
8 x 2 ROOT
shards
eval.go
shards.go
396:405 (2%)
372:381 (2%)
view
8 x 2 web
web
templates.go
templates.go
343:350 (2%)
386:394 (2%)
view
8 x 2 web
web
templates.go
templates.go
316:324 (2%)
343:350 (2%)
view
8 x 2 web
web
templates.go
templates.go
274:281 (2%)
348:355 (2%)
view
8 x 2 web
web
templates.go
templates.go
316:324 (2%)
386:394 (2%)
view
7 x 2 web
web
templates.go
templates.go
156:163 (1%)
362:371 (1%)
view
7 x 2 cmd/zoekt-test
query
main.go
bits.go
185:193 (7%)
17:25 (100%)
view
7 x 2 ROOT
ROOT
eval.go
eval.go
101:109 (2%)
400:408 (2%)
view
6 x 2 ROOT
ROOT
bits.go
bits.go
242:247 (3%)
259:264 (3%)
view
6 x 2 gitindex
gitindex
clone.go
index.go
77:84 (15%)
181:188 (2%)
view
6 x 2 query
query
query.go
query.go
363:368 (2%)
371:376 (2%)
view
6 x 2 query
query
query.go
query.go
129:134 (2%)
145:150 (2%)
view
6 x 2 ROOT
ROOT
matchtree.go
matchtree.go
635:641 (1%)
645:651 (1%)
view
6 x 2 cmd/zoekt-repo-index
gitindex
main.go
tree.go
55:62 (2%)
195:202 (5%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
9 x 2 cmd/zoekt-test
query
main.go
bits.go
185:194 
17:26 
view
6 x 2 query
query
query.go
query.go
160:166 
182:188 
view