Registry
Aalexbit-codemod avatar

dotnet-csharp-pattern-mining

Mine .NET platform compatibility and migration code patterns; read-only metrics with autoFix classification

alexbit-codemod21 executions

  • mining
  • metrics
  • dotnet
  • csharp
  • migration-assessment
  • system.web
Connect a repo
npx codemod dotnet-csharp-pattern-mining

dotnet-csharp-pattern-mining

Read-only mining codemod that detects .NET platform compatibility and migration code patterns in C# source. Each finding includes an autoFix classification (yes, partial, no) and a risk level. No files are written to the target repo.

Registry: private. Use the public dotnet-migration-assessment-bundle to run all miners in one workflow.

What it does

Scans .cs files for legacy platform APIs and migration-sensitive code patterns, including:

PatternCategoryRisk
BinaryFormattercode-patterncritical
HttpContext.Currentcode-patternhigh
ConfigurationManagercode-patternmedium
Thread.Abortcode-patternhigh
AppDomainsplatformhigh
Reflection.Emitplatformhigh
System.Web usageplatformhigh
COM Interop (DllImport)platformhigh
Registry usageplatformhigh
Windows-only APIsplatformmedium
Reflection-heavy codeplatformmedium
WCF ServiceContractcode-patternhigh
WebForms Pagecode-patterncritical
EF6 DbContextcode-patternhigh
OWIN IAppBuildercode-patternhigh
Web API 2 ApiControllercode-patternhigh

Metrics

MetricCardinalities
dotnet-csharp-patternpattern, category, autoFix, risk, file, line, snippet

Run

Via bundle (recommended):

bash
npx codemod@latest workflow run -w codemods/dotnet-migration-assessment/dotnet-migration-assessment-bundle \
  -t /path/to/dotnet/repo \
  --allow-dirty --no-interactive

Standalone (local monorepo):

bash
npx codemod@latest workflow run -w codemods/dotnet-migration-assessment/dotnet-csharp-pattern-mining \
  -t /path/to/dotnet/repo \
  --allow-dirty --no-interactive

Testing

bash
npm test

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.