facebook / ThreatExchange
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
  • 17% duplication:
    • 40,956 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 7,174 duplicated lines
  • 1,071 duplicates
system17% (7,174 lines)
Duplication per Extension
py11% (2,030 lines)
tf30% (1,164 lines)
java22% (1,123 lines)
cpp27% (660 lines)
rb33% (488 lines)
tsx7% (448 lines)
ipynb49% (371 lines)
c54% (365 lines)
h26% (290 lines)
php11% (132 lines)
js20% (103 lines)
Duplication per Component (primary)
hasher-matcher-actioner/terraform30% (1,164 lines)
api-reference-examples/python28% (1,016 lines)
api-reference-examples/java23% (703 lines)
pdq/cpp41% (642 lines)
pdq/php38% (562 lines)
api-reference-examples/ruby33% (488 lines)
hasher-matcher-actioner/webapp7% (448 lines)
hasher-matcher-actioner/hmalib5% (444 lines)
pdq/java20% (420 lines)
api-reference-examples/python-notebook49% (371 lines)
python-threatexchange/threatexchange7% (325 lines)
pdq/python20% (239 lines)
tmk/cpp12% (237 lines)
api-reference-examples/js20% (103 lines)
api-reference-examples/php2% (12 lines)
hasher-matcher-actioner/hmalib_extensions0% (0 lines)
hasher-matcher-actioner0% (0 lines)
hasher-matcher-actioner/scripts0% (0 lines)
python-threatexchange0% (0 lines)
python-threatexchange/benchmarks0% (0 lines)
api-reference-examples/go0% (0 lines)

Duplication Between Components (50+ lines)

