Philips.CodeAnalysis.MaintainabilityAnalyzers 1.7.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Philips.CodeAnalysis.MaintainabilityAnalyzers --version 1.7.0
                    
NuGet\Install-Package Philips.CodeAnalysis.MaintainabilityAnalyzers -Version 1.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Philips.CodeAnalysis.MaintainabilityAnalyzers" Version="1.7.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Philips.CodeAnalysis.MaintainabilityAnalyzers" Version="1.7.0" />
                    
Directory.Packages.props
<PackageReference Include="Philips.CodeAnalysis.MaintainabilityAnalyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Philips.CodeAnalysis.MaintainabilityAnalyzers --version 1.7.0
                    
#r "nuget: Philips.CodeAnalysis.MaintainabilityAnalyzers, 1.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Philips.CodeAnalysis.MaintainabilityAnalyzers@1.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Philips.CodeAnalysis.MaintainabilityAnalyzers&version=1.7.0
                    
Install as a Cake Addin
#tool nuget:?package=Philips.CodeAnalysis.MaintainabilityAnalyzers&version=1.7.0
                    
Install as a Cake Tool

Introduction

Roslyn Diagnostic Analyzers are customized compiler errors providing real-time feedback to C# developers. Many Analyzers include an automatic Code Fixer. While Microsoft (and other organizations) offer many analyzers, the market is nascent. Moreover, many tools offer a rich set of rules, but lack the shift-left integration that Roslyn achieves.

We have a policy whereby Code Reviewers ask themselves if a review comment can be automated. If so, and if a Diagnostic Analyzer is the right tool for the scenario in question, and if an Analyzer does not readily exist in the market already, an issue is created to track the need. That is, all analyzers herein are based on real-world code review feedback. This project is the result. It was open-sourced in 2020.

Rules Documentation

Consult the following for details on the available rules:

Getting Started

Add the rules using Visual Studio's Package Manager, locating these packages on nuget.org. Rules are generally enabled by default. Use the .editorconfig file to enable or disable each of them and set their severity level as desired. Some rules (e.g., Avoid Duplicate Code, Avoid Static Classes) support configuration and whitelisting - again via the .editorconfig.

Debugging

Published packages include .snupkg and SourceLink. This allows symbol loading, stack traces with line numbers on exceptions, and "Go to Definition" support. However, breakpoints and step-through debugging are flaky on published Release builds (especially with Analyzers in general), due to optimizations and inlining.

For symbols and stack traces, launch a second instance of Visual Studio, attach the debugger to your primary development instance, and Load Symbols via Debug → Windows → Modules, and right-clicking on the Analyzer.

Visual Studio 2019/2022 Support

These packages reference Microsoft.CodeAnalysis version 3.6, which shipped with Visual Studio 2019 16.6.

CI/CD

Learn more about the CI/CD pipeline.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Philips.CodeAnalysis.MaintainabilityAnalyzers:

Repository Stars
aaru-dps/Aaru
Aaru Data Preservation Suite
Version Downloads Last Updated
1.8.0-prerelease.2979 9 8/11/2025
1.7.0 53 8/9/2025
1.6.4 126 7/28/2025
1.6.3 5,852 7/7/2025
1.6.2 1,537 6/29/2025
1.6.1 852 6/27/2025
1.6.0 749 6/25/2025
1.5.0 484,358 12/19/2023
1.4.0 23,418 11/14/2023
1.3.1 16,354 10/25/2023
1.3.0 1,756 10/23/2023
1.2.32 319,774 1/5/2023
1.2.31 508 1/3/2023
1.2.30 1,845 11/9/2022
1.2.29 1,278 10/18/2022
1.2.28 229,641 3/23/2022
1.2.27 6,142 12/8/2021
1.2.26 2,121 11/26/2021
1.2.25 20,158 10/21/2021
1.2.24 2,437 10/14/2021
1.2.23 817 10/5/2021
1.2.21 11,735 9/15/2021
1.2.20 1,076 9/13/2021
1.2.19 495 9/13/2021
1.2.18 753 9/10/2021
1.2.14 55,981 5/6/2021
1.2.13 520 5/4/2021
1.2.9.2 1,439 4/3/2021
1.2.9.1 568 4/3/2021
1.2.9 485 4/2/2021
1.2.8.2 687 4/1/2021
1.2.8.1 502 4/1/2021
1.2.6.2 638 3/28/2021
1.2.6.1 536 3/25/2021
1.2.6 527 3/25/2021
1.2.4 4,847 12/16/2020
1.2.1 3,103 12/4/2020
1.1.0 37,183 7/23/2020
1.0.5 940 9/19/2020
1.0.4 23,594 4/17/2020
1.0.3 776 4/13/2020
1.0.2 873 3/20/2020
1.0.1 776 3/17/2020

Added PH2144: AvoidIncorrectForLoopCondition analyzer to detect backwards for-loop boundary check issues