golang / exp
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
  • 8% duplication:
    • 39,237 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,277 duplicated lines
  • 251 duplicates
system8% (3,277 lines)
Duplication per Extension
go8% (3,251 lines)
c1% (26 lines)
Duplication per Component (primary)
shiny7% (1,865 lines)
vulndb43% (472 lines)
vulncheck40% (472 lines)
shootout8% (228 lines)
slices20% (100 lines)
mmap57% (98 lines)
jsonrpc21% (14 lines)
errors<1% (14 lines)
cmd<1% (14 lines)
ebnflint0% (0 lines)
rand0% (0 lines)
utf8string0% (0 lines)
event0% (0 lines)
apidiff0% (0 lines)
internal0% (0 lines)
winfsnotify0% (0 lines)
constraints0% (0 lines)
sumdb0% (0 lines)
maps0% (0 lines)
ebnf0% (0 lines)
ROOT0% (0 lines)
io0% (0 lines)

Duplication Between Components (50+ lines)

G vulncheck vulncheck vulndb vulndb vulncheck--vulndb 944

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 251 duplicates...
Size#FoldersFilesLinesCode
108 x 2 vulncheck/internal/binscan
vulndb/internal/binscan
scan.go
scan.go
33:187 (77%)
32:186 (77%)
view
57 x 2 vulncheck/internal/binscan
vulndb/internal/binscan
exe.go
exe.go
172:248 (30%)
194:270 (28%)
view
57 x 2 vulncheck/internal/binscan
vulndb/internal/binscan
exe.go
exe.go
78:167 (30%)
96:185 (28%)
view
42 x 2 shiny/iconvg
shiny/iconvg
rasterizer.go
upgrade.go
473:537 (11%)
866:930 (5%)
view
39 x 2 vulncheck/internal/binscan
vulndb/internal/binscan
exe.go
exe.go
261:318 (20%)
288:345 (19%)
view
29 x 2 vulncheck/internal/binscan
vulndb/internal/binscan
scan.go
scan.go
194:243 (20%)
193:242 (20%)
view
29 x 2 shootout
shootout
regex-dna-parallel.go
regex-dna.go
48:82 (48%)
47:81 (61%)
view
28 x 2 mmap
mmap
mmap_unix.go
mmap_windows.go
56:100 (51%)
54:98 (46%)
view
23 x 2 shootout
shootout
k-nucleotide-parallel.go
k-nucleotide.go
50:83 (29%)
51:84 (36%)
view
23 x 2 shiny/driver/windriver
shiny/driver/x11driver
buffer.go
buffer.go
51:86 (44%)
62:97 (22%)
view
22 x 2 vulncheck
vulndb/internal/audit
vulncheck.go
detect.go
262:298 (11%)
184:218 (13%)
view
21 x 2 shiny/driver/gldriver
shiny/example/basicgl
gldriver.go
main.go
61:85 (28%)
130:154 (14%)
view
18 x 2 slices
slices
zsortfunc.go
zsortordered.go
278:303 (10%)
280:305 (10%)
view
18 x 2 shiny/driver/internal/win32
shiny/driver/windriver
syscall_windows.go
syscall_windows.go
73:92 (16%)
84:103 (18%)
view
18 x 2 vulncheck
vulndb/internal/audit
entries.go
detect_callgraph.go
13:49 (100%)
108:144 (11%)
view
18 x 2 shootout
shootout
binary-tree-freelist.go
binary-tree.go
93:120 (32%)
60:87 (60%)
view
18 x 2 shiny/materialdesign/icons
shiny/materialdesign/icons
data.go
data.go
7185:7202 (<1%)
7216:7233 (<1%)
view
18 x 2 shootout
shootout
k-nucleotide-parallel.go
k-nucleotide.go
105:129 (22%)
106:130 (28%)
view
17 x 2 vulncheck
vulndb/internal/audit
vulncheck.go
detect.go
362:386 (8%)
265:289 (10%)
view
16 x 2 vulncheck
vulndb/internal/audit
vulncheck.go
detect.go
330:357 (8%)
233:260 (9%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 33 unit duplicates...
Size#FoldersFilesLinesCode
72 x 2 vulndb/internal/binscan
vulncheck/internal/binscan
scan.go
scan.go
94:170 
95:171 
view
43 x 2 vulndb/internal/binscan
vulncheck/internal/binscan
exe.go
exe.go
131:182 
113:164 
view
36 x 2 vulndb/internal/binscan
vulncheck/internal/binscan
scan.go
scan.go
36:76 
37:77 
view
30 x 2 vulndb/internal/audit
vulncheck
detect.go
vulncheck.go
182:219 
260:299 
view
30 x 2 vulncheck
vulndb/internal/audit
vulncheck.go
detect.go
260:299 
182:219 
view
27 x 2 vulndb/internal/audit
vulncheck
detect.go
vulncheck.go
232:261 
329:358 
view
25 x 2 vulndb/internal/audit
vulncheck
detect.go
vulncheck.go
264:290 
361:387 
view
25 x 2 shiny/example/basicgl
shiny/driver/gldriver
main.go
gldriver.go
129:155 
60:86 
view
23 x 2 vulndb/internal/binscan
vulncheck/internal/binscan
exe.go
exe.go
288:311 
261:284 
view
21 x 2 vulndb/internal/audit
vulncheck
detect_callgraph.go
entries.go
108:135 
13:40 
view
19 x 2 vulndb/internal/binscan
vulncheck/internal/binscan
exe.go
exe.go
223:243 
201:221 
view
17 x 2 vulndb/internal/binscan
vulncheck/internal/binscan
exe.go
exe.go
204:221 
182:199 
view
16 x 2 vulndb/internal/audit
vulncheck
detect.go
vulncheck.go
164:180 
301:317 
view
16 x 2 vulndb/internal/audit
vulncheck
utils.go
utils.go
172:188 
174:190 
view
16 x 2 vulndb/internal/binscan
vulncheck/internal/binscan
exe.go
exe.go
96:112 
78:94 
view
15 x 2 vulndb/internal/binscan
vulncheck/internal/binscan
exe.go
exe.go
331:346 
304:319 
view
15 x 2 vulndb/internal/binscan
vulncheck/internal/binscan
scan.go
scan.go
172:187 
173:188 
view
14 x 2 vulndb/internal/binscan
vulncheck/internal/binscan
exe.go
exe.go
313:329 
286:302 
view
13 x 3 shiny/driver/x11driver
shiny/driver/x11driver
shiny/driver/windriver
buffer.go
buffer_fallback.go
buffer.go
46:66 
38:58 
35:55 
view
12 x 2 vulndb/internal/audit
vulncheck
detect.go
vulncheck.go
293:305 
390:402 
view