{"id":13910945,"url":"https://github.com/tasleson/duplihere","last_synced_at":"2025-08-22T22:32:49.517Z","repository":{"id":45987453,"uuid":"215831978","full_name":"tasleson/duplihere","owner":"tasleson","description":"Copy \u0026 Paste finder for structured text files.","archived":false,"fork":false,"pushed_at":"2024-10-09T17:41:54.000Z","size":107,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-25T20:39:19.672Z","etag":null,"topics":["clones-detection","code-quality","copy-paste","cpd","detect-duplications","detector","developer-tools","duplicate-detection","duplicates","duplications","quality","research","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tasleson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-17T15:59:00.000Z","updated_at":"2024-10-09T17:41:58.000Z","dependencies_parsed_at":"2024-11-25T22:47:37.248Z","dependency_job_id":null,"html_url":"https://github.com/tasleson/duplihere","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tasleson%2Fduplihere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tasleson%2Fduplihere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tasleson%2Fduplihere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tasleson%2Fduplihere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tasleson","download_url":"https://codeload.github.com/tasleson/duplihere/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230645331,"owners_count":18258530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clones-detection","code-quality","copy-paste","cpd","detect-duplications","detector","developer-tools","duplicate-detection","duplicates","duplications","quality","research","rust"],"created_at":"2024-08-07T00:01:51.209Z","updated_at":"2024-12-20T20:58:47.112Z","avatar_url":"https://github.com/tasleson.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# duplihere\n\n### What\nCopy \u0026 Paste finder for source files or any structured utf-8 text files.\n\n\n### Why\n\nA number of different copy and paste detectors exist.  Some examples include:\n\n* [PMD](https://pmd.github.io/)\n* [Simian](http://www.harukizaemon.com/simian/)\n* [tctoolkit](https://github.com/nitinbhide/tctoolkit)\n\nSo why write another?  I've wanted a simple tool, one that works like simian,\nbut is open source and free for everyone. Thus this project was born.  In\ngeneral I think writing a lexer and tokenizing the source isn't needed.\nThere is a ton of code that is very much copy and pasted verbatim.\nDevelopers are lazy, they don't change things :-)\n\n### How\n\n```bash\nduplihere - 0.9.0 - find duplicate text\n\nusage: duplihere [-pj -l \u003cnumber\u003e -i \u003cfile name\u003e -t \u003cthread number\u003e] -f \u003cpattern or specific file\u003e\n\nFind duplicate lines of text in one or more text files.\n\nThe duplicated text can be at different levels of indention,\nbut otherwise needs to be identical.\n\nMore information: https://github.com/tasleson/duplihere\n\nargument:                                        description\n    -p, --print                                  print duplicate text [default: false]\n    -j, --json                                   output JSON [default: false]\n    -l, --lines \u003cnumber\u003e                         minimum number of duplicate lines [default: 6]\n    -f, --file \u003cpattern or specific file\u003e        pattern or file eg. \"**/*.[h|c]\" recursive, \"*.py\", \"file.ext\", can repeat [required]\n    -i, --ignore \u003cfile name\u003e                     file containing hash values to ignore, one per line\n    -t, --threads \u003cthread number\u003e                number of threads to utilize. Set to 0 to match #cpu cores [default: 4]\n```\n\nAn example where we re-curse in a directory for python files and a directory\nthat contains python files ...\n```bash\n$ duplihere -l 10 -p -f '/home/user/somewhere/**/*.py' -f '/tmp/*.py'\n```\n\nAn example showing JSON output (not finalized)\n\n```bash\n$ duplihere -f /home/tasleson/projects/linux/init/main.c -l 5 -j\n```\n\n```json\n{\n  \"num_lines\": 5,\n  \"num_ignored\": 0,\n  \"duplicates\": [\n    {\n      \"key\": 11558319874972720381,\n      \"num_lines\": 5,\n      \"files\": [\n        [\n          \"/home/tasleson/projects/linux/init/main.c\",\n          830\n        ],\n        [\n          \"/home/tasleson/projects/linux/init/main.c\",\n          864\n        ]\n      ]\n    }\n  ]\n}\n\n```\n\n### Status\n\nTool has enough features and functionality for meaningful results.\nWith the latest multi-thread support it's quite fast on\nbig source trees.  Current graph of memory and CPU consumption while examining\nthe Linux kernel source tree for duplicates. Run against Linux `6.5` branch (~24M lines) and all\navailable CPU cores. Chart generated with\n[psrecord](https://github.com/astrofrog/psrecord).\n\n![threadripper](https://github.com/tasleson/duplihere/assets/2520480/56e59144-e5b0-415c-90f0-b9459006f686)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftasleson%2Fduplihere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftasleson%2Fduplihere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftasleson%2Fduplihere/lists"}