{"id":13665252,"url":"https://github.com/sbt/sbt-cpd","last_synced_at":"2025-04-21T12:30:39.781Z","repository":{"id":48982385,"uuid":"13715677","full_name":"sbt/sbt-cpd","owner":"sbt","description":"Copy \u0026 Paste Detector plugin using PMD for sbt.","archived":false,"fork":false,"pushed_at":"2021-07-02T08:54:03.000Z","size":129,"stargazers_count":48,"open_issues_count":11,"forks_count":10,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-27T01:01:39.973Z","etag":null,"topics":["cpd","pmd","sbt","sbt-plugin","scala","static-analysis"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-20T08:15:02.000Z","updated_at":"2024-04-01T17:42:50.000Z","dependencies_parsed_at":"2022-08-30T08:01:30.067Z","dependency_job_id":null,"html_url":"https://github.com/sbt/sbt-cpd","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbt%2Fsbt-cpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbt%2Fsbt-cpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbt%2Fsbt-cpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbt%2Fsbt-cpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbt","download_url":"https://codeload.github.com/sbt/sbt-cpd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223863912,"owners_count":17216234,"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":["cpd","pmd","sbt","sbt-plugin","scala","static-analysis"],"created_at":"2024-08-02T06:00:30.822Z","updated_at":"2024-11-09T18:11:50.506Z","avatar_url":"https://github.com/sbt.png","language":"Scala","funding_links":[],"categories":["TEST \u0026 QA"],"sub_categories":[],"readme":"# sbt-cpd - Copy \u0026 Paste Detection using PMD/CPD for sbt\n\n[![Build Status](https://travis-ci.org/sbt/sbt-cpd.svg?branch=master)](https://travis-ci.org/sbt/sbt-cpd)\n[![Codacy Grade](https://img.shields.io/codacy/grade/fdcffd4472b8498594b59d59928c4fef.svg?label=codacy)](https://www.codacy.com/app/stringbean/sbt-cpd)\n[![sbt 0.13 version](https://img.shields.io/badge/sbt_0.13-2.0.0-blue.svg)](https://bintray.com/stringbean/sbt-plugins/sbt-cpd)\n[![sbt 1.0 version](https://img.shields.io/badge/sbt_1.0-2.0.0-blue.svg)](https://bintray.com/stringbean/sbt-plugins/sbt-cpd)\n![pmd version](https://img.shields.io/badge/pmd_version-5.8.1-red.svg)\n\nThis is an [sbt](http://scala-sbt.org/) plugin for duplicate code detection using\n[Copy/Paste Detector](https://pmd.github.io/latest/usage/cpd-usage.html) (CPD) from the [PMD](https://pmd.github.io)\nproject.\n\nInstall the plugin by adding the following to `project/plugins.sbt`:\n\n```scala\naddSbtPlugin(\"com.github.sbt\" % \"sbt-cpd\" % \"\u003cversion\u003e\")\n```\n\nAnd then execute the plugin with `sbt cpd`. This will scan your source code under `src/main/scala` and output a report\ncontaining the duplicates to `target/scala-2.xx/cpd/cpd.xml`.\n\n## Settings\n\n(see also the [CPD documentation](https://pmd.github.io/pmd-5.8.1/usage/cpd-usage.html))\n\n| Key                     | Type              | Default             | Description |\n| ----------------------- | ----------------- | ------------------- | ----------- |\n| `cpdReportType`         | `CpdReportType`   | `CpdReportType.XML` | Selects the output format for the CPD report. Valid types: `XML`, `Simple`, `CSV` \u0026 `VS` |\n| `cpdLanguage`           | `CpdLanguage`     | `CpdLanguage.Scala` | Language to analyze.\u003csup\u003e1\u003c/sup\u003e |\n| `cpdMaxMemoryInMB`      | Integer           | `512`               | Maximum amount of memory to allow for CPD (in MB). |\n| `cpdMinimumTokens`      | Integer           | `100`               | Minimum number of tokens of potential duplicates. |\n| `cpdSourceEncoding`     | String            | `utf-8`             | Source file encoding. |\n| `cpdSourceDirectories`  | `Seq` (Paths)     | main source path(s) | Paths of the source files to analyze. |\n| `cpdOutputType`         | `CpdOutputType`   | `CpdOutputType.File`| Selects the output type for the CPD report.\u003csup\u003e2\u003c/sup\u003e Valid types: `File`, `Console` |\n| `cpdTargetPath`         | File Path         | `\u003ccross-target\u003e/cpd`| Output path for CPD reports. |\n| `cpdReportName`         | String (filename) | `cpd.xml`           | Name of the report file to generate (under `cpdTargetPath`). |\n| `cpdReportFileEncoding` | String            | `utf-8`             | Report file encoding. |\n| `cpdSkipDuplicateFiles` | Boolean           | `false`             | Ignore multiple copies of files of the same name and length in comparison. |\n| `cpdSkipLexicalErrors`  | Boolean           | `false`             | Skip files which can't be tokenized due to invalid characters instead of aborting. |\n| `cpdIgnoreLiterals`     | Boolean           | `false`             | Ignore literal value differences when evaluating a duplicate block. |\n| `cpdIgnoreIdentifiers`  | Boolean           | `false`             | Ignore identifier name differences when evaluating a duplicate block. |\n| `cpdIgnoreAnnotations`  | Boolean           | `false`             | Ignore language annotations when evaluating a duplicate block. |\n| `cpdFailOnDuplicates`   | Boolean           | `false`             | Fail the build if duplicates are detected. |\n\n1. Valid languages:\n    * `Scala`\n    * `Java`\n    * `C`\n    * `CPP`\n    * `CS`\n    * `CSharp`\n    * `ECMAScript`\n    * `Fortran`\n    * `Go`\n    * `JSP`\n    * `JavaScript`\n    * `Matlab`\n    * `ObjectiveC`\n    * `PHP`\n    * `PLSQ`\n    * `Ruby`\n    * `Swift`\n1. If set to `CpdOutputType.Console` then `cpdTargetPath` and `cpdReportName` are ignored.\n\n## Contributors\n\nMany thanks to\n\n* [corux](https://github.com/corux)\n* [Jentsch](https://github.com/Jentsch)\n* [Martin Mauch](https://github.com/nightscape)\n* [Matic Potočnik](https://github.com/HairyFotr)\n\nfor their awesome contributions!\n\n## License\n\nThis program and the accompanying materials are made available under the terms of the **Eclipse Public License v1.0**\nwhich accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbt%2Fsbt-cpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbt%2Fsbt-cpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbt%2Fsbt-cpd/lists"}