facebookexperimental / rust-shed
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
  • 14% duplication:
    • 25,473 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,682 duplicated lines
  • 10,970 duplicates
system14% (3,682 lines)
Duplication per Extension
rs18% (2,988 lines)
py4% (274 lines)
cmake9% (210 lines)
toml18% (210 lines)
Duplication per Component (primary)
build/fbcode_builder5% (484 lines)
shed/sql33% (428 lines)
shed/sorted_vector_map17% (303 lines)
shed/futures_ext28% (262 lines)
shed/futures_01_ext10% (190 lines)
shed/facet15% (175 lines)
shed/serde_starlark25% (170 lines)
shed/fbthrift_ext43% (124 lines)
shed/netstring34% (121 lines)
shed/stats17% (114 lines)
shed/fbinit31% (105 lines)
shed/async_compression14% (100 lines)
shed/shared_error47% (97 lines)
shed/chrome_trace22% (92 lines)
shed/cachelib_stub31% (86 lines)
shed/scuba_sample8% (78 lines)
shed/failure_ext12% (76 lines)
shed/hash_memo20% (74 lines)
shed/cached_config14% (71 lines)
shed/tokio_shim19% (53 lines)
shed/slog_glog_fmt7% (51 lines)
shed/memcache_stub28% (47 lines)
shed/borrowed14% (35 lines)
shed/cloned22% (35 lines)
shed/services31% (34 lines)
shed/bytes_ext32% (32 lines)
shed/quickcheck_arbitrary_derive9% (19 lines)
shed/trait_alias37% (19 lines)
shed/secure_utils16% (19 lines)
shed/futures_stats7% (18 lines)
shed/thrift_compiler7% (18 lines)
shed/codegen_includer_proc_macro27% (17 lines)
shed/async_once_cell8% (15 lines)
shed/panichandler12% (15 lines)
shed/hostcaps32% (14 lines)
shed/scuba_stub37% (10 lines)
shed/futures_lazy_shared22% (10 lines)
shed/hostname31% (10 lines)
shed/slog_stats21% (9 lines)
shed/ascii_ext6% (9 lines)
shed/time_ext7% (9 lines)
shed/lock_ext11% (9 lines)
shed/perthread5% (9 lines)
shed/limited_async_read22% (8 lines)
shed/tokio-uds-compat11% (8 lines)
ROOT0% (0 lines)

Duplication Between Components (50+ lines)

