- Choose ReSharper | Options in the main menu.
- Open the Code Cleanup options: ReSharper | Options | Code Editing | Code Cleanup.
- Create a new profile as described in Creating Custom Profiles. In the Selected profile settings for the new profile, select Remove code redundancies.
- Click Save to apply the modifications and let ReSharper choose the settings layer, or choose a particular settings layer in the Save To drop-down list. To learn more about saving ReSharper settings, see JetBrains .NET Tools Blog: Save or Save To in ReSharper Options.
- Choose ReSharper | Tools | Cleanup Code in the menu to open the Code Cleanup dialog box for the current file or for a solution node (see Running Code Cleanup for details), and then select the newly created profile in the Available Profiles area.
- Click Run to perform Code Cleanup. ReSharper will remove all redundancies in the current file or in the selected solution node and according to the cleanup profile settings.
You can also remove code redundancies in the specific scope with the Fix in Scope.
This feature is supported in the following languages/technologies: