Tom Copeland's Recent Posts

RSS Feeds

« PMD 4.1 released! | Main | Updates for the Ruby PostgreSQL native driver »

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83451d3c069e200e5505cd9c88833

Listed below are links to weblogs that reference Finding copy/pasted code in a Rails app:

Comments

Excellent. I'll be making use of this immediately. I miss CPD and PMD since I started my Ruby on Rails work.

Lori - Yup, lots of Rails work to be done these days... my JBuilder plugin skills are getting pretty rusty :-)

Is a LR(*) parser capable of during a proper Ruby parse? The C version uses a LALR parser, and I think JRuby just copies the parse table from the C code.

Ruby has so many rules for binding, because you never know what might be a symbol, function, variable, or class. Is it possible to parse Ruby without executing it? I know some people have been trying to build tools to allow code refactoring in Ruby, but it is quite difficult to do.

Brian - The nice thing about CPD is that it only needs a tokenizer, which should be much easier than building a full parser. Also, you're right, Ruby does so much at runtime that a static analysis is difficult... but Tor Norbye seems to be doing a good job of building heuristics to do things like "rename local variable" and "go to declaration" for Netbeans...

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.