3 ms·
Perltidy just handles formatting. Scary basement code is often poorly formatted and reformatting is a necessary first step in fixing it, but it's a trivial firs
by DougWebb 16y ago
Perltidy just handles formatting. Scary basement code is often poorly formatted and reformatting is a necessary first step in fixing it, but it's a trivial first step. It doesn't address the hard part.
Perlcritic is closer to what you're thinking of; it examines the structure of the code and points out design and implementation problems. It can't fix them for you though, and it only handles common designs that it knows about. It can't judge the quality of a design that it's not already programmed to recognize. Again, a useful tool for fixing all of the common problems, but it can't address the overall design.
The refactoring tools in IDEs like Visual Studio are useful too, but they don't understand your code in a way that would help redesign it. They just automate much of the process of extracting code from one method to another method/class. Useful, but not redesigning your code for you.
Ultimately, it takes an intelligent software designer to do this kind of work. Maybe artificial intelligence will handle it some day, but that's not coming for a while.