golang / build
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
  • 5% duplication:
    • 49,282 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,589 duplicated lines
  • 834 duplicates
system5% (2,589 lines)
Duplication per Extension
go4% (1,949 lines)
yaml37% (339 lines)
html16% (122 lines)
bash12% (91 lines)
ps126% (76 lines)
x4% (12 lines)
Duplication per Component (primary)
cmd4% (809 lines)
internal7% (764 lines)
maintner3% (280 lines)
dashboard11% (262 lines)
env14% (202 lines)
devapp3% (94 lines)
deploy34% (57 lines)
gerrit5% (41 lines)
buildlet2% (30 lines)
version6% (26 lines)
revdial4% (12 lines)
kubernetes<1% (12 lines)
buildenv0% (0 lines)
livelog0% (0 lines)
app0% (0 lines)
autocertcache0% (0 lines)
types0% (0 lines)
cloudfns0% (0 lines)
vcs-test0% (0 lines)
pargzip0% (0 lines)
repos0% (0 lines)
ROOT0% (0 lines)
tarutil0% (0 lines)

Duplication Between Components (50+ lines)

G cmd cmd devapp devapp cmd--devapp 167 internal internal cmd--internal 141 maintner maintner cmd--maintner 55 version version internal--version 52

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 834 duplicates...
Size#FoldersFilesLinesCode
21 x 2 internal/relui/db
internal/relui/db
workflows.sql.go
workflows.sql.go
265:289 (6%)
408:432 (6%)
view
20 x 2 internal/relui/db
internal/relui/db
workflows.sql.go
workflows.sql.go
196:219 (5%)
231:254 (5%)
view
19 x 2 cmd/gitmirror
cmd/gitmirror
deployment-mirroring.yaml
deployment-serving.yaml
31:49 (38%)
34:52 (36%)
view
19 x 2 internal/relui/db
internal/relui/db
workflows.sql.go
workflows.sql.go
123:145 (5%)
163:185 (5%)
view
19 x 2 internal/relui/db
internal/relui/db
workflows.sql.go
workflows.sql.go
32:50 (5%)
316:334 (5%)
view
19 x 2 internal/buildstats
internal/buildstats
buildstats.go
buildstats.go
145:169 (6%)
283:307 (6%)
view
19 x 2 internal/untar
version
untar.go
version.go
64:91 (26%)
339:366 (5%)
view
18 x 2 env/plan9
env/plan9
make.bash
make.bash
272:297 (7%)
318:343 (7%)
view
17 x 2 env/netbsd-386
env/netbsd-amd64
make.bash
make.bash
19:43 (70%)
19:43 (70%)
view
17 x 2 cmd/buildlet
internal/untar
buildlet.go
untar.go
785:807 (1%)
72:94 (23%)
view
16 x 2 cmd/coordinator
cmd/coordinator
builders.go
status.go
75:90 (18%)
794:809 (2%)
view
16 x 2 dashboard
dashboard
builders.go
builders.go
2047:2064 (<1%)
2067:2084 (<1%)
view
16 x 2 dashboard
dashboard
builders.go
builders.go
2047:2064 (<1%)
2087:2104 (<1%)
view
16 x 2 dashboard
dashboard
builders.go
builders.go
2067:2084 (<1%)
2087:2104 (<1%)
view
15 x 2 cmd/coordinator
cmd/coordinator
deployment-prod.yaml
service-staging.yaml
42:56 (16%)
4:18 (78%)
view
15 x 2 cmd/gitmirror
cmd/gitmirror
gitmirror.go
gitmirror_linux.go
720:738 (3%)
23:41 (62%)
view
15 x 2 cmd/buildlet
version
buildlet.go
version.go
785:804 (1%)
347:366 (4%)
view
15 x 2 env/windows-arm64
env/windows
startup.ps1
startup.ps1
140:156 (11%)
156:172 (9%)
view
14 x 2 internal/relui/db
internal/relui/db
workflows.sql.go
workflows.sql.go
99:112 (4%)
380:393 (4%)
view
14 x 2 devapp
devapp
deployment-prod.yaml
deployment-staging.yaml
5:18 (18%)
4:17 (40%)
view
Duplicated Units
The list of top 12 duplicated units.
See data for all 12 unit duplicates...
Size#FoldersFilesLinesCode
12 x 2 cmd/coordinator
cmd/coordinator
status.go
status.go
400:412 
414:426 
view
11 x 2 cmd/buildlet
cmd/gomote
buildlet.go
push.go
1573:1584 
376:387 
view
11 x 3 cmd/coordinator
internal/coordinator/schedule
internal/coordinator/pool
status.go
span.go
pool.go
751:762 
96:107 
53:64 
view
11 x 2 internal/task
internal/task
tweet.go
tweet.go
96:108 
112:124 
view
10 x 2 cmd/coordinator/internal/dashboard
cmd/coordinator/internal/legacydash
handler.go
ui.go
279:289 
192:202 
view
9 x 2 cmd/buildlet
internal/untar
buildlet.go
untar.go
523:532 
125:134 
view
7 x 2 cmd/retrybuilds
cmd/genbuilderkey
retrybuilds.go
genbuilderkey.go
369:376 
70:77 
view
7 x 2 cmd/gopherbot
cmd/gopherbot
gopherbot.go
gopherbot.go
1045:1052 
1054:1061 
view
7 x 2 dashboard
dashboard
builders.go
builders.go
2814:2821 
2836:2843 
view
6 x 2 cmd/coordinator
internal/coordinator/pool
coordinator.go
pool.go
2024:2030 
45:51 
view
6 x 2 version
internal/task
version.go
tweet.go
528:534 
406:412 
view
6 x 2 dashboard
dashboard
builders.go
builders.go
2804:2810 
2827:2833 
view