gitlabEdit

chart-mixedAnalyzing your Mod

Here's a list of analyzer diagnostics.

Analyzers, in .NET, are tools that allow you to check the quality of your code and to fix common design pitfalls in your code. These fixes typically tailor the use of better features or the removal of unnecessary code.

Similarly, we provide you with analyzers that detect the usage of non-Nitrocid methods and classes and provide you fixes that make use of Nitrocid methods and classes as good alternatives. These analyzers are applicable only to Nitrocid mods.

We provide you two types of analyzers for your Nitrocid mods:

  • NuGet-based analyzers: They analyze your mods while you're working on them in .NET IDEs.

  • Standalone analyzers: They analyze your mod code outside Visual Studio.

In this page, we'll give you instructions on how to install such analyzers. Choose the analyzer type based on your preferences.


Installation

There are two types of Nitrocid analyzers as highlighted above. This section shows you how to analyze your code with either the NuGet analyzer package or the standalone analyzer. The mod analyzer package found in the release contains both the standalone analyzer and the NuGet-based analyzer.

chevron-rightVisual Studiohashtag

In order to install the NuGet-based analyzer for Nitrocid mods on Visual Studio, follow the below steps:

  1. Open Visual Studio 2026 to a solution of your choice and open Manage NuGet packages on a project you want to analyze.

  2. Search for Nitrocid.Analyzers

  3. Install the package

  4. Start working on your mod, and you'll see NKS analyzers.

chevron-rightStandalone Analyzerhashtag

In case you can't use NuGet-based analyzer for your mods, you can use the standalone analyzer. To use it, follow the steps:

  1. Open the command prompt

  2. Go to the directory where the standalone analyzer is located. Use cd to change the directory.

  3. Run dotnet Nitrocid.StandaloneAnalyzer.dll path/to/mod.sln


Suppression

You can suppress this warning by including it in the appropriate place, whichever is convenient.

For more information about how to suppress any warning issued by the Nitrocid analyzer, visit the below page:

circle-info

We recommend that you avoid suppressing any of Nitrocid's analysis methods, unless you're sure that your mod behaves correctly.


Diagnostics

The following code analyzers are shipped, with links to each page:

The following analyzers generate warnings:

Diag. ID
Page

NKS0001

chart-mixedText - NKS0001

NKS0002

NKS0003

circle-info

It's vital to follow the analyzer recommendations to get the best mod code according to the standards.

Last updated