Closed soniccat closed 12 years ago
This project (Objective-C-CPD-Language) is only a language definition for CPD and cannot make changes to the function of CPD itself. CPD supports the scanning of more than 1 folder from the command line by appending multiple --file arguments as seen in the example below. Perhaps you could point to multiple folders and exclude the evernote folder.
java net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files [First Path] --files [Second Path] --language ObjectiveC --encoding UTF-8 --format net.sourceforge.pmd.cpd.XMLRenderer > cpd-output.xml
You could try getting the PMD/CPD guys to build this change into CPD or simply change your project structure so that included libraries are not in the same folder tree as your source code. I typically keep only my own source inside a Classes directory and keep all open source in a sibling folder.
Another option is to run some script that outputs list of files with excludes / includes and pass it's results to cpd --files option.
I have --files 'path/to/trunk' option. But it contains the iOS Evernote SDK which code is generated and it contains a lot of copy pasted code blocks). For example NoteStore.m has 36072 lines of code and contains more than 200 copy pasted code blocks. I think the best way to fix that is ignore that by adding option to discard special path.