facebookresearch / beanmachine
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
  • 10% duplication:
    • 31,748 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,307 duplicated lines
  • 500 duplicates
system10% (3,307 lines)
Duplication per Extension
py11% (2,526 lines)
h17% (400 lines)
cpp3% (224 lines)
pyi39% (145 lines)
js4% (12 lines)
Duplication per Component (primary)
src/beanmachine/ppl10% (1,811 lines)
src/beanmachine/graph8% (769 lines)
src/beanmachine/tutorials30% (679 lines)
src/beanmachine/applications1% (24 lines)
scripts3% (12 lines)
website/src/pages9% (12 lines)
ROOT0% (0 lines)
website0% (0 lines)
website/src/css0% (0 lines)
website/src/components0% (0 lines)
sphinx/source0% (0 lines)
src/beanmachine0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 500 duplicates...
Size#FoldersFilesLinesCode
57 x 2 src/beanmachine/tutorials/utils
src/beanmachine/tutorials/utils
baseball.py
baseball.py
450:517 (9%)
671:737 (9%)
view
33 x 2 src/beanmachine/tutorials/utils
src/beanmachine/tutorials/utils
baseball.py
baseball.py
253:292 (5%)
492:531 (5%)
view
32 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
gamma.h
student_t.h
20:54 (74%)
20:54 (66%)
view
30 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
bernoulli.h
categorical.h
21:53 (76%)
21:53 (76%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
bernoulli_logit.h
bernoulli_noisy_or.h
20:50 (74%)
24:52 (76%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
half_cauchy.h
half_normal.h
20:50 (72%)
20:50 (74%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
half_normal.h
normal.h
20:50 (74%)
20:50 (72%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
half_cauchy.h
normal.h
20:50 (72%)
20:50 (72%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
half_cauchy.h
student_t.h
20:50 (72%)
20:50 (60%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
gamma.h
half_cauchy.h
20:50 (67%)
20:50 (72%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
bernoulli.h
bernoulli_logit.h
20:50 (74%)
20:50 (74%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
half_normal.h
student_t.h
20:50 (74%)
20:50 (60%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
gamma.h
normal.h
20:50 (67%)
20:50 (72%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
bernoulli.h
bernoulli_noisy_or.h
20:50 (74%)
24:52 (76%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
gamma.h
half_normal.h
20:50 (67%)
20:50 (74%)
view
29 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
normal.h
student_t.h
20:50 (72%)
20:50 (60%)
view
28 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
bernoulli_noisy_or.h
categorical.h
25:52 (73%)
21:50 (71%)
view
28 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
bimixture.h
normal.h
28:57 (65%)
21:50 (70%)
view
28 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
bernoulli_logit.h
categorical.h
21:50 (71%)
21:50 (71%)
view
28 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
bimixture.h
student_t.h
28:57 (65%)
21:50 (58%)
view
Duplicated Units
The list of top 14 duplicated units.
See data for all 14 unit duplicates...
Size#FoldersFilesLinesCode
19 x 2 src/beanmachine/tutorials/utils
src/beanmachine/tutorials/utils
nba.py
nba.py
0:0 
0:0 
view
12 x 2 src/beanmachine/ppl/compiler
src/beanmachine/ppl/compiler
gen_bmg_cpp.py
gen_bmg_python.py
0:0 
0:0 
view
9 x 2 src/beanmachine/ppl/experimental/gp
src/beanmachine/ppl/experimental/gp
kernels.py
likelihoods.py
0:0 
0:0 
view
8 x 2 src/beanmachine/ppl/inference
src/beanmachine/ppl/inference
nuts_inference.py
nuts_inference.py
0:0 
0:0 
view
8 x 2 src/beanmachine/graph/operator
src/beanmachine/graph/operator
gradient.cpp
gradient.cpp
95:106 
108:119 
view
7 x 7 src/beanmachine/ppl/expe...l/inference_compilation
src/beanmachine/ppl/legacy/inference/proposer
src/beanmachine/ppl/legacy/inference/proposer
src/beanmachine/ppl/legacy/inference/proposer
src/beanmachine/ppl/legacy/inference/proposer
src/beanmachine/ppl/legacy/inference/proposer
src/beanmachine/ppl/legacy/inference/proposer
ic_infer.py
single_site_newtonian_monte_carlo_pro...
single_site_real_space_newtonian_mont...
single_site_no_u_turn_sampler_propose...
single_site_hamiltonian_monte_carlo_p...
abstract_single_site_proposer.py
single_site_random_walk_proposer.py
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
view
12 x 2 src/beanmachine/ppl/legacy/inference/proposer
src/beanmachine/ppl/inference/proposer
single_site_random_walk_proposer.py
single_site_random_walk_proposer.py
0:0 
0:0 
view
6 x 2 src/beanmachine/ppl/testlib
src/beanmachine/ppl/testlib
abstract_conjugate.py
abstract_conjugate.py
0:0 
0:0 
view
6 x 2 src/beanmachine/ppl/inference
src/beanmachine/ppl/inference
hmc_inference.py
hmc_inference.py
0:0 
0:0 
view
6 x 2 src/beanmachine/ppl/inference
src/beanmachine/ppl/inference
bmg_inference.py
bmg_inference.py
0:0 
0:0 
view
6 x 2 src/beanmachine/graph
src/beanmachine/graph
pyi
graph.pyi
graph.pyi
0:0 
0:0 
view
6 x 2 src/beanmachine/graph
src/beanmachine/graph
pyi
graph.pyi
graph.pyi
0:0 
0:0 
view
6 x 2 src/beanmachine/graph/distribution
src/beanmachine/graph/distribution
tabular.cpp
tabular.cpp
104:110 
112:118 
view
12 x 2 src/beanmachine/ppl/legacy/inference/proposer
src/beanmachine/ppl/inference/proposer
single_site_random_walk_proposer.py
single_site_random_walk_proposer.py
0:0 
0:0 
view