Meridian.Analyzer
0.2.3
See the version list below for details.
dotnet add package Meridian.Analyzer --version 0.2.3
NuGet\Install-Package Meridian.Analyzer -Version 0.2.3
<PackageReference Include="Meridian.Analyzer" Version="0.2.3" />
<PackageVersion Include="Meridian.Analyzer" Version="0.2.3" />
<PackageReference Include="Meridian.Analyzer" />
paket add Meridian.Analyzer --version 0.2.3
#r "nuget: Meridian.Analyzer, 0.2.3"
#:package Meridian.Analyzer@0.2.3
#addin nuget:?package=Meridian.Analyzer&version=0.2.3
#tool nuget:?package=Meridian.Analyzer&version=0.2.3
Meridian.Analyzer
Meridian.Analyzer is a Roslyn analyzer package for backend readability, architecture, security, reliability, and performance rules.
Quick Start
Install the published analyzer package into a consumer project:
dotnet add package Meridian.Analyzer
Or add an explicit package reference:
<ItemGroup>
<PackageReference Include="Meridian.Analyzer" Version="0.2.*" PrivateAssets="all" />
</ItemGroup>
Repository Layout
src/Meridian.Analyzer/: analyzer project, rule implementations, helpers, and Roslyn release tracking filestests/Meridian.Analyzer.Tests/: analyzer behavior testsdocs/: maintainer guidance, examples, and per-rule documentationLICENSE: MIT license for the repository and published package metadata
Documentation
- Usage examples: docs/usage-example.md
- Maintainer guide: docs/guide.md
- Rule docs: docs/rules/MER0001.md
- Rule docs: docs/rules/MER0002.md
- Rule docs: docs/rules/MER0003.md
- Rule docs: docs/rules/MER0004.md
- Rule docs: docs/rules/MER0005.md
- Rule docs: docs/rules/MER0006.md
- Rule docs: docs/rules/MER0007.md
- Rule docs: docs/rules/MER0008.md
- Rule docs: docs/rules/MER0009.md
- Rule docs: docs/rules/MER0010.md
- Rule docs: docs/rules/MER0011.md
- Rule docs: docs/rules/MER0012.md
- Rule docs: docs/rules/MER0013.md
- Rule docs: docs/rules/MER0014.md
- Rule docs: docs/rules/MER0015.md
- Rule docs: docs/rules/MER0016.md
- Rule docs: docs/rules/MER0017.md
- Rule docs: docs/rules/MER0018.md
- Rule docs: docs/rules/MER0019.md
- Rule docs: docs/rules/MER0020.md
- Rule docs: docs/rules/MER0021.md
- Rule docs: docs/rules/MER0022.md
- Rule docs: docs/rules/MER0023.md
- Rule docs: docs/rules/MER0024.md
- Rule docs: docs/rules/MER0025.md
Current Surface
- Analyzer project:
src/Meridian.Analyzer/Meridian.Analyzer.csproj - Test project:
tests/Meridian.Analyzer.Tests/Meridian.Analyzer.Tests.csproj - Diagnostic prefix:
MER - Category namespaces:
Meridian.Readability,Meridian.Security,Meridian.Architecture,Meridian.Reliability,Meridian.Performance - Packaging status: published on
nuget.org
Validation Entry Points
- Local test run:
dotnet test tests/Meridian.Analyzer.Tests/Meridian.Analyzer.Tests.csproj -c Release - Local package smoke check:
dotnet pack src/Meridian.Analyzer/Meridian.Analyzer.csproj -c Release -o artifacts
Use dotnet test and dotnet pack from this repo to validate the standalone package itself.
Consumer Configuration
Configure analyzer severities in your consuming project's .editorconfig:
[*.cs]
dotnet_diagnostic.MER0001.severity = warning
dotnet_diagnostic.MER0002.severity = warning
You can enable only the rules you want. Each rule document describes the contract it enforces and the preferred refactor shape.
Risks And Current Boundaries
nuget.orgis public. The current publish lane is fine for public distribution, but it is not a private feed.- Release automation depends on the
NUGET_KEYGitHub secret. If that key rotates or loses push scope, the release workflow will fail at publish time. - Some rules encode opinionated architectural conventions. Review the rule docs before enabling large sets as build warnings in an existing codebase.
Current Rules
| Rule | Diagnostic ID | Category | Preferred refactor |
|---|---|---|---|
| Ternary in initializer payload branches | MER0001 |
Readability | Stage the payload branch in a named local or helper before building the initializer |
| Broad nested try/catch fallback flow | MER0002 |
Readability | Extract the inner fallback branch into a helper or flatten the exception-handling flow |
| Unsafe output-cache boundary | MER0003 |
Security | Remove [OutputCache] or replace it with no-store caching unless a persona-safe cache policy is reviewed |
| Controller authorization policy boundary | MER0004 |
Security | Declare class-level or action-level policies on admin and high-risk controllers |
| Admin controller shape contract | MER0005 |
Security | Align admin controllers on Admin*Controller, api/admin, and BaseAdminController |
| Controller service locator boundary | MER0006 |
Architecture | Use constructor injection or [FromServices] instead of action-body service location |
| Raw configuration read boundary | MER0007 |
Reliability | Move raw reads to typed options, startup guards, or provider adapters |
| Startup bypass flag containment | MER0008 |
Security | Move MERIDIAN_SKIP_* reads behind StartupGuards or typed startup-skip options |
| Controller cancellation boundary | MER0009 |
Reliability | Add CancellationToken to async actions and avoid CancellationToken.None in request code |
| Clock and deterministic delay boundary | MER0010 |
Reliability | Use IMeridianClock or TimeProvider for runtime time or delay work |
| Static mutable runtime state | MER0011 |
Reliability | Move static mutable state from controllers or handlers into injectable bounded services |
| Health-check registration parity | MER0012 |
Reliability | Register every source Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck through health-check registration |
| Backend layer-boundary guard | MER0013 |
Architecture | Move dependencies to the documented layer boundary |
| Model ownership boundary | MER0014 |
Architecture | Keep DTOs feature-local and entities in the database entity boundary |
| String helper usage | MER0015 |
Readability | Use shared string helpers in in-memory code |
| Shared JSON profile boundary | MER0016 |
Architecture | Move ad hoc JSON options into shared profiles or a named factory |
| Unbounded EF materialisation | MER0017 |
Performance | Add obvious Where, Take, or Skip bounds before async materialisation |
| Raw SQL boundary | MER0018 |
Security | Keep SQL in persistence boundaries and prefer interpolated APIs over raw APIs |
| ProblemDetails construction boundary | MER0019 |
Reliability | Use shared ProblemDetails helpers from controller actions |
| Controller data-access boundary | MER0020 |
Architecture | Delegate repository, DbContext, and EF work to services or facades |
| Backend logging contract | MER0021 |
Reliability | Use Serilog outside framework-edge boundaries |
| Redis keyspace scan boundary | MER0022 |
Performance | Route IServer.Keys scans through an approved bounded helper |
| Detached runtime task boundary | MER0023 |
Reliability | Give background work an owned lifetime, cancellation path, and observability boundary |
| IQueryable string-extension guard boundary | MER0024 |
Reliability | Replace StringExtensions.IsNullOr* predicates inside queryable or expression-returning methods with translatable query guards |
| Empty is-pattern brace guard boundary | MER0025 |
Readability | Replace empty property-pattern braces with shared nullable helpers or explicit null checks when behavior matches |
Rule-Addition Checklist
Before landing MER0002+ or any later rule, update these surfaces in the same change:
- Analyzer implementation under
src/Meridian.Analyzer/ - Positive and negative tests under
tests/Meridian.Analyzer.Tests/ - Rule documentation under
docs/rules/ - The rule index in this
README.md docs/guide.mdordocs/usage-example.mdwhen the maintainer workflow changed
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
See CHANGELOG.md and GitHub releases for package and rule updates.