CodeRush
Refactor! Pro
Simplify and Restructure Your Code
Making it Easier to Read and Less Costly to Maintain
Refactor! Pro by DevExpress fuses a language-independent state-of-the-art code shaping engine with a revolutionary and highly-optimized user experience. Unlike other refactoring solutions that target the system architect, Refactor! Pro is designed to help all developers craft and sculpt their code with the speed and efficiency needed to meet their line of business demands.
What is Refactoring?
Refactoring describes the process of making many small changes to working code, improving the internal structure without altering the external behavior of that code.
As an analogy, consider the math statement 2*4*5*3*1, you can covert this to 1*2*3*4*5 without changing its meaning and from there into 5!. They all mean the same thing but are increasingly easier to read. Refactor! does the same thing but with working source code.
There was a time not too long ago when just for fun developers would actually engage in obfuscated code competitions to produce the most difficult to read code. Well unfortunately there is a lot of code out there that is not much more readable than that intentionally obfuscated code - which is where refactoring comes in. The goal of refactoring is to take working code that is harder to read than it needs to be, and tweak its structure to make it more readable and more easily maintained.
.NET languages have been designed to self-document and encourage the development of readable, maintainable code - but even these languages code can grow organically over time and become cluttered and overly complex. Refactor! Pro has numerous industry-first features that can help you take this complex code and make it easier to read and less costly to maintain.
Why Refactor! Pro
Refactor! Pro does something no other tool can claim to do: it brings the power of an entire suite of refactoring tools to bear with just one key ("One Key Refactoring") and it works directly on your code in your editor - so you'll never have to leave your code just to restructure it.

Figure 1. One Key Refactoring - press CTRL+~ at any point to see all available refactorings with a short description of each.
Refactor! is built upon a language neutral architecture that offers exactly the same functionality for Visual Basic .NET, C#, C++ and ASP.NET developers. Refactor! even includes extensibility features to allow developers to easily build language-independent refactorings that can be used internally or shared with a growing community of highly satisfied Refactor! Pro customers.
Before we describe to you just a few of the over 190 refactorings available within the product, let us assure you that everything you can do with Refactor! can be rolled back using the standard Visual Studio Undo/Redo mechanism. So you really have the freedom to explore with this tool - simply hit CTRL+Z (or whatever key Undo is bound to) if the refactoring is not what you expected.
Refactoring: Reorder Parameters
Change the order of parameters in a Method signature, while also updating all calls to this method. Great when you need to change the parameter declaration order so that the most important parameters appear first, which will improve the usability of the method.
"Reorder Parameters" is probably the best example of how Refactor! is different, because the entire process is extremely visual and happens right there in your code. Here is how you reorder your parameters. Simply move the text cursor into the declaration of a method with parameters and this refactoring will be available. You can see that it is available if you stay there for a moment, because the refactoring smart tag will show up with a list of all the refactorings available. But you don't need to wait for anything - just hit the "One Key Refactoring" key (CTRL+~) and now you can move all your parameters left and right simply using the left and right cursor keys.
Reorder Parameters is a cascading refactoring. It changes the method signature across a class hierarchy with virtual/overridden members, or among interface implementers. For more information see the cascading refactorings description below.

Figure 2. Reordering parameters directly upon code in the Editor - no modal dialogs to slow you down.
Refactoring: Rename
This refactoring renames a local variable, function, method, field, property, parameter, type, namespace, active CSS style, XAML namespace prefix, C++ global variable, or C++ macro and updates all references to the modified element.
Choosing meaningful identifier names is one of the simplest ways to improve the readability of your code - Refactor! makes this process trivial. You simply put the text cursor into the identifier, and hit the "One key refactoring" key (CTRL+~), and start changing your identifier. You will see all references to your identifier highlighted with a light green box. You can now cycle through each call using the TAB and SHIFT+TAB keys, and if you change any one - the others all reflect the change.
Refactoring: Extract Method
The most sophisticated of all class based refactorings is probably "Extract Method". This refactoring allows you to select a piece of code from inside a method and extract it outside into a method of its own - while leaving a call to that new method in the code the method came from.
You are probably already several steps ahead of us in how to activate this refactoring by now; You simply select some code, put the text cursor in the code, hit the "One Key Refactoring" key (CTRL+~), and now you have a new method containing your block of code, with a call where that code came from.
Consider this example code which calculates the volume of a cylinder. Suppose we decide to extract the code that calculates the area of a circle to a method of its own, for later reuse. To do this all we do is select the specific block of code and hit the "One key Refactoring" (CTRL+~), the code is cut from the source method, and we are prompted for a location for the target method.

