File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes favorite duplicate code tool? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "favorite duplicate code tool?" Watch "favorite duplicate code tool?" New topic

favorite duplicate code tool?

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33117

Does anyone have a favorite tool for finding duplicate (copy/pasted) code? Preferably one that is Eclipse based or runs through Ant.

I'm aware that there are a number of tools out there for finding duplicate code, but sometimes finding out what people are really using is more valuable. Your opinions helped greatly when picking a code coverage tool.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
The only one I've used is CPD -which is part of PMD- and it does have an Ant task (not sure about Eclipse integration).
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
I've tried a view, but I didn't really use any of them regularly. I think it's because I don't find much value in refactoring code that I don't currently touch anyway, and than I typically spot the duplication without the use of a tool.

Another thing is that those tools can only spot syntactic duplication. Most often, it's the semantic duplication that's killing me - two parts of code that are doing the same thing in slightly different ways...

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33117

Interesting. Thanks guys.

Ilja: Thanks for adding something about the tools that I didn't think about
I agree. Here's the link:
subject: favorite duplicate code tool?
jQuery in Action, 3rd edition