Automated refactoring tools

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Automated refactoring tools

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Automated refactoring tools

Post 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.
(#10850)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Automated refactoring tools

Post 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
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Automated refactoring tools

Post by alex.barylski »

User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Automated refactoring tools

Post 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.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Automated refactoring tools

Post 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.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Automated refactoring tools

Post by Weirdan »

For metrics you could use PHPUnit or PEAR's PHP_CodeSniffer. They don't have any tools to perform refactoring though.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Automated refactoring tools

Post by josh »

The metrics tools will help prioritize problem areas more efficiently, thanks
Post Reply