All docs
V20.1
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Unused Code Analysis

Unused Type, Unused Member, Unused Parameter, and Empty Event Handler diagnostics can detect unused code in types, members, and method parameters based on the specified member/type accessibility level.

  • Open the Editor | C# (Visual Basic) | Code Analysis | Unused Code Analysis options page.
  • Specify accessibility levels (private, protected, private protected, protected internal, internal or public) for types, members, and methods that contain parameters you want to analyze.

For example, set the public option and uncheck other options in members accessibility to allow CodeRush to detect unused public members only.

RemoveQualifier

The following example demonstrates how the Unused Member analyzer detects an unused public member:

RemoveQualifier