quality/duplication-gate/java
Duplicated code is measured
Implements quality/duplication-gate for java.
| Severity | info |
| Tiers | 1 |
| Stacks | java |
| Scope | root |
| Kind | outcome |
| Source | library v0.5.0 |
| Selected by | fleetlint-recommended@v0.5.0 |
Requirement
PMD’s copy-paste detector runs: maven-pmd-plugin’s cpd-check, the Gradle CPD plugin’s cpdCheck, or pmd cpd in the task runner or CI; or a stack-neutral detector.
Why
Near-duplicate implementations are how a fix lands in one copy and not the other; a detector makes the second copy visible at review time.
Fix
Bind maven-pmd-plugin’s cpd-check goal, or apply the de.aaschmid.cpd Gradle plugin so ./gradlew check runs cpdCheck.
Agent instruction: Add the stack’s duplication detector to the lint target with a threshold, and remove or merge the duplicates it reports rather than raising the threshold.
A finding of this rule points at the file (["pom.xml", "build.gradle.kts", "build.gradle"].filter(f, file(f)) + ["pom.xml"])[0] yields.
Sources
- https://fleetlint.org/baseline/#design (convention)
- https://pmd.github.io/pmd/pmd_userdocs_cpd.html (spec)
- https://fleetlint.org/stacks/#java
Generated by fleetlint docs from catalog v0.5.0.