Figure 6. You can place the extracted method precisely using the red Target Picker.
Once we have chosen the location for the new method, Refactor! calculates how many parameters need to be passed, creates some default names for the new method and any parameters, generates the code for the new method and calls it, and finally invokes the "Rename" refactoring in case we wish to override any of the default names chosen.

Figure 7. The fully extracted method - Refactor has determined parameters to pass and even come up with a meaningful name.
You know there is actually an even faster way to extract. Select the code - Cut the code - Paste it outside the Method but inside the class and Refactor! will extract the method for you automatically.
Notice that the method name and the call are both linked with green boxes - the "Extract Method" has automatically invoked the "Rename" refactoring for you. Also if there are any variables referenced outside as well as inside the block you selected, then Refactor! will automatically give your new method the appropriate parameters to pass in that data and if needed pass it back.
Refactoring: Cascading Refactorings
Some refactorings relate to cascading refactorigs. They apply member signature changes across a class hierarchy with virtual/overridden members, or among interface implementers. Cascading refactorings can also be automatically applied throughout a combination of interface implementers and class hierarchies tied together by a class that both belongs to the hierarchy and implements an interface, when the member being refactored is virtual/overridden in the class hierarchy and also declared in the interface. Availability for these cascading refactorings includes all member references (e.g., method calls and property references) in addition to the member’s declaration. For example, you can add a parameter to a method when the caret is on a method call instead of having to go to the method declaration.

