CodeRush Xpress

Refactorings for Expressions

Inline Temp

Replaces all references to a local variable with its initial value.

Refactoring - Inline Temp

Introduce Constant

Declares a new constant, initialized to the value of the string or number at the caret.

Refactoring - Introduce Constant

Introduce Constant (local)

Declares a new local constant, initialized to the value of the string or number at the caret.

Introduce Local

Creates a new local variable initialized to the selected expression. Replaces the selection with the new variable.

Refactoring - Introduce Local

After applying this refactoring, the new local variable name is selected and linked up...

Refactoring - Introduce Local Result

So it is easy to rename...

Refactoring - Introduce Local and Rename

Introduce Local (replace all)

Creates a new local variable initialized with the selected expression. Replaces the expression everywhere it appears inside the code block with the new variable.

Refactoring - Introduce Local (replace all)

Simplify Expression

Resolves an expression to its simplest form. Simplify Expression will remove redundancy such as extra parentheses and sub-expressions that have no impact on the outcome of the evaluation. For example, consider the redundancy in the expression in the method below:

Refactoring - Simplify Expression

To simplify this, select the expression and press the CodeRush key (Ctrl+`). The preview hint shows how the expression will be simplified. Notice that we lose the redundant reference to the hasQualified parameter, and we also lose an extra pair or parens, resulting in a cleaner expression that is easier to read.

Refactoring - Simplify Expression Result

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.