Refactorings for Expressions
Inline Temp
Replaces all references to a local variable with its initial value. 
Introduce Constant
Declares a new constant, initialized to the value of the string or number at the caret. 
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. 
After applying this refactoring, the new local variable name is selected and linked up... 
So it is easy to 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. 
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: 
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. 
|