automated-refactoring

Automatically deleting unused local variables from C source code

I want to delete unused local variables from C file. Example: int fun(int a , int b) { int c,sum=0; sum=a + b; return sum; } Here the unused variable is 'c'. I will externally have a list of all unused local variables. Now using unused local variables which I have, we have to find local variables from source code & delete. I...

Are there any open source command line tools to refactor java code?

I use vim as my editor but I would like to get some of the same power of the IDE's for java when it comes to refactoring. Are there any commandline tools for refactoring java? I could probably hack something together using perl or vim scripting but if there is something already out there I'd rather use that. ...

php code smell detector

Regarding the php code smell detector at http://c2.com/cgi/wiki?DetectingCodeSmellsInPhp When I open it in my web browser, I get an error, but when I open it in my IDE, I don't. How to correct it? ...

How to refactor this Ruby (controller) code?

This is the code in my reports controller, it just looks so bad, can anyone give me some suggestions on how to tidy it up? # app\controller\reports_controller.rb @report_lines = [] @sum_wp, @sum_projcted_wp, @sum_il, @sum_projcted_il, @sum_li,@sum_gross_profit ,@sum_opportunities = [0,0,0,0,0,0,0] date = @start_date num_of_...

Programming Language Properties that facilitate refactoring?

What are common traits/properties of programming languages that facilitate (simplify) the development of widely automated source code analysis and re-engineering (transformation) tools? I am mostly thinking in terms of programming language features that make it easier to develop static analysis and refactoring tools (i.e. compare Java v...

Tools for refactoring C# public fields into properties

I have a lot of C# code that uses public fields, and I would like to convert them to properties. I have Resharper, and it will do them one by one, but this will take forever. Does anyone know of an automated refactoring tool that can help with this? ...

Is there an application that can convert PHP code to ASP.Net?

I'm tired. I have ~30 really messy PHP files in my project. Hearing people say that Asp.net is more structured , that it is better (I'm mostly relying on Jeff's advice @codinghorror here) and that it is possible to use asp.net without using bloated software from M$. I don't want to and will not convert the the work done upto now, by hand...

Is there a way to find all unused code in a .NET project using ReSharper?

I've just done a major, major overhaul on a colleagues project and throughout the process almost everything got rewritten. There was far too much code beforehand. Now, I am left with the prospect that in amongst my project somewhere are old pre-refactoring methods that are no longer needed. Is there a way to search the whole project fo...

Visual Assist X: curly braces are moving during refactoring

I use Visual Assist X, build from 05.01.2009, but the same problem occurred in the previous releases as well. (I run it on MSVS 2005) When I do some refactoring (like extracting a method), everything's fine, but all the curly braces move forward. For example, before refactoring the code looked like this: while (expr) { doSmth(); } ...

Is the Eclipse CDT Refactoring Project Dead?

I've been over to the site lately and nothing much seems to work (aside from the main page) ...

How to refactor a static inner class to a top level class in Eclipse?

I am having trouble finding the correct refactor option for the following scenario: I have code like this (in Outer.java): public class Outer { // ... class stuff public static class Inner { // ... inner class stuff } } I am looking for a way to select Inner, and have it converted to a top level class, in it'...

Visual studio: automatically update C++ cpp/header file when the other is changed?

For example, if I change the signature in a function in either the header or the cpp, I'd like it to automatically change in the other one. If I add a new function in either, it should appear in both. If I delete a function, it could probably comment out the other one. Manually having to duplicate one's changes seems silly. Some people ...

Refactor Pro versus Visual Assist X for C++ Development

There are two major refactoring tools which can be installed for Visual Studio that provide C++ support. The full versions of both tools are $250, and they seem to offer similar functionality. They are: Developer Express' Refactor Pro + CodeRush Whole Tomato's Visual Assist X Which tool is better? EDIT: My initial evaluation of the ...

XHTML 1.0 Transitive, is there a tool that can refactor HTML?

I have a Asp.net web application running with the following config setting. <xhtmlConformance mode="Legacy"/> This limits use of AJAX and compatibility with multiple browser. If my understanding is correct, the HTML code of the aspx pages need to be fixed to comply with XHTML 1.0 Transitional. There are alot of HTML pages, ~1000, i...

PMD code smell detection and refactoring

(I develop using JAVA and want to implement plugin in eclipse which can detect code smell and automate refactoring) 1) Initialy, I would like to find a smell detector library in order to get the smell existing in the class. I installed PMD plugin in Eclipse and try using it. I want to get all information which is represented in a views ...

WCF client proxy class renaming problem

Perhaps others have encountered the same problem. It seems the default class name for a WCF client proxy is Service1Client. When I delete the service reference and recreate it the name keeps coming up the same. (Although it does give me the opportunity to name the namespace.) When I chose Refactor/Rename on Service1Client (ie: the cl...

Code refactoring

I am about to starting to work on a project which involves refactoring and modifying existing code which is in c & c++. The code is a bloated one and is in huge volume. Ofcourse since the code needs to be modified an understanding of the code has to be developed and in a very short span of time since we have some pretty time pressed proj...

Eclipse/Java: Is there a way to move a field from one class to another and update the references automatically?

I'm working on code that's a bit of a mess right now and am doing a lot of refactoring. Is there a way to move a field from one class to another and update the references automatically? I've used Eclipse's refactoring capabilities quite a bit, but I can't figure out a way to automate this. For instance, ideally I would drag the privat...

Java source refactoring of 7000 references

Hi guys, I have a huge problem. My supervisors want me to change a piece of java code which can effect whole project. I need to change the signature of the void log(String) method which should take two more arguments (Class c, String methodName). Eclipse obtained 7000 references to that method and if i change it, the whole project wil...

Does anyone have a tool which can automatically attempt to refactor javascript to a more prototype/oo style?

It looks to me like it might be possible to, in many cases, automatically perform some of the refactoring required to turn a functional and/or class style javascript source into a more prototype/non-class based oo source. Has anyone made a serious attempt at writing a tool that does this kind of automatic refactoring? ...