Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 1.26 KB

File metadata and controls

28 lines (21 loc) · 1.26 KB

Csharp provider

The csharp provider is an external provider used to analyze .NET and C# source code. Currently, the provider supports the referenced capability.

The csharp provider uses a gRPC interface to perform a semantic analysis of an application source code in the source-only mode. The provider parses the source code by using tree-sitter and uses stack graph for the analysis to find references to types, methods, classes, and fields. Based on the C# custom rule definition, the analyzer identifies violations in your code that you must resolve before the application migration.

referenced

The csharp provider supports referenced capability in rules to define fields such as pattern and location based on which the provider searches the code for violations.

when:
  csharp.referenced:
    pattern: "<pattern>"
    location: CLASS

where:

pattern

A regular expression pattern to match the required reference. For example, HttpNotFound.

namespace

Specifies the namespace to search within. For example, System.Web.Mvc.