Back to Devexpress

CRR0026 - Unused member

coderushforroslyn-119066-static-code-analysis-analyzers-library-crr0026-unused-member.md

latest1.5 KB
Original Source

CRR0026 - Unused member

  • Feb 28, 2025
  • 2 minutes to read

This analyzer detects unused type members. Specify accessibility levels for these members in the Editor | C# (Visual Basic) | Code Analysis | Unused Code Analysis options page. For example, set the public option and uncheck other options to allow CodeRush to detect unused public members only.

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

Tip

Use the Highlight unused code in editor checkbox on the Editor | C# (Visual Basic) | Code Analysis | General option page to enable or disable the highlighting of unused members in the code editor.

To fix this issue, perform one of the following actions:

  1. Remove the public member declaration or add it to your program:

  2. Call the Remove Unused Member refactoring to remove an unused public member.

  3. Run Code Cleanup with the Remove unused members rule to remove unused private members.

See the following example for details: How to: Remove Unused Members from Code.

See Also

Suppress Analyzers