bazelbuild / bazel-gazelle
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:
    • 16,522 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 370 duplicated lines
  • 69 duplicates
system2% (370 lines)
Duplication per Extension
go1% (220 lines)
bzl7% (150 lines)
Duplication per Component (primary)
language1% (145 lines)
internal7% (110 lines)
rule3% (52 lines)
ROOT5% (28 lines)
cmd1% (22 lines)
repo2% (13 lines)
merger0% (0 lines)
pathtools0% (0 lines)
flag0% (0 lines)
resolve0% (0 lines)
label0% (0 lines)
testtools0% (0 lines)
walk0% (0 lines)
config0% (0 lines)

Duplication Between Components (50+ lines)

G ROOT ROOT internal internal ROOT--internal 111 language language internal--language 96

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 69 duplicates...
Size#FoldersFilesLinesCode
16 x 2 language/go
language/go
kinds.go
kinds.go
50:65 (9%)
138:153 (9%)
view
15 x 2 internal
internal
go_repository_config.bzl
go_repository_tools.bzl
1:16 (24%)
1:16 (11%)
view
14 x 2 internal
internal
go_repository.bzl
go_repository_config.bzl
2:16 (3%)
2:16 (22%)
view
14 x 2 ROOT
ROOT
def.bzl
deps.bzl
1:15 (10%)
1:15 (3%)
view
14 x 2 internal
internal
go_repository.bzl
go_repository_tools.bzl
2:16 (3%)
2:16 (10%)
view
13 x 2 ROOT
internal
deps.bzl
gazelle_binary.bzl
2:15 (3%)
2:15 (11%)
view
13 x 2 internal
internal
go_repository_cache.bzl
go_repository_tools.bzl
1:13 (10%)
1:13 (10%)
view
13 x 2 internal
internal
go_repository_cache.bzl
go_repository_config.bzl
1:13 (10%)
1:13 (21%)
view
13 x 2 ROOT
internal
def.bzl
gazelle_binary.bzl
2:15 (9%)
2:15 (11%)
view
13 x 2 internal
internal
gazelle_binary.bzl
overlay_repository.bzl
1:13 (11%)
1:13 (8%)
view
12 x 2 internal
internal
go_repository_config.bzl
overlay_repository.bzl
2:13 (19%)
2:13 (7%)
view
12 x 2 ROOT
language/proto/gen
deps.bzl
def.bzl
2:13 (3%)
2:13 (25%)
view
12 x 2 internal
internal
common.bzl
overlay_repository.bzl
2:13 (33%)
2:13 (7%)
view
12 x 2 ROOT
internal
deps.bzl
go_repository.bzl
2:13 (3%)
2:13 (2%)
view
12 x 2 internal
internal
go_repository_tools.bzl
overlay_repository.bzl
2:13 (9%)
2:13 (7%)
view
12 x 2 ROOT
internal
def.bzl
go_repository.bzl
2:13 (8%)
2:13 (2%)
view
12 x 2 internal
internal
gazelle_binary.bzl
go_repository_config.bzl
2:13 (10%)
2:13 (19%)
view
12 x 2 internal
internal
common.bzl
go_repository_config.bzl
2:13 (33%)
2:13 (19%)
view
12 x 2 ROOT
language/proto/gen
def.bzl
def.bzl
2:13 (8%)
2:13 (25%)
view
12 x 2 ROOT
internal
def.bzl
go_repository_tools.bzl
2:13 (8%)
2:13 (9%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
12 x 2 language/proto
language/go
resolve.go
resolve.go
143:155 
350:362 
view
9 x 2 repo
language/go
remote.go
modules.go
581:590 
182:191 
view