Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Merge CPD and PMD language #3919

Closed
oowekyala opened this issue Apr 15, 2022 · 0 comments · Fixed by #4397
Closed

[core] Merge CPD and PMD language #3919

oowekyala opened this issue Apr 15, 2022 · 0 comments · Fixed by #4397
Labels
an:enhancement An improvement on existing features / rules in:cpd Affects the copy-paste detector
Milestone

Comments

@oowekyala
Copy link
Member

oowekyala commented Apr 15, 2022

Is your feature request related to a problem? Please describe.
CPD and PMD both publish a Language interface which is redundant. Using a single interface would allow sharing more infrastructure between the two programs, eg TextDocument logic (#3784).

Describe the solution you'd like
Initially described in #3782:

Another key concern of mine is to merge PMD's language and CPD's language. That is, all languages, regardless of whether cpd.Language or pmd.Language should be registered the same way. In PMD 6 we sort of have that: CPD-only languages are registered also as PMD languages but are useless. They caused problems as they needed to be filtered out manually in some places.

In PMD 7 I think we can do better than that. LanguageRegistry could be made non-static and contain a list of languages. Then you can have a LanguageRegistry instance that contains all languages that support PMD, and another that contains the CPD languages.

This needs #3918: we could have a LanguageRegistry for languages that support PMD, and another for languages that only support CPD.

@oowekyala oowekyala added an:enhancement An improvement on existing features / rules in:cpd Affects the copy-paste detector labels Apr 15, 2022
@oowekyala oowekyala added this to the 7.0.0 milestone Apr 15, 2022
@oowekyala oowekyala mentioned this issue Apr 25, 2022
5 tasks
@oowekyala oowekyala added this to To do in PMD 7 Apr 30, 2022
@adangel adangel changed the title [core] [cpd] Merge CPD and PMD language [core,cpd] Merge CPD and PMD language Jan 13, 2023
@adangel adangel modified the milestones: 7.0.0, 7.x Jan 23, 2023
@adangel adangel removed this from To do in PMD 7 Jan 23, 2023
@oowekyala oowekyala mentioned this issue Feb 16, 2023
5 tasks
@oowekyala oowekyala linked a pull request Feb 18, 2023 that will close this issue
5 tasks
@adangel adangel modified the milestones: 7.x, 7.0.0 Aug 22, 2023
@adangel adangel changed the title [core,cpd] Merge CPD and PMD language [core] Merge CPD and PMD language Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
an:enhancement An improvement on existing features / rules in:cpd Affects the copy-paste detector
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants