IIMMPACT.CodeQuality.Tool 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global IIMMPACT.CodeQuality.Tool --version 0.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local IIMMPACT.CodeQuality.Tool --version 0.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=IIMMPACT.CodeQuality.Tool&version=0.1.0
                    
nuke :add-package IIMMPACT.CodeQuality.Tool --version 0.1.0
                    

iimmpact-dotnet-quality

IIMMPACT's shared C# code-quality rules: analyzer configuration shipped as a NuGet package, plus a dotnet tool that gates new violations on a per-file baseline.

Packages

Package What it is
IIMMPACT.CodeQuality Analyzer config package. References SonarAnalyzer.CSharp and Microsoft.CodeAnalysis.BannedApiAnalyzers and injects a .globalconfig, SonarLint.xml, CodeMetricsConfig.txt, and BannedSymbols.IIMMPACT.txt into the build. DevelopmentDependency, so it never flows to downstream consumers of your package.
IIMMPACT.CodeQuality.Tool dotnet tool iimmpact-quality with check and baseline commands. Builds the solution with SARIF logging enabled, collects diagnostics for the managed rules, and compares them against code-quality-baseline.json.

Managed rules

The package turns these rules on as warnings:

Rule Threshold Source of the limit
CA1502 cyclomatic complexity 25 CodeMetricsConfig.txt
CA1506 class/method coupling 60 (type), 40 (method) CodeMetricsConfig.txt
S134 nesting depth 4 SonarLint.xml
S138 method lines 60 SonarLint.xml
S104 file lines 400 SonarLint.xml
S4462 blocking async calls — globalconfig
CA1849, CA2016 async correctness — globalconfig
CA2254 logging template — globalconfig
RS0030 banned APIs DateTime.Now, DateTimeOffset.Now, System.Console, new HttpClient() BannedSymbols.IIMMPACT.txt
IDE0051, IDE0052, IDE0060 unused code non-public parameters globalconfig

Usage

Reference the package in every project you want checked:

<PackageReference Include="IIMMPACT.CodeQuality" Version="0.1.0" PrivateAssets="all" />

Install the tool once per repo:

dotnet tool install IIMMPACT.CodeQuality.Tool

Record existing debt, then gate:

dotnet iimmpact-quality baseline MyApp.slnx   # writes code-quality-baseline.json
dotnet iimmpact-quality check MyApp.slnx    # fails on growth or stale entries

check exits non-zero when:

  • a file gains diagnostics beyond what the baseline records (growth),
  • the baseline records more diagnostics than the build reports (stale), or
  • repo config silences a managed rule (dotnet_diagnostic.<id>.severity = none|silent|suggestion in .editorconfig/.globalconfig, or the rule in <NoWarn> in .props/.targets/.csproj).

How the tool works

iimmpact-quality runs dotnet sln list to find projects, deletes each project's obj/iimmpact-quality directory, rebuilds with -p:IimmpactQualitySarif=true, then parses the SARIF logs that IIMMPACT.CodeQuality.targets wires into ErrorLog. Diagnostics for rules outside the managed list are ignored, so unrelated analyzer noise never fails the gate.

Releasing

Tag v<version> where <version> equals the <Version> in Directory.Build.props. The release workflow verifies the tag, packs both packages, publishes to nuget.org via NuGet/login OIDC, and creates the GitHub release.

License

MIT — IIMMPACT SDN BHD.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.2.2 502 10/13/2026
0.2.1 264 10/6/2026
0.2.0 92 10/6/2026
0.1.0 100 10/1/2026