Reputation: 20073
I'm using PMD tool and I can check at project level for "Find Suspect Copy & Paste".
The problem is, I just want to check on class.
Does anyone know of a way to check just one class? I can do the check for violations on one class fine, but not the suspect copy and paste.
Does anyone have any experience of this or an example they could provide?
Thanks,
Upvotes: 0
Views: 636
Reputation: 114817
Suspect Copy&Paste usually works across classes - it detects avoidable code duplication. So it shouldn't work as expected, if you exclude all other code units from validation. (And checking on class level is pretty equivalent to excluding all other classes)
Upvotes: 1
Reputation: 15675
If you use the maven pmd plugin, you can specify exclude and include patterns that will let you single out your class. Without maven, I guess you should be able to run the plugin raw. I don't know how to do it from eclipse directly.
Upvotes: 1