microsoft / EconML
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
  • 20% duplication:
    • 18,636 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,886 duplicated lines
  • 527 duplicates
system20% (3,886 lines)
Duplication per Extension
py22% (3,580 lines)
pyx11% (244 lines)
yml20% (44 lines)
pxd6% (18 lines)
Duplication per Component (primary)
econml/iv48% (999 lines)
prototypes/dynamic_dml46% (404 lines)
econml/dml36% (378 lines)
econml/grf23% (352 lines)
prototypes/dml_iv26% (283 lines)
econml/policy49% (280 lines)
econml/dr41% (188 lines)
econml8% (178 lines)
econml/tree7% (129 lines)
econml/orf14% (118 lines)
econml/dynamic25% (105 lines)
econml/data11% (69 lines)
prototypes/orthogonal_forests6% (64 lines)
econml/cate_interpreter29% (60 lines)
monte_carlo_tests12% (55 lines)
econml/sklearn_extensions5% (53 lines)
econml/metalearners27% (53 lines)
econml/inference5% (48 lines)
ROOT12% (44 lines)
econml/solutions1% (18 lines)
econml/score7% (8 lines)
doc0% (0 lines)
econml/_ensemble0% (0 lines)
econml/automated_ml0% (0 lines)

Duplication Between Components (50+ lines)