G pdq/cpp pdq/cpp pdq/php pdq/php pdq/cpp--pdq/php 518 api-reference-examples/python api-reference-examples/python python-threatexchange/threatexchange python-threatexchange/threatexchange api-reference-examples/python--python-threatexchange/threatexchange 144 hasher-matcher-actioner/hmalib hasher-matcher-actioner/hmalib hasher-matcher-actioner/hmalib--python-threatexchange/threatexchange 92

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,071 duplicates...
Size#FoldersFilesLinesCode
40 x 2 api-reference-examples/python/te-tag-query
api-reference-examples/python/te-tag-query
238:291 (4%)
332:381 (4%)
view
35 x 2 api-reference-examples/python/te-tag-query
api-reference-examples/python/te-tag-query
238:285 (3%)
421:475 (3%)
view
35 x 2 api-reference-examples/python/te-tag-query
api-reference-examples/python/te-tag-query
332:375 (3%)
421:475 (3%)
view
34 x 2 pdq/php/ext/pdq
pdq/php/ext/pdq
72:122 (18%)
170:220 (18%)
view
32 x 2 pdq/cpp/downscaling
pdq/php/ext/pdq/impl
395:439 (12%)
643:687 (7%)
view
29 x 2 api-reference-examples/python/te-tag-query
api-reference-examples/python/te-tag-query
1058:1090 (3%)
1312:1344 (3%)
view
28 x 2 pdq/cpp/io
pdq/cpp/io
80:117 (21%)
141:176 (21%)
view
27 x 2 api-reference-examples/j...facebook/threatexchange
api-reference-examples/j...facebook/threatexchange
1369:1407 (2%)
1525:1563 (2%)
view
27 x 2 api-reference-examples/python/te-tag-query
api-reference-examples/python/te-tag-query
1200:1231 (2%)
1328:1359 (2%)
view
26 x 2 hasher-matcher-actioner/terraform/hasher
hasher-matcher-actioner/terraform/matcher
43:73 (30%)
41:71 (39%)
view
25 x 2 pdq/cpp/downscaling
pdq/php/ext/pdq/impl
405:444 (9%)
710:749 (5%)
view
25 x 2 api-reference-examples/python/te-tag-query
api-reference-examples/python/te-tag-query
1152:1184 (2%)
1278:1310 (2%)
view
24 x 2 api-reference-examples/j...facebook/threatexchange
api-reference-examples/j...facebook/threatexchange
1183:1214 (2%)
1514:1546 (2%)
view
24 x 2 api-reference-examples/ruby/te-tag-query
api-reference-examples/ruby/te-tag-query
254:283 (2%)
338:366 (2%)
view
24 x 2 pdq/php/ext/pdq/impl
pdq/php/ext/pdq/impl
653:687 (5%)
710:744 (5%)
view
24 x 2 api-reference-examples/python-notebook
api-reference-examples/python-notebook
251:274 (8%)
456:479 (5%)
view
23 x 2 api-reference-examples/ruby/te-tag-query
api-reference-examples/ruby/te-tag-query
954:984 (2%)
1074:1104 (2%)
view
23 x 2 pdq/cpp/hashing
pdq/php/ext/pdq/impl
67:95 (6%)
48:76 (5%)
view
23 x 2 api-reference-examples/ruby/te-tag-query
api-reference-examples/ruby/te-tag-query
252:279 (2%)
429:455 (2%)
view
23 x 2 api-reference-examples/python/te-tag-query
python-threatexchange/th...hange/fb_threatexchange
35:58 (4%)
90:113 (5%)
view
22 x 2 pdq/java/src/main/java/pdqhashing/tools
pdq/java/src/main/java/pdqhashing/tools
112:140 (10%)
96:124 (16%)
view
22 x 2 hasher-matcher-actioner/...m/authentication-shared
hasher-matcher-actioner/terraform/authentication
42:63 (29%)
25:46 (33%)
view
21 x 2 pdq/cpp/hashing
pdq/php/ext/pdq/impl
347:371 (6%)
316:340 (4%)
view
21 x 2 api-reference-examples/python-notebook
api-reference-examples/python-notebook
41:61 (7%)
47:67 (4%)
view
21 x 2 api-reference-examples/ruby/te-tag-query
api-reference-examples/ruby/te-tag-query
859:883 (2%)
1106:1130 (2%)
view
21 x 2 api-reference-examples/ruby/te-tag-query
api-reference-examples/ruby/te-tag-query
338:362 (2%)
431:455 (2%)
view
20 x 2 api-reference-examples/j...facebook/threatexchange
api-reference-examples/j...facebook/threatexchange
1322:1345 (1%)
1482:1505 (1%)
view
19 x 2 api-reference-examples/python-notebook
api-reference-examples/python-notebook
22:40 (6%)
26:44 (3%)
view
19 x 2 pdq/php
pdq/php
934:963 (3%)
977:1006 (3%)
view
19 x 2 api-reference-examples/ruby/te-tag-query
api-reference-examples/ruby/te-tag-query
996:1017 (2%)
1118:1139 (2%)
view
19 x 2 pdq/cpp/hashing
pdq/php/ext/pdq/impl
45:65 (5%)
24:44 (4%)
view
18 x 2 pdq/php
pdq/php
860:885 (3%)
895:920 (3%)
view
18 x 2 pdq/java/src/main/java/pdqhashing/hasher
pdq/java/src/main/java/pdqhashing/hasher
94:116 (4%)
214:236 (4%)
view
18 x 2 pdq/php/ext/pdq/impl
pdq/php/ext/pdq/impl
143:160 (4%)
67:84 (17%)
view
18 x 2 api-reference-examples/js/node/lib
api-reference-examples/js/node/lib
87:108 (9%)
111:132 (9%)
view
17 x 2 hasher-matcher-actioner/terraform/hasher
hasher-matcher-actioner/terraform/matcher
3:21 (20%)
3:21 (25%)
view
17 x 2 api-reference-examples/j...facebook/threatexchange
api-reference-examples/j...facebook/threatexchange
330:346 (4%)
492:508 (4%)
view
17 x 2 api-reference-examples/j.../org/json/simple/parser
api-reference-examples/j.../org/json/simple/parser
355:372 (4%)
483:500 (4%)
view
16 x 2 pdq/cpp/hashing
pdq/php/ext/pdq/impl
179:194 (4%)
68:83 (15%)
view
16 x 2 hasher-matcher-actioner/terraform/api
hasher-matcher-actioner/terraform/hasher
50:68 (9%)
12:29 (18%)
view
16 x 2 python-threatexchange/threatexchange/fetcher/apis
python-threatexchange/threatexchange/fetcher
255:272 (7%)
158:180 (20%)
view
16 x 2 pdq/python
pdq/python
71:95 (9%)
122:146 (9%)
view
16 x 2 pdq/php
pdq/php
893:916 (3%)
975:998 (3%)
view
16 x 2 api-reference-examples/python/te-tag-query
api-reference-examples/python/te-tag-query
375:392 (1%)
486:503 (1%)
view
16 x 2 api-reference-examples/python/pytx/pytx
api-reference-examples/python/pytx/pytx
354:388 (5%)
398:432 (5%)
view
16 x 2 hasher-matcher-actioner/terraform/actions
hasher-matcher-actioner/terraform/indexer
20:38 (24%)
4:22 (28%)
view
16 x 2 pdq/cpp/hashing
pdq/php/ext/pdq/impl
179:194 (4%)
144:159 (3%)
view
16 x 2 api-reference-examples/python/pytx/pytx
api-reference-examples/python/pytx/pytx
310:344 (5%)
398:432 (5%)
view
16 x 2 api-reference-examples/python/pytx/pytx
api-reference-examples/python/pytx/pytx
310:344 (5%)
354:388 (5%)
view
15 x 2 api-reference-examples/python/te-tag-query
api-reference-examples/python/te-tag-query
1036:1054 (1%)
1283:1302 (1%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
16 x 2 pdq/php/ext/pdq/impl
pdq/cpp/hashing
61:78 
80:97 
view