bazelbuild / examples
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
  • 4% duplication:
    • 1,429 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 65 duplicated lines
  • 6 duplicates
system4% (65 lines)
Duplication per Extension
bzl3% (38 lines)
cc47% (27 lines)
Duplication per Component (primary)
rules/runfiles5% (12 lines)
rules/starlark_configurations2% (12 lines)
cpp-tutorial/stage276% (10 lines)
cpp-tutorial/stage183% (10 lines)
cpp-tutorial/stage350% (7 lines)
rules/mandatory_provider28% (7 lines)
rules/optional_provider28% (7 lines)
tutorial/backend0% (0 lines)
tutorial/ios-app0% (0 lines)
tutorial/android0% (0 lines)
third-party-dependencies0% (0 lines)
java-maven/src0% (0 lines)
flags-parsing-tutorial0% (0 lines)
java-tutorial/src0% (0 lines)
rules/aspect0% (0 lines)
rules/actions_write0% (0 lines)
rules/expand_template0% (0 lines)
rules/implicit_output0% (0 lines)
rules/predeclared_outputs0% (0 lines)
rules/empty0% (0 lines)
rules/computed_dependencies0% (0 lines)
rules/executable0% (0 lines)
rules/features0% (0 lines)
rules/shell_command0% (0 lines)
rules/depsets0% (0 lines)
rules/actions_run0% (0 lines)
rules/attributes0% (0 lines)
make-variables/testapp0% (0 lines)
android/tutorial0% (0 lines)
android/ndk0% (0 lines)
android/firebase-cloud-messaging0% (0 lines)
Longest Duplicates
The list of 6 longest duplicates.
See data for all 6 duplicates...
Size#FoldersFilesLinesCode
10 x 2 cpp-tutorial/stage1/main
cpp-tutorial/stage2/main
hello-world.cc
hello-world.cc
9:21 (83%)
6:18 (100%)
view
7 x 2 rules/mandatory_provider
rules/optional_provider
sum.bzl
sum.bzl
15:23 (28%)
16:24 (28%)
view
7 x 2 cpp-tutorial/stage1/main
cpp-tutorial/stage3/main
hello-world.cc
hello-world.cc
14:21 (58%)
6:13 (100%)
view
7 x 2 cpp-tutorial/stage2/main
cpp-tutorial/stage3/main
hello-world.cc
hello-world.cc
11:18 (70%)
6:13 (100%)
view
6 x 2 rules/runfiles
rules/runfiles
complex_tool.bzl
tool.bzl
38:43 (7%)
61:66 (8%)
view
6 x 2 rules/starlark_configura...ng_transitions_to_rules
rules/starlark_configura...ansition_on_native_flag
defs.bzl
defs.bzl
57:62 (9%)
35:40 (15%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
8 x 3 cpp-tutorial/stage2/main
cpp-tutorial/stage3/main
cpp-tutorial/stage1/main
hello-world.cc
hello-world.cc
hello-world.cc
11:19 
6:14 
14:22 
view