CodeRush Xpress refactoring features
Refactoring is a powerful way to improve the quality and flexibility of your code, without changing program behavior. Well-refactored code costs less to maintain, is easier to extend, and is a more valuable asset than code that is allowed to accumulate technical debt (also referred to as design debt).
CodeRush Xpress includes over 60 refactorings, and nearly all work in both C# and Visual Basic. A few refactorings are available in only a single language due to features of that particular language.
For example, Inline With Statement and Create With Statement are both available in Visual Basic. Similarly, refactorings to Add Block Delimiters and Remove Block Delimiters are only available in CSharp.
In some cases CodeRush Xpress provides wrappers for existing refactorings in either language. These wrappers ensure a more complete experience, making all refactorings contextually available in one location, accessed from a single keystroke (Ctrl+`). In many cases wrappers will also implement a preview hint, so you can see the impact of the changes before you commit. Wrappers are indicated in the refactoring menu with a Visual Studio icon.
Here you’ll find descriptions for all refactorings shipping inside CodeRush Xpress, arranged by the following categories:
Changing Signatures
- Add Parameter
- Create Overload
- Decompose Parameter
- Promote to Parameter
- Remove Unused Parameter
- Reorder Parameters
- Safe Rename
Conditionals
- Combine Conditionals
- Compress to Ternary Expression
- Expand Ternary Expression
- Flatten Conditional
- Reverse Conditional
- Split Conditional
Declaration & Initialization
- Convert to Initializer
- Decompose Initializer
- Make Explicit
- Make Explicit (and Name Anonymous Type)
- Make Implicit
- Move Declaration Near Reference
- Move Initialization to Declaration
- Name Anonymous Type
- Remove Assignments to Parameter
- Split Initialization from Declaration
- Split Temporary Variable
Expressions
- Inline Temp
- Introduce Constant
- Introduce Constant (local)
- Introduce Local
- Introduce Local (replace all)
- Simplify Expression
Interfaces
Lambda Expressions & Anonymous Methods
Loops & Blocks
Properties & Fields
- Convert to Auto-implemented Property
- Convert to Auto-implemented Property (convert all)
- Create Backing Store
- Encapsulate Field
- Encapsulate Field (read only)
- Method to Property
- Property to Method(s)
Moving/Extracting Methods
- Extract Method
- Extract Method to Type
- Extract Property
- Replace Temp with Query
Resource Files & Strings
- Extract String to Resource
- Extract String to Resource (replace all)
- Extract XML Literal to Resource
- Use String.Format
- Use StringBuilder
Types
- Move Type to File
Visibility
Consult the Visual Studio help after installing CodeRush Xpress for additional details and example code in both CSharp and Visual Basic demonstrating these refactorings in action.
—– Products: CodeRush Xpress Versions: 11.2 and up VS IDEs: 2008 and 2010 Updated: Aug/01/2012 ID: C007