From 66a0088a68ecaf6588fd71f9d080513606f69749 Mon Sep 17 00:00:00 2001 From: drieseng Date: Sun, 12 Oct 2025 11:21:59 +0200 Subject: [PATCH] Document CA1849 as being similar to MA0042 --- docs/comparison-with-other-analyzers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/comparison-with-other-analyzers.md b/docs/comparison-with-other-analyzers.md index 7b3b5546..722eb4c1 100644 --- a/docs/comparison-with-other-analyzers.md +++ b/docs/comparison-with-other-analyzers.md @@ -60,6 +60,7 @@ | [CA1822](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822?WT.mc_id=DT-MVP-5003978) | [MA0041](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0041.md) | CA supports more cases and can be configured to only run against specific API surfaces | | [CA1826](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1826?WT.mc_id=DT-MVP-5003978) | [MA0020](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0020.md) | MA reports more cases such as `List.Find` instead of `FirstOrDefault` | | [CA1827](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1827?WT.mc_id=DT-MVP-5003978) | [MA0031](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0031.md) | MA reports more `Count()` optimizations | +| [CA1849](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1849?WT.mc_id=DT-MVP-5003978) | [MA0042](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0042.md) | MA reports less false-positives and supports [CreateAsyncScope](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.serviceproviderserviceextensions.createasyncscope?WT.mc_id=DT-MVP-5003978) | [CA1852](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1852?WT.mc_id=DT-MVP-5003978) | [MA0053](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0053.md) | CA only applies to internal types in assemblies that do not expose internal types and members and - by default - report types that inherit from [Exception] (https://learn.microsoft.com/en-us/dotnet/api/system.exception?WT.mc_id=DT-MVP-5003978), but cannot be configured to report types that define virtual members | | [CA2007](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2007?WT.mc_id=DT-MVP-5003978) | [MA0004](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md) | MA does not report when the context is needed (WPF, WinForms, Blazor, etc.) | | [CA2016](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2016?WT.mc_id=DT-MVP-5003978) | [MA0040](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0040.md) | MA rules detects more CancellationToken |