Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/pmdPublic

[core] Provide a CpdAnalysis class as a programmatic entry point into CPD #4204

Closed
Assignees
jsotuyod
Labels
an:enhancementAn improvement on existing features / rules
Milestone
@jsotuyod

Description

@jsotuyod

We already have aPmdAnalysis class that serves as a programatic (non-CLI) entry point for PMD. This allows, the CLI, ANT, IDEs and other tools to trigger an analysis in an agnostic way.

We don't have anything equivalent for CPD, with theCPD,CPDConfiguration andCPDCommandLineInterface all mingled and dirty with CLI specific things (ie: theCPDConfiguration actually has the JCommander annotations).

What we would need to do:

  • Explicitly convertCPDConfiguration into a pure "analysis configuration" class, equivalent toPMDConfiguration. Is there anyway to "deprecate" the annotations in PMD 6 beyond a javadoc notice?
  • Consolidate how PMD / CPD collect analysis files
    • Since we are aligning how PMD / CPD manage analysis sources, it may make sense to pull up those attributes and methods toAbstractConfiguration
    • ExtendFileCollector to accept any kind of configuration, either for PMD or CPD
      • Tricky part:FileCollector depends onLanguageDiscoverer which is PMD-specific (CPD and PMD Language classes are unrelated), CPD on the other hand uses aFileExtensionFilter).
  • Implement aCpdAnalysis class in the same shape asPmdAnalysis. There may be an opportunity here to have a shared interface, but I'm not sure if this would be worth it.
  • HookCpdAnalysis intoCPD to retain behavior, and explicitly stateCpdAnalysis to be the replacement for the already deprecatedCPD.

I've a local branch where I've already started working on some of these items.

Metadata

Metadata

Assignees

Labels

an:enhancementAn improvement on existing features / rules

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2026 Movatter.jp