Page 1 of 1

Automated refactoring tools

Posted: Sun Sep 07, 2008 3:59 am
by josh
Ok, so I've been searching for tools to help me work faster, after recently discovering having >2 monitors and GUI based debugging, I feel like I've been doing things the "hard" way and want to eliminate as much redundancy in my work habits.

What I'm looking for is tools to help me visualize my object hierarchy, and identify areas that need re factoring according to some of these methods here:
http://www.refactoring.com/catalog/index.html

Being able to automatically extract duplicate code into functions, rename objects, reorder parameter orders etc.. would be a plus. Is there anything like this that comes close for PHP? Is there a tool for another language that will do this?

So far the closest things I found was PHPdocumenter, smalltalk and eclipse for java... there has to be something, even if it is limited in functionality. File find and replace is a huge pain

Re: Automated refactoring tools

Posted: Sun Sep 07, 2008 2:26 pm
by Christopher
I have not found anything when I have occasionally searched. What did you find in PHPdocumenter? I have read some code metrics projects for PHP ... those might be the basis of refactoring.

Re: Automated refactoring tools

Posted: Sun Sep 07, 2008 8:11 pm
by josh
PHPdocumenter doesn't do anything my IDE doesn't already do..

http://www.phpcompiler.org/spinoffs/#refactoring this looks promising,

I emailed another company that has written re factoring tools for a bunch of other languages and said they'd be willing to port it..

I mean if I could highlight a variable and rename it in 1000 places without having to write a regex find and replace each time, and highlight code and have it automatically create a method and update any place in the application where that same code appeared, those 2 features right there could probably cut a ton of time off development, I've heard eclipse does it.. for java

Re: Automated refactoring tools

Posted: Mon Sep 08, 2008 3:35 pm
by alex.barylski

Re: Automated refactoring tools

Posted: Mon Sep 08, 2008 4:34 pm
by onion2k
Eclipse has some refactoring tools in it. I've only just started playing around with it so I've not tried them yet.

Re: Automated refactoring tools

Posted: Mon Sep 08, 2008 4:49 pm
by jayshields
NetBeans has alot of refactoring tools for Java. It also has a PHP plug-in. I've not tried the refactoring options with the PHP plug-in though, I guess it won't work but it's probably worth a try.

Re: Automated refactoring tools

Posted: Tue Sep 09, 2008 7:21 pm
by Weirdan
For metrics you could use PHPUnit or PEAR's PHP_CodeSniffer. They don't have any tools to perform refactoring though.

Re: Automated refactoring tools

Posted: Tue Sep 09, 2008 7:53 pm
by josh
The metrics tools will help prioritize problem areas more efficiently, thanks