Figure 8. Cascading Refactorings - affect all related members across a class hierarchy with virtual/overridden members, or among interface implementers.
Supported Refactorings
 | Add AssociatedControlID Attribute |  | Add Block Delimiters |  | Add Contract |
 | Add End Tag |  | Add Parameter |  | Add RunAt Attribute |
 | Add Validator |  | Add to Interface |  | Boolean to Enum |
 | Break Apart Arguments |  | Break Apart Attributes |  | Break Apart Parameters |
 | Case to Conditional |  | Change Tag |  | Collapse Accessors |
 | Collapse Getter |  | Collapse Setter |  | Combine Conditionals (nested) |
 | Combine Conditionals (parallel) |  | Compress Assignment |  | Compress to Lambda Expression |
 | Compress to Null Coalescing Operation |  | Compress to Ternary Expression |  | Concatenate Strings |
 | Conditional to Case |  | Consolidate Conditional Blocks |  | Consolidate Using Statements |
 | Convert Color to HEX |  | Convert Color to Named Color |  | Convert Color to RGB |
 | Convert to Auto-implemented Property |  | Convert to Auto-implemented Property (convert all) |  | Convert to Built-in Type |
 | Convert to Constant |  | Convert to Initializer |  | Convert to Is Nothing |
 | Convert to Parallel |  | Convert to Pixels |  | Convert to Point |
 | Convert to Points |  | Convert to Size |  | Convert to Skin |
 | Convert to System Type |  | Convert to Tuple |  | Create Backing Store |
 | Create Case Blocks from Enum |  | Create Multi-variable Declaration |  | Create Overload |
 | Create Setter Method |  | Create With Statement |  | Decompose Initializer |
 | Decompose Parameter |  | Encapsulate Downcast |  | Encapsulate Event |
 | Encapsulate Field |  | Encapsulate Field (read-only) |  | Encapsulate Method |
 | Encapsulate Property |  | Execute Statements in Parallel |  | Execute Statements in Serial |
 | Expand Accessors |  | Expand Assignment |  | Expand Getter |
 | Expand Null Coalescing Operation |  | Expand Setter |  | Expand Ternary Expression |
 | Expand Lambda Expression |  | Extract ContentPlaceHolder |  | Extract ContentPlaceHolder (and create master page) |
 | Extract Function (outside of class) |  | Extract Interface |  | Extract Method |
 | Extract Method to Type |  | Extract Property |  | Extract Script |
 | Extract String to Resource |  | Extract String to Resource (replace all) |  | Extract Style (Class) |
 | Extract Style (id) |  | Extract to XAML Resource |  | Extract to XAML Resource (replace all) |
 | Extract to XAML Template |  | Extract UserControl |  | Extract XML Literal to Resource |
 | Flatten Conditional |  | For to ForEach |  | ForEach to For |
 | Initialize Conditionally |  | Inline Alias |  | Inline Constant |
 | Inline Delegate |  | Inline Format Item |  | Inline Macro |
 | Inline Method |  | Inline Method (and delete) |  | Inline Recent Assignment |
 | Inline Result |  | Inline Temp |  | Inline With Statement |
 | Introduce Alias |  | Introduce Alias (replace all) |  | Introduce Constant |
 | Introduce Constant (local) |  | Introduce ForEach Action |  | Introduce Format Item |
 | Introduce Local |  | Introduce Local (replace all) |  | Introduce Parameter Object |
 | Introduce Result Variable |  | Introduce Setter Guard Clause |  | Introduce Using Statement |
 | Line-up Arguments |  | Line-up Attributes |  | Line-up Parameters |
 | Lock to Try/Finally |  | Make Explicit |  | Make Explicit (and Name Anonymous Type) |
 | Make Extension |  | Make ID Unique |  | Make Implicit |
 | Make Member Non-static |  | Make Member Static |  | Make Read-only |
 | Merge Styles |  | Method to Property |  | Move Declaration Near Reference |
 | Move Initialization to Declaration |  | Move Method to Header |  | Move Method to Source File |
 | Move Style Attributes to CSS |  | Move Style Attributes to External CSS |  | Move Style Attributes to Theme |
 | Move Style Attributes to Theme (use SkinID) |  | Move to Code-behind |  | Move Type to File |
 | Move Type to Namespace |  | Name Anonymous Method |  | Name Anonymous Type |
 | Optimize Namespace References |  | Promote to Parameter |  | Property to Method |
 | Pull Member Up |  | Reduce Visibility |  | Remove Assignments to Parameter |
 | Remove Attribute |  | Remove Block Delimiters |  | Remove Empty Handler |
 | Remove End Tag |  | Remove Parameter |  | Remove Private Setter |
 | Remove Redundant Call |  | Remove Redundant Conditional |  | Remove Redundant Constructor |
 | Remove Redundant Delegate Creation |  | Remove Redundant Destructor |  | Remove Redundant Qualifier |
 | Remove Redundant Type Specification |  | Remove Setter Guard Clause |  | Remove Tag |
 | Remove Type Qualifier |  | Remove Type Qualifier (replace all) |  | Rename |
 | Rename File to Match Type |  | Rename Type to Match File |  | Reorder Attributes |
 | Reorder Parameters |  | Replace Temp with Query |  | Replace with Alias |
 | Replace with Constant |  | Replace with Local |  | Replace with XAML Resource |
 | Reverse Boolean |  | Reverse Conditional |  | Safe Rename |
 | Set CssClass |  | Set Image Dimensions |  | Simplify Expression |
 | Sort Namespace References |  | Split Conditional |  | Split Conditional (and duplicate else block) |
 | Split Initialization from Declaration |  | Split Multi-variable Declaration |  | Split String |
 | Split Style |  | Split Temporary Variable |  | Split Using Statement |
 | Split With Statement |  | Surround with Tag |  | Surround with Update Panel |
 | Toggle ViewState |  | Use Environment.NewLine |  | Use Equality Operator |
 | Use Explicit Notation |  | Use IsNullOrEmpty |  | Use IsNullOrEmpty |
 | Use Named Arguments |  | Use Short Notation |  | Use String.Compare |
 | Use String.Format |  | Use StringBuilder |  | Use Const |
 | Use typedef |  | Using to Try/Finally |  | Widen Scope |
 | Widen Scope (promote constant) |  | Widen Scope (promote to field) |
Summary
Refactor! Pro offers Visual Studio .NET developers a suite of integrated tools to help simplify code and make it infinitely easier to maintain - Tools that are surfaced on your code in the editor, for immediate access rather than the traditional solution of modal dialogs that simply slow you down and take you away from your code. Refactor! Pro is the only tool that makes refactorings readily accessible without unwanted speed-bumps, reducing the risk and cost associated with improving the structure and maintainability of your code.