G shed/futures_01_ext shed/futures_01_ext shed/futures_ext shed/futures_ext shed/futures_01_ext--shed/futures_ext 265 shed/sql shed/sql shed/futures_01_ext--shed/sql 179 shed/stats shed/stats shed/futures_01_ext--shed/stats 172 shed/slog_glog_fmt shed/slog_glog_fmt shed/futures_01_ext--shed/slog_glog_fmt 154 shed/scuba_sample shed/scuba_sample shed/futures_01_ext--shed/scuba_sample 146 shed/sorted_vector_map shed/sorted_vector_map shed/futures_01_ext--shed/sorted_vector_map 144 shed/memcache_stub shed/memcache_stub shed/futures_01_ext--shed/memcache_stub 138 shed/services shed/services shed/futures_01_ext--shed/services 130 shed/shared_error shed/shared_error shed/futures_01_ext--shed/shared_error 130 shed/netstring shed/netstring shed/futures_01_ext--shed/netstring 130 shed/futures_stats shed/futures_stats shed/futures_01_ext--shed/futures_stats 124 shed/thrift_compiler shed/thrift_compiler shed/futures_01_ext--shed/thrift_compiler 122 shed/secure_utils shed/secure_utils shed/futures_01_ext--shed/secure_utils 122 shed/futures_ext--shed/sql 173 shed/futures_ext--shed/stats 162 shed/futures_ext--shed/slog_glog_fmt 146 shed/futures_ext--shed/scuba_sample 138 shed/futures_ext--shed/sorted_vector_map 136 shed/futures_ext--shed/memcache_stub 130 shed/futures_ext--shed/shared_error 124 shed/futures_ext--shed/netstring 122 shed/async_compression shed/async_compression shed/async_compression--shed/futures_01_ext 186 shed/async_compression--shed/futures_ext 162 shed/async_compression--shed/sql 139 shed/async_compression--shed/stats 130 shed/cached_config shed/cached_config shed/async_compression--shed/cached_config 122 shed/sql--shed/stats 141 shed/cached_config--shed/futures_01_ext 162 shed/cached_config--shed/futures_ext 154 shed/cached_config--shed/sql 131 shed/cached_config--shed/stats 122 shed/fbinit shed/fbinit shed/fbinit--shed/futures_01_ext 156 shed/fbinit--shed/futures_ext 146 shed/fbinit--shed/sql 153 shed/facet shed/facet shed/facet--shed/futures_01_ext 155 shed/facet--shed/futures_ext 147 shed/facet--shed/sql 142 shed/facet--shed/fbinit 141 shed/slog_glog_fmt--shed/sql 123 shed/failure_ext shed/failure_ext shed/failure_ext--shed/futures_01_ext 152 shed/failure_ext--shed/futures_ext 147 shed/failure_ext--shed/sql 123 shed/fbthrift_ext shed/fbthrift_ext shed/fbthrift_ext--shed/futures_01_ext 144 shed/fbthrift_ext--shed/futures_ext 138 shed/fbthrift_ext--shed/sql 130 shed/memcache_stub--shed/sql 123 shed/cachelib_stub shed/cachelib_stub shed/cachelib_stub--shed/futures_01_ext 136 shed/cachelib_stub--shed/futures_ext 128 shed/bytes_ext shed/bytes_ext shed/bytes_ext--shed/futures_01_ext 136 shed/bytes_ext--shed/futures_ext 128

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 10,970 duplicates...
Size#FoldersFilesLinesCode
19 x 2 shed/fbthrift_ext/socket
shed/fbthrift_ext/tcp
1:20 (36%)
1:20 (43%)
view
16 x 2 shed/sql/src
shed/sql/src
566:583 (2%)
608:625 (2%)
view
16 x 2 shed/fbthrift_ext/socket
shed/fbthrift_ext/tcp
9:26 (69%)
9:26 (69%)
view
15 x 2 shed/sorted_vector_map/src
shed/sorted_vector_map/src
906:924 (1%)
520:538 (2%)
view
15 x 2 build/fbcode_builder/CMake
build/fbcode_builder/CMake
171:185 (8%)
40:54 (15%)
view
15 x 2 shed/cachelib_stub/src/oss
shed/cachelib_stub/src/oss
252:291 (7%)
330:356 (7%)
view
14 x 2 build/fbcode_builder/getdeps
build/fbcode_builder/getdeps
722:735 (1%)
1208:1221 (1%)
view
14 x 2 shed/sorted_vector_map/benches
shed/sorted_vector_map/benches
15:29 (12%)
15:29 (10%)
view
13 x 2 shed/sorted_vector_map/src
shed/sorted_vector_map/src
171:191 (1%)
85:105 (2%)
view
13 x 2 shed/futures_01_ext/src
shed/futures_01_ext/src
160:174 (8%)
215:229 (8%)
view
13 x 2 build/fbcode_builder/CMake
build/fbcode_builder/CMake
1:13 (52%)
1:13 (38%)
view
13 x 2 shed/futures_ext/src/future
shed/futures_ext/src/future
1:15 (37%)
1:15 (14%)
view
13 x 2 build/fbcode_builder/getdeps
build/fbcode_builder/getdeps
78:92 (7%)
136:149 (7%)
view
12 x 2 shed/futures_ext/src/stream
shed/futures_ext/src/stream
367:384 (3%)
416:432 (3%)
view
12 x 2 shed/futures_01_ext/src
shed/futures_01_ext/src
186:199 (8%)
215:228 (8%)
view
12 x 2 shed/fbinit/fbinit-tokio-02
shed/fbinit/fbinit-tokio
1:14 (44%)
1:14 (48%)
view
12 x 2 shed/futures_01_ext/src
shed/futures_01_ext/src
160:173 (8%)
186:199 (8%)
view
12 x 2 shed/tokio_shim/src
shed/tokio_shim/src
354:368 (4%)
372:386 (4%)
view
11 x 2 shed/cachelib_stub/src/oss
shed/cachelib_stub/src/oss
224:244 (5%)
310:326 (5%)
view
11 x 2 shed/sorted_vector_map/src
shed/sorted_vector_map/src
193:204 (1%)
107:118 (1%)
view
11 x 2 shed/sql/src
shed/sql/src
744:756 (1%)
785:797 (1%)
view
11 x 2 build/fbcode_builder/CMake
build/fbcode_builder/CMake
86:97 (6%)
53:64 (11%)
view
11 x 2 build/fbcode_builder/CMake
build/fbcode_builder/CMake
115:127 (4%)
180:192 (4%)
view
11 x 2 shed/serde_starlark/src
shed/serde_starlark/src
305:319 (1%)
653:667 (1%)
view
11 x 2 shed/chrome_trace/src
shed/chrome_trace/src
602:615 (2%)
636:649 (2%)
view
11 x 2 shed/sorted_vector_map/src
shed/sorted_vector_map/src
1:14 (1%)
1:14 (1%)
view
10 x 2 shed/futures_01_ext/src
shed/futures_ext/src/stream
434:444 (1%)
42:52 (3%)
view
10 x 2 shed/cached_config/src
shed/secure_utils/src
1:16 (33%)
1:14 (12%)
view
10 x 2 shed/chrome_trace/src
shed/chrome_trace/src
636:646 (2%)
670:680 (2%)
view
10 x 2 shed/facet/proc_macros
shed/fbinit/macros
1:11 (24%)
1:11 (8%)
view
10 x 2 shed/futures_01_ext/src
shed/futures_stats/src
1:11 (1%)
1:16 (40%)
view
10 x 2 shed/chrome_trace/src
shed/chrome_trace/src
511:520 (2%)
538:547 (2%)
view
10 x 2 build/fbcode_builder/getdeps
build/fbcode_builder/getdeps
489:498 (1%)
501:510 (1%)
view
10 x 2 shed/chrome_trace/src
shed/hostname/src
1:22 (2%)
1:15 (52%)
view
10 x 2 shed/cached_config/src
shed/cached_config/src
1:11 (13%)
1:11 (6%)
view
10 x 2 shed/shared_error/src
shed/shared_error/src
128:139 (9%)
94:105 (13%)
view
10 x 2 shed/borrowed/src
shed/cloned/src
1:65 (4%)
1:45 (6%)
view
10 x 2 shed/facet/proc_macros
shed/facet/proc_macros
1:11 (3%)
1:11 (12%)
view
10 x 2 shed/cached_config/src
shed/memcache_stub/common
1:11 (6%)
1:11 (21%)
view
10 x 2 shed/quickcheck_arbitrary_derive
shed/trait_alias
5:15 (47%)
5:15 (50%)
view
10 x 2 shed/sql/src
shed/sql/src
170:182 (1%)
225:237 (1%)
view
10 x 2 shed/scuba_stub/src
shed/secure_utils/src
1:24 (66%)
1:14 (12%)
view
10 x 2 shed/cached_config/src
shed/memcache_stub/common
1:11 (13%)
1:11 (21%)
view
10 x 2 shed/futures_ext/src/stream
shed/futures_ext/src/stream
75:93 (3%)
159:177 (3%)
view
10 x 2 shed/cached_config/src
shed/scuba_stub/src
1:16 (33%)
1:24 (66%)
view
10 x 2 shed/hash_memo/src
shed/hash_memo/src
321:339 (2%)
394:412 (2%)
view
10 x 2 shed/sql/src
shed/sql/src
281:293 (1%)
337:349 (1%)
view
10 x 2 shed/chrome_trace/src
shed/chrome_trace/src
602:612 (2%)
670:680 (2%)
view
10 x 2 shed/fbthrift_ext/util
shed/futures_lazy_shared/src
1:11 (38%)
1:11 (33%)
view
10 x 2 shed/facet/proc_macros
shed/facet/proc_macros
168:177 (3%)
217:226 (3%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
8 x 2 shed/sorted_vector_map/src
shed/sorted_vector_map/src
530:539 
916:925 
view