refactoring tools
Posted: Tue Nov 07, 2006 10:17 pm
I'm sitting down today thinking...I'm gonna write a tool which removes code duplication or at least suggests when refactoring might be of use....
Then it hits me...instead of using a diff, if you abstracted slightly more and analyzed constructs, statements, etc...as a whole instead of on a character by character (or token) basis...you might be able to locate code fragments which are not just syntactically similar...but semantically as well...

Any articles on the subject, etc???
Not looking for the first 5 tools you can find on google eh...
Cheers
Then it hits me...instead of using a diff, if you abstracted slightly more and analyzed constructs, statements, etc...as a whole instead of on a character by character (or token) basis...you might be able to locate code fragments which are not just syntactically similar...but semantically as well...
Obviously the above duplicate code would be pointless to refactor, but I am sure in complex codebases you could find code which could be extracted and refactored...if($a == 'SomeDude')
if($someVar == 'SomeDude')
Any articles on the subject, etc???
Not looking for the first 5 tools you can find on google eh...
Cheers