facebook / watchman
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:
    • 44,565 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,239 duplicated lines
  • 446 duplicates
system5% (2,239 lines)
Duplication per Extension
cpp4% (726 lines)
rs11% (464 lines)
py3% (366 lines)
cmake9% (210 lines)
html17% (165 lines)
h3% (141 lines)
scss7% (74 lines)
c5% (73 lines)
js2% (20 lines)
Duplication per Component (primary)
build/fbcode_builder5% (484 lines)
watchman/rust12% (452 lines)
watchman3% (334 lines)
watchman/scm27% (180 lines)
website/_includes18% (153 lines)
watchman/python5% (145 lines)
watchman/watcher3% (94 lines)
website/_sass7% (74 lines)
watchman/fs5% (74 lines)
watchman/winbuild7% (63 lines)
watchman/cmds4% (62 lines)
watchman/query2% (54 lines)
watchman/root1% (26 lines)
watchman/node2% (20 lines)
watchman/cli3% (12 lines)
website/_layouts15% (12 lines)
eden/fs0% (0 lines)
website0% (0 lines)
website/css0% (0 lines)
website/blog0% (0 lines)
website/static0% (0 lines)
website/_data0% (0 lines)
website/src0% (0 lines)
watchman/cppclient0% (0 lines)
watchman/integration0% (0 lines)
watchman/java0% (0 lines)
watchman/build0% (0 lines)
watchman/ruby0% (0 lines)
watchman/saved_state0% (0 lines)
ROOT0% (0 lines)

Duplication Between Components (50+ lines)

