← All recipes
Moderne licensed

Find GetType() called on System.Type

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Performance.FindGetTypeOnSystemTypeArtifactOpenRewrite.Recipes.CSharp.CodeQuality

Detect typeof(T).GetType() which returns System.RuntimeType instead of the expected System.Type. Use typeof(T) directly.

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.FindGetTypeOnSystemType

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

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