{"id":18474402,"url":"https://github.com/codecop/pmd-rules","last_synced_at":"2025-05-13T14:30:19.184Z","repository":{"id":141739101,"uuid":"239337973","full_name":"codecop/pmd-rules","owner":"codecop","description":"Mixed set of PMD rules regarding basic bugs, design principles, junit test, naming etc.","archived":false,"fork":false,"pushed_at":"2023-12-19T08:45:58.000Z","size":403,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T19:33:24.705Z","etag":null,"topics":["code-analysis","constraints","java","pmd","static-analysis","static-code-analysis"],"latest_commit_sha":null,"homepage":"https://www.code-cop.org/mvn2repo/sites/pmd-rules/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codecop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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":"2020-02-09T16:44:44.000Z","updated_at":"2023-11-27T19:33:13.000Z","dependencies_parsed_at":"2023-11-26T22:27:06.398Z","dependency_job_id":"eda5fcda-0604-4e28-89c0-ff0237f74c4b","html_url":"https://github.com/codecop/pmd-rules","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecop%2Fpmd-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecop%2Fpmd-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecop%2Fpmd-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecop%2Fpmd-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codecop","download_url":"https://codeload.github.com/codecop/pmd-rules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253960020,"owners_count":21990791,"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":["code-analysis","constraints","java","pmd","static-analysis","static-code-analysis"],"created_at":"2024-11-06T10:29:21.811Z","updated_at":"2025-05-13T14:30:19.069Z","avatar_url":"https://github.com/codecop.png","language":"Java","readme":"# PMD Rules - Custom PMD Rules\r\n\r\nCustom rules for PMD code analysis.\r\n\r\n[PMD](https://pmd.github.io/) scans Java source code and looks for potential problems. (Read about how it works [here](https://docs.pmd-code.org/latest/pmd_devdocs_how_pmd_works.html).) It comes with more than 200 [predefined rules](https://docs.pmd-code.org/latest/pmd_rules_java.html). It's possible to define your own rules; I have done so since 2004. This project contains a mixed set of custom rules for PMD regarding basic bugs, design principles, JUnit test, naming and other rule groups as well as some useful templates to copy from.\r\n\r\nThe `pmd-4.x` branch contains some early rules compatible with PMD 4.1 up to PMD 4.3 and its last release is `1.1-pmd4`. The `pmd-5.x` branch contains rules for versions 5.0.5 to 5.8.1 and its last release is `1.2.4-pmd5`. PMD 6 is the current one.   \r\n\r\n## Rule Sets\r\n\r\n* Read my [motivation for first custom rules](https://blog.code-cop.org/2010/05/custom-pmd-rules.html).\r\n* [PmdRulesCodecop](https://github.com/codecop/pmd-rules/wiki/PmdRulesCodecop) - rules for various bugs and conventions.\r\n* [PmdRulesConstraints](https://github.com/codecop/pmd-rules/wiki/PmdRulesConstraints) - rules for constraints in code katas, Coding Dojos and Code Retreats.\r\n* [PmdRulesPrototype](https://github.com/codecop/pmd-rules/wiki/PmdRulesPrototype)\r\n\r\nBeing lazy, of course I did not write these rule documentations by hand. I had it generated using a Ruby script `rule_summary_*.rb` that converts PMD's `ruleset.xml` format into wiki syntax.\r\n\r\n## Usage\r\n\r\nAdd the jar containing the rule sets to the PMD classpath, just copy the `pmd-rules-x.y.z.jar` into PMD's `lib` folder. Download the latest rules from [here](https://www.code-cop.org/mvn2repo/releases/org/codecop/pmd-rules/). For example the 1.2.4 version is compatible with PMD 5 and PMD 6. For the latest [Maven PMD plugin](http://maven.apache.org/plugins/maven-pmd-plugin/) this looks like:\r\n\r\n    \u003cplugin\u003e\r\n        \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\r\n        \u003cartifactId\u003emaven-pmd-plugin\u003c/artifactId\u003e\r\n        \u003cversion\u003e3.21.2\u003c/version\u003e\r\n        \u003cdependencies\u003e\r\n            \u003c!-- comes with PMD 6.55.0 --\u003e\r\n            \u003cdependency\u003e\r\n                \u003cgroupId\u003eorg.codecop\u003c/groupId\u003e\r\n                \u003cartifactId\u003epmd-rules\u003c/artifactId\u003e\r\n                \u003cversion\u003e1.2.4-pmd6\u003c/version\u003e\r\n            \u003c/dependency\u003e\r\n        \u003c/dependencies\u003e\r\n    \u003c/plugin\u003e\r\n\r\nYou have to add my [Mvn2Repo](https://blog.code-cop.org/p/mvn2repo.html) to your Maven repositories to get the releases.\r\n\r\n### License\r\n\r\n[New BSD License](http://opensource.org/licenses/bsd-license.php), see `license.txt` in repository.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecop%2Fpmd-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodecop%2Fpmd-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecop%2Fpmd-rules/lists"}