G watchman/cli watchman/cli watchman/rust watchman/rust watchman/cli--watchman/rust 144 watchman watchman watchman/python watchman/python watchman--watchman/python 82

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 446 duplicates...
Size#FoldersFilesLinesCode
22 x 2 watchman
watchman/python/pywatchman
163:184 (4%)
319:340 (2%)
view
19 x 2 watchman/scm
watchman/scm
37:55 (8%)
49:67 (6%)
view
19 x 2 website/_includes
website/_includes
25:43 (26%)
38:56 (19%)
view
17 x 2 website/_includes
website/_includes
51:67 (23%)
74:90 (17%)
view
16 x 2 website/_sass
website/_sass
453:471 (1%)
851:869 (1%)
view
15 x 2 watchman/watcher
watchman/watcher
146:160 (5%)
177:191 (5%)
view
15 x 2 watchman/rust/serde_bser/src/de
watchman/rust/serde_bser/src/de
381:398 (3%)
483:499 (3%)
view
15 x 2 build/fbcode_builder/CMake
build/fbcode_builder/CMake
171:185 (8%)
40:54 (15%)
view
15 x 2 website/_includes/plugins
website/_includes/plugins
4:19 (88%)
2:17 (93%)
view
14 x 2 watchman/rust/serde_bser/src/de
watchman/rust/serde_bser/src/de
336:352 (3%)
438:454 (3%)
view
14 x 2 build/fbcode_builder/getdeps
build/fbcode_builder/getdeps
722:735 (1%)
1208:1221 (1%)
view
14 x 2 watchman
watchman/query
54:68 (6%)
43:67 (43%)
view
13 x 2 build/fbcode_builder/getdeps
build/fbcode_builder/getdeps
78:92 (7%)
136:149 (7%)
view
13 x 2 build/fbcode_builder/CMake
build/fbcode_builder/CMake
1:13 (52%)
1:13 (38%)
view
13 x 2 watchman/cmds
watchman/cmds
275:290 (6%)
309:325 (6%)
view
13 x 2 watchman/rust/watchman_client/src
watchman/rust/watchman_client/src
270:307 (3%)
448:485 (3%)
view
13 x 2 watchman/query
watchman/query
77:91 (12%)
73:87 (15%)
view
13 x 2 website/_includes
website/_includes
6:20 (81%)
16:30 (50%)
view
12 x 2 watchman/cmds
watchman/cmds
34:49 (46%)
39:53 (41%)
view
12 x 2 watchman/scm
watchman/scm
35:50 (32%)
37:48 (30%)
view
12 x 2 watchman/rust/serde_bser/src/de
watchman/rust/serde_bser/src/de
365:377 (3%)
468:480 (3%)
view
11 x 2 watchman/rust/serde_bser/src/de
watchman/rust/serde_bser/src/de
327:337 (2%)
372:382 (2%)
view
11 x 2 build/fbcode_builder/CMake
build/fbcode_builder/CMake
86:97 (6%)
53:64 (11%)
view
11 x 2 watchman/rust/serde_bser/src/de
watchman/rust/serde_bser/src/de
1:14 (35%)
1:14 (13%)
view
11 x 2 build/fbcode_builder/CMake
build/fbcode_builder/CMake
115:127 (4%)
180:192 (4%)
view
11 x 2 watchman/python/pywatchman
watchman/python/pywatchman
696:708 (1%)
764:776 (1%)
view
10 x 2 watchman/rust/serde_bser/src/de
watchman/rust/serde_bser/src/de
449:458 (2%)
494:503 (2%)
view
10 x 2 build/fbcode_builder/getdeps
build/fbcode_builder/getdeps
489:498 (1%)
501:510 (1%)
view
10 x 2 watchman/rust/serde_bser/src/de
watchman/rust/serde_bser/src/de
347:356 (2%)
393:402 (2%)
view
10 x 2 watchman/watcher
watchman/watcher
43:55 (33%)
95:107 (4%)
view
10 x 2 watchman/rust/serde_bser/src/de
watchman/rust/serde_bser/src/de
322:332 (2%)
425:435 (2%)
view
10 x 2 watchman/rust/serde_bser/src/de
watchman/rust/serde_bser/src/de
430:439 (2%)
475:484 (2%)
view
9 x 2 watchman
watchman
73:82 (9%)
115:124 (9%)
view
9 x 2 watchman/watcher
watchman/watcher
816:826 (1%)
489:499 (2%)
view
9 x 2 website/_includes/plugins
website/_includes/plugins
10:19 (52%)
22:31 (30%)
view
9 x 2 build/fbcode_builder/getdeps
build/fbcode_builder/getdeps
291:299 (1%)
328:336 (1%)
view
9 x 2 website/_includes/plugins
website/_includes/plugins
8:17 (56%)
22:31 (30%)
view
9 x 2 build/fbcode_builder/CMake
build/fbcode_builder/CMake
557:566 (1%)
221:230 (3%)
view
9 x 2 watchman/rust/watchman_client/src
watchman/rust/watchman_client/src
851:860 (1%)
880:889 (1%)
view
9 x 2 watchman/winbuild
watchman/winbuild
13:22 (13%)
20:28 (17%)
view
9 x 2 build/fbcode_builder/CMake
build/fbcode_builder/CMake
27:35 (5%)
29:38 (12%)
view
9 x 2 watchman/scm
watchman/scm
95:105 (4%)
105:115 (3%)
view
9 x 2 website/_sass
website/_sass
923:934 (1%)
950:961 (1%)
view
8 x 2 watchman/python/pywatchman
watchman/python/pywatchman_aio
969:979 (1%)
47:58 (3%)
view
8 x 2 build/fbcode_builder/getdeps
build/fbcode_builder/getdeps
20:27 (2%)
621:628 (1%)
view
8 x 2 watchman/scm
watchman/scm
138:146 (3%)
187:195 (2%)
view
8 x 2 watchman/scm
watchman/scm
264:272 (3%)
386:394 (2%)
view
8 x 2 build/fbcode_builder/getdeps
build/fbcode_builder/getdeps
22:29 (<1%)
256:263 (<1%)
view
8 x 2 build/fbcode_builder/getdeps
build/fbcode_builder/getdeps
165:172 (6%)
176:183 (6%)
view
8 x 2 website/_includes
website/_includes
16:23 (10%)
28:35 (8%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
11 x 2 watchman/watcher
watchman/watcher
815:827 
488:500 
view
11 x 2 watchman/scm
watchman/scm
104:116 
94:106 
view