I'd like to modify CPD to only spit out the "Found a X line (Y tokens) duplication in the following files: ... " when generating a report, i.e. supress the source lines of code. I have the /src/ files and attempted to modify SimpleRenderer.java in /src/net/sourceforge/pmd/cpd/ by commenting out
String source = match.getSourceCodeSlice();
if (trimLeadingWhitespace) {
String[] lines = source.split("[" + PMD.EOL + "]");
int trimDepth = StringUtil.maxCommonLeadingWhitespaceForAll(lines);
if (trimDepth > 0) {
lines = StringUtil.trimStartOn(lines, trimDepth);
}
for (int i=0; i<lines.length; i++) {
rpt.append(lines[i]).append(PMD.EOL);
}
return;
}
However the report has not changed. I'm a bit of a Java noice, so keep that in mind. Do I need to rebuild the pmd-4.2.x in Eclipse somehow?
Thanks in advance!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd like to modify CPD to only spit out the "Found a X line (Y tokens) duplication in the following files: ... " when generating a report, i.e. supress the source lines of code. I have the /src/ files and attempted to modify SimpleRenderer.java in /src/net/sourceforge/pmd/cpd/ by commenting out
However the report has not changed. I'm a bit of a Java noice, so keep that in mind. Do I need to rebuild the pmd-4.2.x in Eclipse somehow?
Thanks in advance!
Cross-posting in stack overflow: http://stackoverflow.com/questions/33441751/how-to-change-pmds-copy-paste-detector-cpd-report-output