← All recipes
Moderne licensed

Find methods that could be static

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Performance.FindMakeMethodStaticArtifactOpenRewrite.Recipes.CSharp.CodeQuality

Detect private methods that don't appear to use instance members and could be marked static for clarity and performance.

Single recipecsharpperformancecode-qualityProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe OpenRewrite.Recipes.CSharp.CodeQuality.Performance.FindMakeMethodStatic

If the recipe isn’t available locally, install it with:

mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQuality