in reply to My code refactoring journey

I just wanted to mention a tool that can be helpful for this kind of work:

CPD: A Copy and Paste detector. It is written in Java but also works for Perl.

Replies are listed 'Best First'.
Re^2: My code refactoring journey
by talexb (Chancellor) on Aug 30, 2007 at 14:46 UTC

    This looks like an interesting tool, and I have no objections to a tool *written* in Java, except that this one also appears to be written *for* Java, and it appears one needs to create rulesets in order to use this. Very neat suggestion, though.

    Heh -- and now I have another itch to scratch -- a software tool that locates copied and pasted code. Hmm .. I do have a grid engine at my disposal ..

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      Although there is no explicit ruleset for Perl available it works quite well. I tried it before a ruleset for PHP was available, maybe it works even better now...

      Just give it a try.

      And you do not need a grid engine for this - ckeching a medium sized project with the CPD works really fast on an average workstation.

Re^2: My code refactoring journey
by erroneousBollock (Curate) on Sep 01, 2007 at 04:41 UTC
    My understanding of the Git version-control system is that it detects quite well where code has been copied, renamed, moved, or transcribed.

    It's maybe not as oriented to the task as CPD, but another approach to the same problem (with further benefits).

    -David