bazelbuild / rules_rust
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:
    • 17,670 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,479 duplicated lines
  • 450 duplicates
system8% (1,479 lines)
Duplication per Extension
bzl6% (822 lines)
rs16% (643 lines)
cc2% (14 lines)
Duplication per Component (primary)
rust/private9% (410 lines)
tools/rust_analyzer29% (387 lines)
crate_universe/src10% (170 lines)
proto17% (114 lines)
cargo/private44% (71 lines)
crate_universe/private43% (59 lines)
util/label11% (40 lines)
bindgen12% (38 lines)
rust<1% (32 lines)
rust/platform7% (30 lines)
wasm_bindgen13% (30 lines)
tools/rustdoc16% (24 lines)
cargo/cargo_build_script_runner4% (18 lines)
util/process_wrapper2% (14 lines)
tools/runfiles9% (12 lines)
proto/raze1% (8 lines)
bindgen/raze1% (8 lines)
wasm_bindgen/raze<1% (8 lines)
cargo<1% (6 lines)
ROOT0% (0 lines)
rust/settings0% (0 lines)
util/dir_zipper0% (0 lines)
tools0% (0 lines)
tools/rustfmt0% (0 lines)
tools/clippy0% (0 lines)
crate_universe0% (0 lines)
cargo/bootstrap0% (0 lines)

Duplication Between Components (50+ lines)

G proto proto rust/private rust/private proto--rust/private 134 rust rust proto--rust 72 wasm_bindgen wasm_bindgen proto--wasm_bindgen 67 rust/private--wasm_bindgen 118 rust--rust/private 120 cargo/private cargo/private crate_universe/private crate_universe/private cargo/private--crate_universe/private 118 bindgen bindgen bindgen--proto 91 bindgen--rust/private 118 bindgen--wasm_bindgen 60

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 450 duplicates...
Size#FoldersFilesLinesCode
50 x 2 cargo/private
crate_universe/private
cargo_utils.bzl
util.bzl
6:65 (31%)
10:69 (40%)
view
50 x 2 tools/rust_analyzer
tools/rust_analyzer
aquery.rs
aquery.rs
261:313 (9%)
371:423 (9%)
view
42 x 2 tools/rust_analyzer
tools/rust_analyzer
aquery.rs
aquery.rs
206:247 (8%)
330:371 (8%)
view
35 x 2 tools/rust_analyzer
tools/rust_analyzer
aquery.rs
aquery.rs
274:308 (6%)
337:371 (6%)
view
35 x 2 tools/rust_analyzer
tools/rust_analyzer
aquery.rs
aquery.rs
213:247 (6%)
384:418 (6%)
view
35 x 2 tools/rust_analyzer
tools/rust_analyzer
aquery.rs
aquery.rs
213:247 (6%)
274:308 (6%)
view
35 x 2 tools/rust_analyzer
tools/rust_analyzer
aquery.rs
aquery.rs
337:371 (6%)
384:418 (6%)
view
24 x 2 proto
proto
proto.bzl
proto.bzl
303:326 (6%)
381:404 (6%)
view
16 x 2 bindgen
wasm_bindgen
repositories.bzl
repositories.bzl
1:17 (21%)
1:17 (45%)
view
15 x 2 bindgen
proto
repositories.bzl
repositories.bzl
2:17 (20%)
2:17 (28%)
view
15 x 2 proto
wasm_bindgen
repositories.bzl
repositories.bzl
2:17 (28%)
2:17 (42%)
view
15 x 2 crate_universe/src
crate_universe/src
testing.rs
testing.rs
31:45 (12%)
95:109 (12%)
view
15 x 2 tools/rust_analyzer
tools/rust_analyzer
aquery.rs
aquery.rs
239:253 (2%)
436:450 (2%)
view
15 x 2 tools/rust_analyzer
tools/rust_analyzer
aquery.rs
aquery.rs
472:486 (2%)
506:520 (2%)
view
14 x 2 wasm_bindgen
wasm_bindgen
repositories.bzl
wasm_bindgen.bzl
1:15 (40%)
1:15 (8%)
view
14 x 2 bindgen
wasm_bindgen
bindgen.bzl
wasm_bindgen.bzl
1:15 (5%)
1:15 (8%)
view
14 x 2 tools/rust_analyzer
tools/rust_analyzer
aquery.rs
aquery.rs
248:261 (2%)
316:329 (2%)
view
14 x 2 bindgen
wasm_bindgen
bindgen.bzl
repositories.bzl
1:15 (5%)
1:15 (40%)
view
14 x 2 bindgen
wasm_bindgen
repositories.bzl
wasm_bindgen.bzl
1:15 (18%)
1:15 (8%)
view
14 x 2 proto
rust/private
repositories.bzl
rustc.bzl
1:15 (26%)
1:15 (1%)
view