G econml/dml econml/dml econml/iv econml/iv econml/dml--econml/iv 433 econml/dynamic econml/dynamic econml/dml--econml/dynamic 203 econml/dr econml/dr econml/dml--econml/dr 163 econml/grf econml/grf econml/dml--econml/grf 104 econml/dr--econml/iv 250 econml/policy econml/policy econml/dr--econml/policy 81 econml/grf--econml/policy 222 econml/tree econml/tree econml/grf--econml/tree 140 econml/dynamic--econml/iv 152 econml/data econml/data prototypes/dynamic_dml prototypes/dynamic_dml econml/data--prototypes/dynamic_dml 174 econml econml econml--econml/iv 80

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 527 duplicates...
Size#FoldersFilesLinesCode
44 x 2 econml/iv/dml
econml/iv/dml
_dml.py
_dml.py
1043:1093 (6%)
1362:1412 (6%)
view
33 x 2 econml/data
prototypes/dynamic_dml
dynamic_panel_dgp.py
dynamic_panel_dgp.py
211:253 (9%)
6:48 (14%)
view
30 x 2 econml/grf
econml/grf
classes.py
classes.py
339:368 (17%)
669:698 (17%)
view
29 x 2 prototypes/dynamic_dml
prototypes/dynamic_dml
hetero_panel_dynamic_dml.py
panel_dynamic_dml.py
22:53 (17%)
18:49 (21%)
view
28 x 2 econml/iv/dml
econml/iv/dr
_dml.py
_dr.py
419:522 (4%)
399:502 (2%)
view
24 x 2 prototypes/dynamic_dml
prototypes/dynamic_dml
dynamic_panel_dgp.py
dynamic_panel_dgp.py
178:206 (10%)
229:257 (10%)
view
24 x 2 econml/dml
econml/dynamic/dml
dml.py
_dml.py
430:457 (4%)
475:502 (5%)
view
23 x 2 prototypes/dml_iv
prototypes/dml_iv
coverage_experiment.py
utilities.py
54:77 (16%)
85:115 (9%)
view
23 x 2 econml/iv/dr
econml/iv/dr
_dr.py
_dr.py
1195:1218 (2%)
1471:1494 (2%)
view
23 x 2 prototypes/dynamic_dml
prototypes/dynamic_dml
dynamic_panel_dgp.py
dynamic_panel_dgp.py
78:104 (9%)
180:206 (9%)
view
23 x 2 prototypes/dynamic_dml
prototypes/dynamic_dml
dynamic_panel_dgp.py
dynamic_panel_dgp.py
78:104 (9%)
231:257 (9%)
view
22 x 2 econml/dr
econml/iv/dr
_drlearner.py
_dr.py
1410:1432 (4%)
1849:1871 (2%)
view
21 x 2 econml/grf
econml/grf
_base_grf.py
classes.py
55:75 (4%)
339:359 (12%)
view
21 x 2 econml/grf
econml/grf
_base_grf.py
classes.py
55:75 (4%)
669:689 (12%)
view
21 x 2 econml/dml
econml/dynamic/dml
_rlearner.py
_dml.py
410:439 (20%)
763:792 (5%)
view
20 x 2 prototypes/dml_iv
prototypes/dml_iv
dr_iv.py
dr_iv.py
232:253 (7%)
419:440 (7%)
view
19 x 2 econml/dml
econml/iv/dml
dml.py
_dml.py
109:128 (3%)
119:139 (2%)
view
19 x 2 econml/grf
econml/policy/_forest
_base_grf.py
_forest.py
413:463 (4%)
378:421 (11%)
view
18 x 2 prototypes/dml_iv
prototypes/dml_iv
dml_ate_iv.py
dml_ate_iv.py
93:120 (12%)
205:233 (12%)
view
17 x 2 econml/dml
econml/grf
causal_forest.py
_base_grf.py
496:512 (3%)
57:73 (3%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 38 unit duplicates...
Size#FoldersFilesLinesCode
29 x 2 econml/grf
econml/grf
classes.py
classes.py
0:0 
0:0 
view
22 x 2 prototypes/dynamic_dml
prototypes/dynamic_dml
hetero_panel_dynamic_dml.py
panel_dynamic_dml.py
0:0 
0:0 
view
16 x 2 econml/dr
econml/iv/dr
_drlearner.py
_dr.py
0:0 
0:0 
view
12 x 2 prototypes/dml_iv
prototypes/dml_iv
dr_iv.py
dr_iv.py
0:0 
0:0 
view
10 x 2 econml/dml
econml/dynamic/dml
dml.py
_dml.py
0:0 
0:0 
view
10 x 2 econml/iv/dml
econml/iv/dml
_dml.py
_dml.py
0:0 
0:0 
view
10 x 2 econml/iv/dml
econml/iv/dml
_dml.py
_dml.py
0:0 
0:0 
view
9 x 2 econml
econml/iv/dml
_cate_estimator.py
_dml.py
0:0 
0:0 
view
25 x 2 econml/grf
econml/policy/_forest
_base_grf.py
_forest.py
0:0 
0:0 
view
8 x 2 prototypes/dml_iv
prototypes/dml_iv
coverage_experiment.py
utilities.py
0:0 
0:0 
view
12 x 2 econml/dml
econml/dynamic/dml
_rlearner.py
_dml.py
0:0 
0:0 
view
23 x 3 econml/dml
econml/dynamic/dml
econml/iv/dml
dml.py
_dml.py
_dml.py
0:0 
0:0 
0:0 
view
7 x 3 econml/dml
econml/iv/dml
econml/iv/dr
dml.py
_dml.py
_dr.py
0:0 
0:0 
0:0 
view
23 x 2 econml/iv/dml
econml/iv/dr
_dml.py
_dr.py
0:0 
0:0 
view
7 x 2 econml/orf
prototypes/orthogonal_forests
_causal_tree.py
causal_tree.py
0:0 
0:0 
view
6 x 2 econml/data
prototypes/dynamic_dml
dynamic_panel_dgp.py
dynamic_panel_dgp.py
0:0 
0:0 
view
6 x 2 econml/data
prototypes/dynamic_dml
dynamic_panel_dgp.py
dynamic_panel_dgp.py
0:0 
0:0 
view
6 x 2 econml/data
prototypes/dynamic_dml
dynamic_panel_dgp.py
dynamic_panel_dgp.py
0:0 
0:0 
view
6 x 2 econml/dml
econml/dynamic/dml
dml.py
_dml.py
0:0 
0:0 
view
6 x 2 econml/iv/dml
econml/iv/dml
_dml.py
_dml.py
0:0 
0:0 
view