{"id":15091240,"url":"https://github.com/dgroup/arch4u-pmd","last_synced_at":"2025-04-12T04:43:17.173Z","repository":{"id":36988302,"uuid":"444561197","full_name":"dgroup/arch4u-pmd","owner":"dgroup","description":"Linting rules for Java frameworks like Spring, Quarkus, Jackson, SLF4J, etc., to avoid known problems in REST API, logging, observability, performance, and general best practices.","archived":false,"fork":false,"pushed_at":"2024-10-20T18:51:28.000Z","size":343,"stargazers_count":26,"open_issues_count":34,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-22T06:00:16.762Z","etag":null,"topics":["jackson-json","java","logging","monitoring","open-api","pmd","pmd-ruleset","quark","quarkus","rest-api","slf4j","spring","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgroup.png","metadata":{"files":{"readme":"readme.md","changelog":"history.md","contributing":".github/contributing.md","funding":null,"license":"license.txt","code_of_conduct":".github/code_of_conduct.md","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":"2022-01-04T20:57:30.000Z","updated_at":"2024-09-29T17:24:03.000Z","dependencies_parsed_at":"2023-01-17T12:30:58.354Z","dependency_job_id":"8ba1b5b3-9243-43fe-ad1d-8b6074a7155d","html_url":"https://github.com/dgroup/arch4u-pmd","commit_stats":{"total_commits":158,"total_committers":8,"mean_commits":19.75,"dds":0.4810126582278481,"last_synced_commit":"4ebe092d5044d1f1c97142912c4f6f99cbc02fd8"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroup%2Farch4u-pmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroup%2Farch4u-pmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroup%2Farch4u-pmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroup%2Farch4u-pmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgroup","download_url":"https://codeload.github.com/dgroup/arch4u-pmd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222391417,"owners_count":16976550,"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":["jackson-json","java","logging","monitoring","open-api","pmd","pmd-ruleset","quark","quarkus","rest-api","slf4j","spring","spring-boot"],"created_at":"2024-09-25T10:36:38.187Z","updated_at":"2025-03-28T15:32:53.770Z","avatar_url":"https://github.com/dgroup.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven](https://img.shields.io/maven-central/v/io.github.dgroup/arch4u-pmd.svg)](https://mvnrepository.com/artifact/io.github.dgroup/arch4u-pmd)\n[![Javadocs](http://www.javadoc.io/badge/io.github.dgroup/arch4u-pmd.svg)](http://www.javadoc.io/doc/io.github.dgroup/arch4u-pmd)\n[![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](./license.txt)\n[![Commit activity](https://img.shields.io/github/commit-activity/y/dgroup/arch4u-pmd.svg?style=flat-square)](https://github.com/dgroup/arch4u-pmd/graphs/commit-activity)\n[![Hits-of-Code](https://hitsofcode.com/github/dgroup/arch4u-pmd)](https://hitsofcode.com/view/github/dgroup/arch4u-pmd)\n\n[![CI](https://github.com/dgroup/arch4u-pmd/actions/workflows/build.yml/badge.svg)](https://github.com/dgroup/arch4u-pmd/actions/workflows/build.yml)\n[![Known Vulnerabilities](https://snyk.io/test/github/dgroup/arch4u-pmd/badge.svg)](https://app.snyk.io/org/dgroup/project/c8b51bb3-7683-41c8-9a4e-b32a6f9069b6)\n\n[![Qulice](https://img.shields.io/badge/qulice-passed-blue.svg)](http://www.qulice.com/)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=dgroup_arch4u-pmd\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=dgroup_arch4u-pmd)\n[![codebeat badge](https://codebeat.co/badges/07852d4a-459c-4775-949d-833e3eeebcfe)](https://codebeat.co/projects/github-com-dgroup-arch4u-pmd-master)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/53d3d211de354b45a06aaa82dcf432b5)](https://www.codacy.com/gh/dgroup/arch4u-pmd/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=dgroup/arch4u-pmd\u0026amp;utm_campaign=Badge_Grade)\n[![Codecov](https://codecov.io/gh/dgroup/arch4u-pmd/branch/master/graph/badge.svg)](https://codecov.io/gh/dgroup/arch4u-pmd)\n\n* [Overview](#overview)\n* [How to use?](#how-to-use)\n    * [Maven (pom.xml)](#maven-pomxml)\n    * [Gradle (build.gradle)](#gradle-buildgradle)\n    * [Include arch4u-pmd rules into your existing custom ruleset](#include-arch4u-pmd-rules-into-your-existing-custom-ruleset)\n    * [Exclude particular rule](#exclude-particular-rule)\n    * [Reconfigure a rule](#reconfigure-a-rule)\n    * [Exclude particular folder from inspection](#exclude-particular-folder-from-inspection)\n* [How to contribute?](#how-to-contribute)\n* [Contributors](#contributors)\n\n### Overview\n\n**arch4u-pmd** is a library with pmd rules that bring new regulations related to known problems in\nREST API, logging, monitoring, etc., including reconfigured default pmd\nrules to decrease false-positive\nviolations during usage of well-known frameworks like Spring, Quarkus, etc.\n\nIn addition to our custom/reconfigured rules we are using the latest stable pmd-java version which is `7.6.0` with more\nthan [320+ rules](https://docs.pmd-code.org/pmd-doc-7.6.0/pmd_rules_java.html) with default configuration.\n\nLegend:\n\n- ✅ included in `arch4u-ruleset.xml`\n- ⌛ planned for review considering framework(s) architecture\n- 🌵 temporary disabled or reconfigured in `arch4u-ruleset.xml`\n- ❌ disabled/not planned in `arch4u-ruleset.xml`\n\n| PMD rule                                                                                                                                  |      Provider      | Status | Spring | Quarkus |\n|:------------------------------------------------------------------------------------------------------------------------------------------|:------------------:|:------:|:------:|:-------:|\n| [UseExistingMediaTypeConstant](https://github.com/dgroup/arch4u-pmd/discussions/43)                                                       | `arch4u-pmd:0.1.0` |   ✅    |   ✅    |    ⌛    |\n| [UseOpenApiInRestEndpoints](https://github.com/dgroup/arch4u-pmd/discussions/73)                                                          | `arch4u-pmd:0.1.0` |   ✅    |   ✅    |    ⌛    |\n| [RestEndpointsWithoutExposedMetrics](https://github.com/dgroup/arch4u-pmd/discussions/74)                                                 | `arch4u-pmd:0.1.0` |   ✅    |   ✅    |    ⌛    |\n| [UseConstantAsMetricName](https://github.com/dgroup/arch4u-pmd/discussions/75)                                                            | `arch4u-pmd:0.1.0` |   ✅    |   ✅    |    ⌛    |\n| [NoMandatoryConstructorInExceptionClass](https://github.com/dgroup/arch4u-pmd/discussions/31)                                             | `arch4u-pmd:0.1.0` |   ✅    |   ✅    |    ⌛    |\n| [AvoidUsingObjectMapperAsALocalVariable](https://github.com/dgroup/arch4u-pmd/discussions/30)                                             | `arch4u-pmd:0.1.0` |   ✅    |   ✅    |    ⌛    |\n| [AvoidMdcOutsideTryStatement](https://github.com/dgroup/arch4u-pmd/discussions/86)                                                        | `arch4u-pmd:0.1.0` |   ✅    |   ✅    |    ⌛    |\n| [PotentiallyThreadLocalPollutionByMdc](https://github.com/dgroup/arch4u-pmd/discussions/88)                                               | `arch4u-pmd:0.1.0` |   ✅    |   ✅    |    ⌛    |\n| [GuardLogStatement](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#guardlogstatement)                                     | `pmd-java:7.6.0`  |   ❌    |   ❌    |    ❌    |\n| [JUnitAssertionsShouldIncludeMessage](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#junitassertionsshouldincludemessage) | `pmd-java:7.6.0`  |   🌵   |   ⌛    |    ⌛    |\n| [UnusedPrivateMethod](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#unusedprivatemethod)                                 | `pmd-java:7.6.0`  |   🌵   |   ⌛    |    ⌛    |\n| [AtLeastOneConstructor](https://pmd.github.io/latest/pmd_rules_java_codestyle.html#atleastoneconstructor)                                 | `pmd-java:7.6.0`  |   🌵   |   ✅    |    ⌛    |\n| [OnlyOneReturn](https://pmd.github.io/latest/pmd_rules_java_codestyle.html#onlyonereturn)                                                 | `pmd-java:7.6.0`  |   🌵   |   ⌛    |    ⌛    |\n| [CommentRequired](https://pmd.github.io/latest/pmd_rules_java_documentation.html#commentrequired)                                         | `pmd-java:7.6.0`  |   🌵   |   ⌛    |    ⌛    |\n| [AvoidCatchingGenericException](https://pmd.github.io/latest/pmd_rules_java_design.html#avoidcatchinggenericexception)                    | `pmd-java:7.6.0`  |   ⌛    |   ⌛    |    ⌛    |\n| [CouplingBetweenObjects](https://pmd.github.io/latest/pmd_rules_java_design.html#couplingbetweenobjects)                                  | `pmd-java:7.6.0`  |   🌵   |   ⌛    |    ⌛    |\n| [LawOfDemeter](https://pmd.github.io/latest/pmd_rules_java_design.html#lawofdemeter)                                                      | `pmd-java:7.6.0`  |   ❌    |   ❌    |    ❌    |\n| [LoosePackageCoupling](https://pmd.github.io/latest/pmd_rules_java_design.html#loosepackagecoupling)                                      | `pmd-java:7.6.0`  |   ⌛    |   ⌛    |    ⌛    |\n| [SignatureDeclareThrowsException](https://pmd.github.io/latest/pmd_rules_java_design.html#signaturedeclarethrowsexception)                | `pmd-java:7.6.0`  |   ⌛    |   ⌛    |    ⌛    |\n| [TooManyFields](https://pmd.github.io/latest/pmd_rules_java_design.html#toomanyfields)                                                    | `pmd-java:7.6.0`  |   🌵   |   ⌛    |    ⌛    |\n| [TooManyMethods](https://pmd.github.io/latest/pmd_rules_java_design.html#toomanymethods)                                                  | `pmd-java:7.6.0`  |   🌵   |   ⌛    |    ⌛    |\n| [UseObjectForClearerAPI](https://pmd.github.io/latest/pmd_rules_java_design.html#useobjectforclearerapi)                                  | `pmd-java:7.6.0`  |   ❌    |   ❌    |    ❌    |\n| [AtLeastOneConstructor](https://pmd.github.io/latest/pmd_rules_java_codestyle.html#atleastoneconstructor)                                 | `pmd-java:7.6.0`  |   ❌    |   ❌    |    ❌    |\n| [UseUtilityClass](https://pmd.github.io/latest/pmd_rules_java_design.html#useutilityclass)                                                | `pmd-java:7.6.0`  |   🌵   |   ✅    |    ⌛    |\n| [ShortClassName](https://pmd.github.io/latest/pmd_rules_java_codestyle.html#shortclassname)                                               | `pmd-java:7.6.0`  |   🌵   |   ✅    |    ✅    |\n| [ImmutableField](https://pmd.github.io/latest/pmd_rules_java_design.html#immutablefield)                                                  | `pmd-java:7.6.0`  |   🌵   |   ✅    |    ✅    |\n| [LongVariable](https://pmd.github.io/latest/pmd_rules_java_codestyle.html#longvariable)                                                   | `pmd-java:7.6.0`  |   🌵   |   ✅    |    ✅    |\n\n### How to use?\n\n#### Maven (pom.xml)\n\n ```xml\n ...\n\u003cbuild\u003e\n    \u003cplugins\u003e\n        ...\n        \u003cplugin\u003e\n            \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n            \u003cartifactId\u003emaven-pmd-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e3.15.0\u003c/version\u003e\n            \u003cexecutions\u003e\n                \u003cexecution\u003e\n                    \u003cphase\u003etest\u003c/phase\u003e\n                    \u003cgoals\u003e\n                        \u003cgoal\u003echeck\u003c/goal\u003e\n                    \u003c/goals\u003e\n                \u003c/execution\u003e\n            \u003c/executions\u003e\n            \u003cconfiguration\u003e\n                \u003cprintFailingErrors\u003etrue\u003c/printFailingErrors\u003e\n                \u003crulesets\u003e\n                    ...\n                    \u003cruleset\u003eio/github/dgroup/arch4u/pmd/arch4u-ruleset.xml\u003c/ruleset\u003e\n                    ...\n                \u003c/rulesets\u003e\n                \u003cexcludeRoots\u003e\n                    \u003cexcludeRoot\u003etarget/generated-sources/\u003c/excludeRoot\u003e\n                \u003c/excludeRoots\u003e\n            \u003c/configuration\u003e\n            \u003cdependencies\u003e\n                \u003c!-- Latest arch4u-rules --\u003e\n                \u003cdependency\u003e\n                    \u003cgroupId\u003eio.github.dgroup\u003c/groupId\u003e\n                    \u003cartifactId\u003earch4u-pmd\u003c/artifactId\u003e\n                    \u003cversion\u003e${version}\u003c/version\u003e\n                \u003c/dependency\u003e\n            \u003c/dependencies\u003e\n        \u003c/plugin\u003e\n        ...\n    \u003c/plugins\u003e\n\u003c/build\u003e\n        ...\n ```\n\n#### Gradle (build.gradle)\n\n ```groovy\n apply plugin: 'pmd'\n\ndependencies {\n    ...\n    pmd \"io.github.dgroup:arch4u-pmd:${version}\"    // use latest arch4u-pmd rules version\n    pmd \"commons-io:commons-io:2.11.0\"              // required dependency by pmd engine\n    ...\n}\n\npmd {\n    consoleOutput = true\n    ruleSetFiles = files(\"io/github/dgroup/arch4u/pmd/arch4u-ruleset.xml\")\n    ruleSets = []                                   // Keep it as is, workaround for pmd\n}\n ```\n\n#### Include arch4u-pmd rules into your existing custom ruleset\n\n0. Don't forget to add rules to classpath in Maven/Gradle pmd plugin (see lines above)\n1. Let's assume that you already have pmd rules defined in `your-pmd-ruleset.xml`\n2. Add line `\u003crule ref=\"io/github/dgroup/arch4u/pmd/arch4u-ruleset.xml\"/\u003e` to `your-pmd-ruleset.xml`\n   ```xml\n   \u003c?xml version=\"1.0\"?\u003e\n   \u003cruleset name=\"pmd ruleset with your rules\"\n     xmlns=\"http://pmd.sourceforge.net/ruleset/2.0.0\"\n     xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n     xsi:schemaLocation=\"http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd\"\u003e\n    \n     ...\n     \u003crule ref=\"io/github/dgroup/arch4u/pmd/arch4u-ruleset.xml\"/\u003e\n     ...\n\n   \u003c/ruleset\u003e\n   ```\n\n#### Exclude particular rule\n\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003cruleset name=\"pmd ruleset with your rules\"\u003e\n    ...\n    \u003crule ref=\"io/github/dgroup/arch4u/pmd/arch4u-ruleset.xml\"\u003e\n        \u003cexclude name=\"UseExistingMediaTypeConstant\"/\u003e\n    \u003c/rule\u003e\n    ...\n\u003c/ruleset\u003e\n```\n\n#### Reconfigure a rule\n\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003cruleset name=\"pmd ruleset with your rules\"\u003e\n    ...\n    \u003c!-- 1. Exclude rule with default configuration  --\u003e\n    \u003crule ref=\"io/github/dgroup/arch4u/pmd/arch4u-ruleset.xml\"\u003e\n        \u003cexclude name=\"UseExistingMediaTypeConstant\"/\u003e\n    \u003c/rule\u003e\n    \u003c!-- 2. Reconfigure rule with expected property --\u003e\n    \u003crule name=\"UseExistingMediaTypeConstant\"\n          language=\"java\"\n          externalInfoUrl=\"https://github.com/dgroup/arch4u-pmd/discussions/43\"\n          message=\"Use existing MediaType constant instead of string literal: https://github.com/dgroup/arch4u-pmd/discussions/43\"\n          class=\"io.github.dgroup.arch4u.pmd.UseExistingConstant\"\u003e\n        \u003cpriority\u003e3\u003c/priority\u003e\n        \u003cproperties\u003e\n            \u003c!-- 3. Set the 'regexPattern' considering your needs --\u003e\n            \u003cproperty name=\"regexPattern\" description=\"Regular expression of prohibited string\"\n                      value=\"(^|\\s)(application\\/(json|xml|atom\\+xml|x-www-form-urlencoded|octet-stream|svg\\+xml|xhtml\\+xml)|(multipart\\/form-data)|(text\\/(html|xml|plain)))(\\s|$)\"/\u003e\n        \u003c/properties\u003e\n    \u003c/rule\u003e\n    ...\n\u003c/ruleset\u003e\n```\n\n#### Exclude particular folder from inspection\n\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003cruleset name=\"pmd ruleset with your rules\"\u003e\n    ...\n    \u003c!-- Exclude target folder that may contain generated sources --\u003e\n    \u003cexclude-pattern\u003e.*/target/generated-sources/.*\u003c/exclude-pattern\u003e\n    \u003cexclude-pattern\u003e.*/build/generated-sources/.*\u003c/exclude-pattern\u003e\n    \u003c!-- Exclude test folder --\u003e\n    \u003cexclude-pattern\u003e.*/src/test/java/org/tbd/tbd/tbd/.*\u003c/exclude-pattern\u003e\n    ...\n\u003c/ruleset\u003e\n```\n\n### How to contribute?\n\n1. Pull requests are welcome! Don't forget to add your name to contribution section and run this,\n   beforehand:\n    ```bash\n    mvn -Pqulice clean install\n    ```\n2. Everyone interacting in this project’s codebases, issue trackers, chat rooms is expected to\n   follow the [code of conduct](.github/code_of_conduct.md).\n3. Latest maven coordinates [here](https://github.com/dgroup/arch4u-pmd/releases):\n    ```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003eio.github.dgroup\u003c/groupId\u003e\n        \u003cartifactId\u003earch4u-pmd\u003c/artifactId\u003e\n        \u003cversion\u003e${version}\u003c/version\u003e\n    \u003c/dependency\u003e\n    ```\n4. Download pmd rule designer\n    - https://pmd.github.io/latest/pmd_userdocs_extending_designer_reference.html\n\n### Contributors\n\n* [dgroup](https://github.com/dgroup) as Yurii Dubinka (\u003cyurii.dubinka@gmail.com\u003e)\n* [dykov](https://github.com/dykov) as Oleksii Dykov (\u003cdykovoleksii@gmail.com\u003e)\n* [smithros](https://github.com/smithros) as Rostyslav Koval (\u003ckovalr2000@gmail.com\u003e)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgroup%2Farch4u-pmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgroup%2Farch4u-pmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgroup%2Farch4u-pmd/lists"}