Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.6k
Closed
Description
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 convert
CPDConfigurationinto 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 to
AbstractConfiguration - Extend
FileCollectorto accept any kind of configuration, either for PMD or CPD- Tricky part:
FileCollectordepends onLanguageDiscovererwhich is PMD-specific (CPD and PMD Language classes are unrelated), CPD on the other hand uses aFileExtensionFilter).
- Tricky part:
- Since we are aligning how PMD / CPD manage analysis sources, it may make sense to pull up those attributes and methods to
- Implement a
CpdAnalysisclass 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. - Hook
CpdAnalysisintoCPDto retain behavior, and explicitly stateCpdAnalysisto be the replacement for the already deprecatedCPD.
I've a local branch where I've already started working on some of these items.