facebook / redex
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
  • 5% duplication:
    • 159,686 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 9,501 duplicated lines
  • 1,160 duplicates
system5% (9,501 lines)
Duplication per Extension
cpp5% (6,337 lines)
h5% (1,789 lines)
py12% (1,283 lines)
cmake9% (64 lines)
proto3% (28 lines)
Duplication per Component (primary)
libredex4% (2,554 lines)
tools12% (2,040 lines)
opt4% (1,775 lines)
service5% (1,548 lines)
sparta13% (819 lines)
libresource3% (401 lines)
pyredex9% (149 lines)
ROOT9% (133 lines)
cmake_modules5% (32 lines)
proto3% (28 lines)
shared1% (22 lines)
analysis0% (0 lines)
util0% (0 lines)
liblocator0% (0 lines)
website0% (0 lines)
java0% (0 lines)

Duplication Between Components (50+ lines)

G libredex libredex service service libredex--service 1103 opt opt libredex--opt 711 sparta sparta libredex--sparta 69 opt--service 1101 cmake_modules cmake_modules cmake_modules--sparta 64

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 50 longest duplicates.
See data for all 1,160 duplicates...
Size#FoldersFilesLinesCode
69 x 2 libredex
service/escape-analysis
1530:1598 (4%)
78:146 (14%)
view
46 x 2 libredex
service/escape-analysis
1483:1528 (2%)
32:77 (9%)
view
45 x 2 libredex
service/escape-analysis
1622:1666 (2%)
169:213 (9%)
view
40 x 2 opt/remove_redundant_check_casts
service/dataflow
54:93 (9%)
274:313 (10%)
view
33 x 2 libredex
libredex
25:58 (42%)
908:940 (2%)
view
33 x 2 service/regalloc
service/regalloc
202:234 (6%)
471:503 (6%)
view
32 x 2 libredex
libredex
1567:1598 (2%)
278:309 (10%)
view
32 x 2 libredex
service/escape-analysis
278:309 (10%)
115:146 (6%)
view
31 x 2 ROOT
ROOT
53:140 (42%)
53:142 (39%)
view
31 x 2 opt/outliner
service/dataflow
450:481 (3%)
203:234 (8%)
view
28 x 2 tools/redex-all
tools/redex-opt
138:174 (2%)
119:155 (18%)
view
28 x 2 opt/remove_redundant_check_casts
service/dataflow
22:49 (6%)
202:229 (7%)
view
27 x 2 libredex
libredex
983:1009 (2%)
1084:1110 (2%)
view
27 x 2 opt/outliner
opt/remove_redundant_check_casts
450:476 (3%)
23:49 (6%)
view
25 x 2 libredex
libredex
113:137 (2%)
460:484 (5%)
view
24 x 2 libredex
service/escape-analysis
1670:1693 (1%)
215:238 (5%)
view
23 x 2 opt/methodinline
opt/methodinline
330:353 (2%)
750:773 (2%)
view
23 x 2 opt/remove-recursive-locks
service/copy-propagation
272:300 (4%)
41:69 (14%)
view
23 x 2 opt/methodinline
opt/methodinline
294:323 (2%)
715:744 (2%)
view
22 x 2 tools/python
tools/python
3796:3818 (<1%)
3856:3878 (<1%)
view
22 x 2 tools/oatmeal
tools/oatmeal
2329:2359 (<1%)
2464:2494 (<1%)
view
22 x 2 shared
tools/oatmeal
89:110 (16%)
40:62 (33%)
view
21 x 2 opt/outliner
opt/partial-application
2953:2973 (<1%)
1114:1134 (2%)
view
21 x 2 libredex
libredex
1507:1527 (1%)
218:238 (6%)
view
21 x 2 libredex
service/escape-analysis
1600:1620 (1%)
147:167 (4%)
view
21 x 2 libredex
service/escape-analysis
218:238 (6%)
56:76 (4%)
view
21 x 2 opt/synth
opt/synth
588:613 (2%)
623:648 (2%)
view
20 x 2 sparta/include
sparta/include
1174:1210 (2%)
957:993 (3%)
view
20 x 2 service/regalloc
service/regalloc
178:197 (3%)
446:465 (3%)
view
19 x 2 pyredex
pyredex
421:440 (2%)
674:693 (2%)
view
19 x 2 tools/oatmeal
tools/oatmeal
2129:2150 (<1%)
2455:2476 (<1%)
view
19 x 2 libredex
service/escape-analysis
311:329 (5%)
147:165 (4%)
view
19 x 2 libredex
opt/synth
1252:1270 (1%)
385:403 (2%)
view
19 x 2 libredex
service/regalloc
1559:1577 (1%)
170:188 (3%)
view
19 x 2 libredex
service/regalloc
1600:1618 (1%)
214:232 (3%)
view
19 x 2 tools/python
tools/python
3493:3514 (<1%)
3519:3540 (<1%)
view
19 x 2 service/escape-analysis
service/regalloc
147:165 (4%)
214:232 (3%)
view
19 x 2 service/escape-analysis
service/regalloc
107:125 (4%)
170:188 (3%)
view
19 x 2 libredex
service/regalloc
311:329 (5%)
214:232 (3%)
view
19 x 2 service/escape-analysis
service/regalloc
147:165 (4%)
483:501 (3%)
view
19 x 2 libredex
service/regalloc
1654:1672 (1%)
271:289 (3%)
view
19 x 2 libredex
libredex
1600:1618 (1%)
311:329 (5%)
view
19 x 2 libredex
service/regalloc
311:329 (5%)
483:501 (3%)
view
19 x 2 libredex
service/regalloc
1600:1618 (1%)
483:501 (3%)
view
18 x 2 opt/remove-apilevel-checks
opt/remove-recursive-locks
167:189 (9%)
270:292 (3%)
view
18 x 2 pyredex
pyredex
310:327 (2%)
676:693 (2%)
view
18 x 2 pyredex
pyredex
310:327 (2%)
423:440 (2%)
view
17 x 2 tools/python
tools/python
125:142 (2%)
264:281 (2%)
view
17 x 2 libredex
libredex
888:904 (1%)
948:964 (1%)
view
17 x 2 tools/python
tools/python
3550:3569 (<1%)
3657:3676 (<1%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
26 x 2 tools/redex-opt
tools/redex-all
126:156 
145:175 
view
11 x 2 sparta/include
sparta/include
171:183 
160:172 
view
6 x 2 opt/type-analysis
opt/remove-unreachable
38:45 
31:38 
view