Refactorings
- 4 minutes to read
Refactorings are small changes to working code that improve the internal structure without altering the external behavior of that code. CodeRush Classic includes over 200 refactorings intended to improve C#, C++, Visual Basic, ASP.NET, HTML, CSS, and XAML code. Some C# and Visual Basic refactorings are also available within Razor blocks in MVC projects.
Here is the full list of supported refactorings.
- Add / Remove Block Delimiters (C#, C++)
- Add Parameter
- Boolean to Enum
- Break Apart Arguments
- Break Apart Attributes
- Break Apart Parameters
- Collapse Accessors (C#, C++)
- Collapse Getter (C#, C++)
- Collapse Setter (C#, C++)
- Combine Conditionals
- Compress Assignment
- Compress to Lambda Expression (C#)
- Compress to Null Coalescing Operation (C#)
- Compress to Ternary Expression
- Concatenate Strings
- Conditional to Case / Case to Conditional
- Consolidate Conditional Blocks
- Consolidate Using Statements
- Convert Color to HEX (ASP.NET)
- Convert Color to Named Color (ASP.NET)
- Convert Color To RGB (ASP.NET)
- Convert CSS Class to Skin (ASP.NET)
- Convert Length to Pixels (ASP.NET)
- Convert Length to Points (ASP.NET)
- 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 (VB)
- Convert to Parallel
- Convert to Point
- Convert to Size
- Convert to System Type
- Convert to Tuple
- Create Backing Store
- Create Multi-variable Declaration
- Create Overload
- Create Setter Method
- Create With Statement (VB)
- Declare Method
- Decompose Initializer
- Decompose Parameter
- Encapsulate Downcast
- Encapsulate Event
- Encapsulate Field (read-only)
- Encapsulate Field
- Encapsulate Method
- Encapsulate Property
- Execute Statement Asynchronously (FromAsync)
- Execute Statement Asynchronously (StartNew)
- Execute Statements in Parallel
- Execute Statements in Serial
- Expand Accessors (C#, C++)
- Expand Assignment
- Expand Getter (C#, C++)
- Expand Lambda Expression (C#)
- Expand Null Coalescing Operation (C#)
- Expand Setter (C#, C++)
- Expand Ternary Expression
- Extract ContentPlaceHolder (ASP.NET)
- Extract ContentPlaceHolder and Create Master (ASP.NET)
- Extract Editor Template (MVC)
- Extract Function (outside of class) (C++, JS)
- Extract Interface
- Extract Method to Type
- Extract Method
- Extract Partial View (MVC)
- Extract Property
- Extract Script (ASP.NET)
- Extract String to Resource
- Extract String to Resource (replace all)
- Extract Style - Class (ASP.NET)
- Extract Style - ID (ASP.NET)
- Extract UserControl (ASP.NET)
- Extract to XAML Resource (XAML)
- Extract to XAML Template (XAML)
- Extract XML Literal to Resource (VB)
- Flatten Conditional
- For to ForEach
- ForEach to For
- Foreach to Linq
- Initialize Conditionally
- Inline Alias
- Inline Constant
- Inline Delegate (C#)
- Inline Format Item
- Inline Method
- Inline Method (and delete)
- Inline Recent Assignment
- Inline Result
- Inline Temp
- Inline With Statement (VB)
- Introduce Alias
- Introduce Constant (local)
- Introduce Constant
- Introduce ForEach Action (C#)
- Introduce Format Item
- Introduce Local
- Introduce Parameter Object
- Introduce Result Variable
- Line-up Arguments
- Line-up Attributes
- Line-up Parameters
- Lock to Try/Finally
- Make Explicit (and Name Anonymous Type)
- Make Explicit
- Make Extension
- Make ID Unique (ASP.NET)
- Make Implicit
- Make Member Non-static
- Make Member Static
- Make Read-Only
- Merge Duplicate Local Declaration (JavaScript)
- Merge Styles (ASP.NET)
- Method to Property
- Move Declaration Near Reference
- Move Initialization to Declaration
- Move Method (C++)
- Move Style Attributes to CSS (ASP.NET)
- Move to Code-behind (ASP.NET)
- Move Type to File
- Move Type to Namespace
- Name Anonymous Method (C#)
- Name Anonymous Type
- Optimize Namespace References
- Promote to Parameter
- Property to Method(s)
- Pull Member Up
- Reduce Visibility
- Remove Assignments to Parameters
- Remove Empty Handler
- Remove End Tag (ASP.NET)
- Remove Unused Parameter
- Remove Private Setter
- Remove Redundant Assignment
- Remove Redundant Block Delimiters (C#, C++)
- Remove Redundant Call
- Remove Redundant Constructor
- Remove Redundant Delegate Creation (C#)
- Remove Redundant Destructor (C#)
- Remove Redundant Qualifier
- Remove Redundant Qualifier (remove all)
- Remove Redundant Type Specification
- Remove Type Qualifier
- Rename File to Match Type
- Rename Style (ASP.NET)
- Rename Type to Match File
- Rename
- Reorder Attributes (ASP.NET)
- Reorder Parameters
- Replace Temp with Query
- Replace with Alias
- Replace with Constant
- Replace with Local
- Replace with XAML Resource (XAML)
- Reverse Boolean
- Reverse Conditional
- Safe Rename
- Simplify Expression
- Sort Namespace References
- Split Conditional
- Split Initialization from Declaration
- Split Multi-variable Declaration
- Split String
- Split Style (ASP.NET)
- Split Temporary Variable
- Split Using Statement
- Split With Statement (VB)
- Use Const (C++)
- Use Environment.NewLine
- Use Explicit Notation
- Use IsNullOrEmpty
- Use Named Arguments
- Use Short Notation
- Use String.Compare
- Use String.Format
- Use StringBuilder
- Use typedef (C++)
- Using to Try/Finally
- Widen Scope (promote constant)
- Widen Scope (promote to field)
- Widen Scope