From e78339a047b37d79028d8d726007e510469cb69a Mon Sep 17 00:00:00 2001 From: Glenn Watson <5834289+glennawatson@users.noreply.github.com> Date: Tue, 4 Aug 2026 14:37:47 +1000 Subject: [PATCH 1/2] build: align the editorconfig across repos and raise every rule to error - Every dotnet_diagnostic severity is now error. - Adds the newest analyzer rules: SST1535, SST1536, SST1537, SST2019, SST2497, SST2498 and PSH1023. - The file is now identical across refit, reactiveui, Primitives, splat and Akavache apart from file_header_template. --- .editorconfig | 2644 ++++++++++++++++++++++++------------------------- 1 file changed, 1312 insertions(+), 1332 deletions(-) diff --git a/.editorconfig b/.editorconfig index 17cf350b4..9a5218763 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,8 @@ root = true # Default settings ############################################# [*] +charset = utf-8 +end_of_line = lf insert_final_newline = true indent_style = space indent_size = 4 @@ -179,176 +181,167 @@ csharp_space_between_square_brackets = false ################### # Custom Analyzers ################### -dotnet_diagnostic.AvoidAsyncVoid.severity = suggestion +dotnet_diagnostic.AvoidAsyncVoid.severity = error ################### -# Microsoft .NET Analyzers (CA) - Design Rules +# Microsoft.CodeAnalysis.NetAnalyzers (CA) ################### -dotnet_diagnostic.CA1000.severity = none # Do not declare static members on generic types — common factory pattern +# Design +dotnet_diagnostic.CA1000.severity = error # Do not declare static members on generic types — common factory pattern dotnet_diagnostic.CA1001.severity = error # Types that own disposable fields should be disposable -dotnet_diagnostic.CA1002.severity = none # Do not expose generic lists — we deliberately expose List; interface-based collections are an older convention we don't follow -dotnet_diagnostic.CA1003.severity = error # Use generic event handler instances -dotnet_diagnostic.CA1005.severity = none # Avoid excessive parameters on generic types — we deliberately expose 3+ type-parameter types (tuple-style handles, raw engine signals); the ergonomic guidance conflicts with that design +dotnet_diagnostic.CA1002.severity = error # Do not expose generic lists — we deliberately expose List; interface-based collections are an older convention we don't follow +dotnet_diagnostic.CA1003.severity = error # Use generic event handler instances — covered by SST2304 +dotnet_diagnostic.CA1005.severity = error # Avoid excessive parameters on generic types — we deliberately expose 3+ type-parameter types (tuple-style handles, raw engine signals); the ergonomic guidance conflicts with that design dotnet_diagnostic.CA1008.severity = error # Enums should have zero value -dotnet_diagnostic.CA1010.severity = none # Collections should implement generic interface — we deliberately expose concrete collection types; interface-based collections are an older convention we don't follow -dotnet_diagnostic.CA1012.severity = error # Abstract types should not have public constructors -dotnet_diagnostic.CA1014.severity = none # Mark assemblies with CLSCompliantAttribute — we don't ship CLS-compliant assemblies +dotnet_diagnostic.CA1010.severity = error # Collections should implement generic interface — we deliberately expose concrete collection types; interface-based collections are an older convention we don't follow +dotnet_diagnostic.CA1012.severity = error # Abstract types should not have public constructors — covered by SST1428 +dotnet_diagnostic.CA1014.severity = error # Mark assemblies with CLSCompliantAttribute — we don't ship CLS-compliant assemblies dotnet_diagnostic.CA1016.severity = error # Mark assemblies with AssemblyVersionAttribute -dotnet_diagnostic.CA1017.severity = none # Mark assemblies with ComVisibleAttribute — we don't ship COM-visible assemblies +dotnet_diagnostic.CA1017.severity = error # Mark assemblies with ComVisibleAttribute — we don't ship COM-visible assemblies dotnet_diagnostic.CA1018.severity = error # Mark attributes with AttributeUsageAttribute -dotnet_diagnostic.CA1019.severity = error # Define accessors for attribute arguments -dotnet_diagnostic.CA1021.severity = none # Avoid out parameters - disabled - needed for the zero-allocation idiom in Try/Find APIs and other performance-critical paths +dotnet_diagnostic.CA1019.severity = error # Define accessors for attribute arguments — conflicts with SST2324, which caps an internal attribute's accessor at internal +dotnet_diagnostic.CA1021.severity = error # Avoid out parameters - disabled - needed for the zero-allocation idiom in Try/Find APIs and other performance-critical paths dotnet_diagnostic.CA1024.severity = error # Use properties where appropriate dotnet_diagnostic.CA1027.severity = error # Mark enums with FlagsAttribute -dotnet_diagnostic.CA1028.severity = error # Enum storage should be Int32 -dotnet_diagnostic.CA1030.severity = none # Use events where appropriate — we use Rx observables instead of CLR events -dotnet_diagnostic.CA1031.severity = none # Do not catch general exception types — required at logging/dispose/IO boundaries -dotnet_diagnostic.CA1032.severity = none # Implement standard exception constructors — covered by SST1488 -dotnet_diagnostic.CA1033.severity = none # Interface methods should be callable by child types — explicit interface implementations are a deliberate design choice -dotnet_diagnostic.CA1034.severity = none # Nested types should not be visible — public nested types are sometimes the cleanest API (e.g. interface-scoped exception helpers) -dotnet_diagnostic.CA1036.severity = none # Override methods on comparable types — relational operators rarely meaningful for our types -dotnet_diagnostic.CA1040.severity = none # Avoid empty interfaces — duplicate of SST1437 (canonical); marker interfaces (IActivatableView etc.) are deliberate public API -dotnet_diagnostic.CA1041.severity = none # Provide ObsoleteAttribute message — covered by SST2308 +dotnet_diagnostic.CA1028.severity = error # Enum storage should be Int32 — covered by SST2313 +dotnet_diagnostic.CA1030.severity = error # Use events where appropriate — we use Rx observables instead of CLR events +dotnet_diagnostic.CA1031.severity = error # Do not catch general exception types — required at logging/dispose/IO boundaries +dotnet_diagnostic.CA1032.severity = error # Implement standard exception constructors — covered by SST1488 +dotnet_diagnostic.CA1033.severity = error # Interface methods should be callable by child types — explicit interface implementations are a deliberate design choice +dotnet_diagnostic.CA1034.severity = error # Nested types should not be visible — public nested types are sometimes the cleanest API (e.g. interface-scoped exception helpers) +dotnet_diagnostic.CA1036.severity = error # Override methods on comparable types — relational operators rarely meaningful for our types +dotnet_diagnostic.CA1040.severity = error # Avoid empty interfaces — duplicate of SST1437 (canonical); marker interfaces (IActivatableView etc.) are deliberate public API +dotnet_diagnostic.CA1041.severity = error # Provide ObsoleteAttribute message — covered by SST2308 dotnet_diagnostic.CA1043.severity = error # Use integral or string argument for indexers -dotnet_diagnostic.CA1044.severity = none # Properties should not be write only — covered by SST1421 -dotnet_diagnostic.CA1045.severity = none # Do not pass types by reference — we deliberately use ref-passing static helpers so they carry only the data they touch; data-oriented layout is the default here +dotnet_diagnostic.CA1044.severity = error # Properties should not be write only — covered by SST1421 +dotnet_diagnostic.CA1045.severity = error # Do not pass types by reference — we deliberately use ref-passing static helpers so they carry only the data they touch; data-oriented layout is the default here dotnet_diagnostic.CA1046.severity = error # Do not overload operator equals on reference types -dotnet_diagnostic.CA1047.severity = none # Do not declare protected member in sealed type — covered by SST1427 -dotnet_diagnostic.CA1048.severity = none # Do not declare virtual members in sealed types — covered by SST1491 -dotnet_diagnostic.CA1050.severity = error # Declare types in namespaces -dotnet_diagnostic.CA1051.severity = none # Duplicate of SST1401 (canonical) — do not declare visible instance fields -dotnet_diagnostic.CA1052.severity = error # Static holder types should be sealed -dotnet_diagnostic.CA1053.severity = error # Static holder types should not have constructors -dotnet_diagnostic.CA1054.severity = suggestion # URI parameters should not be strings -dotnet_diagnostic.CA1055.severity = suggestion # URI return values should not be strings -dotnet_diagnostic.CA1056.severity = suggestion # URI properties should not be strings +dotnet_diagnostic.CA1047.severity = error # Do not declare protected member in sealed type — covered by SST1427 +dotnet_diagnostic.CA1048.severity = error # Do not declare virtual members in sealed types — covered by SST1491 +dotnet_diagnostic.CA1050.severity = error # Declare types in namespaces — covered by SST2312 +dotnet_diagnostic.CA1051.severity = error # Duplicate of SST1401 (canonical) — do not declare visible instance fields +dotnet_diagnostic.CA1052.severity = error # Static holder types should be sealed — covered by SST1432 +dotnet_diagnostic.CA1053.severity = error # Static holder types should not have constructors — covered by SST1432 +dotnet_diagnostic.CA1054.severity = error # URI parameters should not be strings +dotnet_diagnostic.CA1055.severity = error # URI return values should not be strings +dotnet_diagnostic.CA1056.severity = error # URI properties should not be strings dotnet_diagnostic.CA1058.severity = error # Types should not extend certain base types dotnet_diagnostic.CA1059.severity = error # Members should not expose certain concrete types dotnet_diagnostic.CA1060.severity = error # Move P/Invokes to NativeMethods class -dotnet_diagnostic.CA1061.severity = error # Do not hide base class methods -dotnet_diagnostic.CA1062.severity = none # Validate arguments of public methods - Nullable=enable + we own every consumer, so the compiler already guarantees non-null params -dotnet_diagnostic.CA1063.severity = none # Implement IDisposable correctly — covered by SST2300 +dotnet_diagnostic.CA1061.severity = error # Do not hide base class methods — covered by SST2427 +dotnet_diagnostic.CA1062.severity = error # Validate arguments of public methods - Nullable=enable + we own every consumer, so the compiler already guarantees non-null params +dotnet_diagnostic.CA1063.severity = error # Implement IDisposable correctly — covered by SST2300 dotnet_diagnostic.CA1064.severity = error # Exceptions should be public -dotnet_diagnostic.CA1065.severity = none # Do not raise exceptions in unexpected locations — covered by SST1485 +dotnet_diagnostic.CA1065.severity = error # Do not raise exceptions in unexpected locations — covered by SST1485 dotnet_diagnostic.CA1066.severity = error # Implement IEquatable when overriding Equals dotnet_diagnostic.CA1067.severity = error # Override Equals when implementing IEquatable dotnet_diagnostic.CA1068.severity = error # CancellationToken parameters must come last dotnet_diagnostic.CA1069.severity = error # Enums should not have duplicate values dotnet_diagnostic.CA1070.severity = error # Do not declare event fields as virtual -################### -# Microsoft .NET Analyzers (CA) - Globalization Rules -################### -dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters — we don't ship localized resources -dotnet_diagnostic.CA1308.severity = none # Normalize strings to uppercase — ToLowerInvariant is correct for filesystem path / cache key normalization +# Globalization +dotnet_diagnostic.CA1303.severity = error # Do not pass literals as localized parameters — we don't ship localized resources +dotnet_diagnostic.CA1307.severity = error # Covered by PSH1207 (canonical) +dotnet_diagnostic.CA1308.severity = error # Normalize strings to uppercase — ToLowerInvariant is correct for filesystem path / cache key normalization +dotnet_diagnostic.CA1310.severity = error # Covered by PSH1207 (canonical) -################### -# Microsoft .NET Analyzers (CA) - Interoperability Rules -################### +# Interoperability dotnet_diagnostic.CA1401.severity = error # P/Invokes should not be visible -################### -# Microsoft .NET Analyzers (CA) - Maintainability Rules -################### -dotnet_diagnostic.CA1500.severity = none # Variable names should not match field names — covered by SST1484 -dotnet_diagnostic.CA1501.severity = none # Avoid excessive inheritance — disabled because the analyzer noticeably slows down the build -dotnet_diagnostic.CA1502.severity = none # Avoid excessive complexity — disabled because the analyzer noticeably slows down the build +# Maintainability +dotnet_diagnostic.CA1500.severity = error # Variable names should not match field names — covered by SST1484 +dotnet_diagnostic.CA1501.severity = error # Covered by SST1446 (canonical) +dotnet_diagnostic.CA1502.severity = error # Covered by SST1442 (canonical) dotnet_diagnostic.CA1505.severity = error # Avoid unmaintainable code -dotnet_diagnostic.CA1506.severity = none # Avoid excessive class coupling — adds little signal here, mostly trips on legitimate orchestration code -dotnet_diagnostic.CA1507.severity = none # Use nameof in place of string — covered by SST1463 +dotnet_diagnostic.CA1506.severity = error # Avoid excessive class coupling — adds little signal here, mostly trips on legitimate orchestration code +dotnet_diagnostic.CA1507.severity = error # Use nameof in place of string — covered by SST1463 dotnet_diagnostic.CA1508.severity = error # Avoid dead conditional code dotnet_diagnostic.CA1509.severity = error # Invalid entry in code metrics configuration file -dotnet_diagnostic.CA1510.severity = none # Use ArgumentNullException throw helper — disabled because we target older TFMs and use ArgumentExceptionHelper for cross-platform parity -dotnet_diagnostic.CA1511.severity = none # Use ArgumentException throw helper — disabled because we target older TFMs and use ArgumentExceptionHelper for cross-platform parity -dotnet_diagnostic.CA1512.severity = none # Use ArgumentOutOfRangeException throw helper — disabled because we target older TFMs and use ArgumentExceptionHelper for cross-platform parity -dotnet_diagnostic.CA1513.severity = none # Use ObjectDisposedException throw helper — disabled because we target older TFMs and use ArgumentExceptionHelper for cross-platform parity -dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument -dotnet_diagnostic.CA1515.severity = none # Consider making public types internal — interferes with tests and reflection-discovered types (BenchmarkDotNet, TUnit, etc.) +dotnet_diagnostic.CA1510.severity = error # Covered by PSH1409 (canonical) +dotnet_diagnostic.CA1511.severity = error # Covered by PSH1409 (canonical) +dotnet_diagnostic.CA1512.severity = error # Covered by PSH1409 (canonical) +dotnet_diagnostic.CA1513.severity = error # Covered by PSH1409 (canonical) +dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument — covered by PSH1220 +dotnet_diagnostic.CA1515.severity = error # Consider making public types internal — interferes with tests and reflection-discovered types (BenchmarkDotNet, TUnit, etc.) dotnet_diagnostic.CA1516.severity = error # Use cross-platform intrinsics -################### -# Microsoft .NET Analyzers (CA) - Naming Rules -################### -dotnet_diagnostic.CA1710.severity = suggestion # Identifiers should have correct suffix -dotnet_diagnostic.CA1724.severity = none # Type Names Should Not Match Namespaces — namespace/type name overlap is intentional API surface +# Naming +dotnet_diagnostic.CA1710.severity = error # Identifiers should have correct suffix +dotnet_diagnostic.CA1724.severity = error # Type Names Should Not Match Namespaces — namespace/type name overlap is intentional API surface -################### -# Microsoft .NET Analyzers (CA) - Performance Rules -################### -dotnet_diagnostic.CA1802.severity = none # Use literals where appropriate — covered by PSH1402 -dotnet_diagnostic.CA1805.severity = none # Do not initialize unnecessarily — covered by PSH1403 +# Performance +dotnet_diagnostic.CA1802.severity = error # Use literals where appropriate — covered by PSH1402 +dotnet_diagnostic.CA1805.severity = error # Do not initialize unnecessarily — covered by PSH1403 dotnet_diagnostic.CA1806.severity = error # Do not ignore method results -dotnet_diagnostic.CA1810.severity = none # Initialize reference type static fields inline — explicit static constructors are deliberate in some types +dotnet_diagnostic.CA1810.severity = error # Initialize reference type static fields inline — explicit static constructors are deliberate in some types dotnet_diagnostic.CA1812.severity = error # Avoid uninstantiated internal classes -dotnet_diagnostic.CA1813.severity = none # Avoid unsealed attributes — covered by PSH1401 -dotnet_diagnostic.CA1814.severity = none # Prefer jagged arrays over multidimensional — covered by PSH1020 -dotnet_diagnostic.CA1815.severity = none # Override equals and operator equals on value types — covered by PSH1005 -dotnet_diagnostic.CA1819.severity = none # Properties should not return arrays — incompatible with the RxUI/sqlite-net mapping style we use throughout the codebase -dotnet_diagnostic.CA1820.severity = none # Test for empty strings using string length — covered by PSH1204 -dotnet_diagnostic.CA1821.severity = none # Remove empty finalizers — covered by PSH1002 -dotnet_diagnostic.CA1822.severity = error # Mark members as static -dotnet_diagnostic.CA1823.severity = none # Avoid unused private fields — covered by SST1441 +dotnet_diagnostic.CA1813.severity = error # Avoid unsealed attributes — covered by PSH1401 +dotnet_diagnostic.CA1814.severity = error # Prefer jagged arrays over multidimensional — covered by PSH1020 +dotnet_diagnostic.CA1815.severity = error # Override equals and operator equals on value types — covered by PSH1005 +dotnet_diagnostic.CA1819.severity = error # Properties should not return arrays — incompatible with the RxUI/sqlite-net mapping style we use throughout the codebase +dotnet_diagnostic.CA1820.severity = error # Test for empty strings using string length — covered by PSH1204 +dotnet_diagnostic.CA1821.severity = error # Remove empty finalizers — covered by PSH1002 +dotnet_diagnostic.CA1822.severity = error # Mark members as static — covered by PSH1414 +dotnet_diagnostic.CA1823.severity = error # Avoid unused private fields — covered by SST1441 dotnet_diagnostic.CA1824.severity = error # Mark assemblies with NeutralResourcesLanguageAttribute -dotnet_diagnostic.CA1825.severity = none # Avoid zero-length array allocations — covered by PSH1001 -dotnet_diagnostic.CA1826.severity = none # Use property instead of Linq Enumerable method — covered by PSH1103 -dotnet_diagnostic.CA1827.severity = none # Do not use Count/LongCount when Any can be used — covered by PSH1119 -dotnet_diagnostic.CA1828.severity = error # Do not use CountAsync/LongCountAsync when AnyAsync can be used -dotnet_diagnostic.CA1829.severity = none # Use Length/Count property instead of Enumerable.Count — covered by PSH1103 -dotnet_diagnostic.CA1830.severity = none # Prefer strongly-typed Append/Insert overloads on StringBuilder — covered by PSH1202 -dotnet_diagnostic.CA1831.severity = none # Use AsSpan instead of Range-based indexers for string — covered by PSH1212 -dotnet_diagnostic.CA1832.severity = none # Use AsSpan or AsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory portion of an array — covered by PSH1019 -dotnet_diagnostic.CA1833.severity = error # Use AsSpan or AsMemory instead of Range-based indexers for getting Span or Memory portion of an array -dotnet_diagnostic.CA1834.severity = none # Use StringBuilder.Append(char) for single character strings — covered by PSH1202 -dotnet_diagnostic.CA1835.severity = none # Prefer the memory-based overloads of ReadAsync/WriteAsync methods in stream-based classes — covered by PSH1314 -dotnet_diagnostic.CA1836.severity = none # Prefer IsEmpty over Count when available — covered by PSH1117 -dotnet_diagnostic.CA1837.severity = none # Use Environment.ProcessId — covered by PSH1405 +dotnet_diagnostic.CA1825.severity = error # Avoid zero-length array allocations — covered by PSH1001 +dotnet_diagnostic.CA1826.severity = error # Use property instead of Linq Enumerable method — covered by PSH1103 +dotnet_diagnostic.CA1827.severity = error # Do not use Count/LongCount when Any can be used — covered by PSH1119 +dotnet_diagnostic.CA1828.severity = error # Do not use CountAsync/LongCountAsync when AnyAsync can be used — covered by PSH1126 +dotnet_diagnostic.CA1829.severity = error # Use Length/Count property instead of Enumerable.Count — covered by PSH1103 +dotnet_diagnostic.CA1830.severity = error # Prefer strongly-typed Append/Insert overloads on StringBuilder — covered by PSH1202 +dotnet_diagnostic.CA1831.severity = error # Use AsSpan instead of Range-based indexers for string — covered by PSH1212 +dotnet_diagnostic.CA1832.severity = error # Use AsSpan or AsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory portion of an array — covered by PSH1019 +dotnet_diagnostic.CA1833.severity = error # Use AsSpan or AsMemory instead of Range-based indexers for getting Span or Memory portion of an array — conflicts with PSH1019, which owns the array range-indexer rewrite and refuses it for mutable Span/Memory targets +dotnet_diagnostic.CA1834.severity = error # Use StringBuilder.Append(char) for single character strings — covered by PSH1202 +dotnet_diagnostic.CA1835.severity = error # Prefer the memory-based overloads of ReadAsync/WriteAsync methods in stream-based classes — covered by PSH1314 +dotnet_diagnostic.CA1836.severity = error # Prefer IsEmpty over Count when available — covered by PSH1117 +dotnet_diagnostic.CA1837.severity = error # Use Environment.ProcessId — covered by PSH1405 dotnet_diagnostic.CA1838.severity = error # Avoid StringBuilder parameters for P/Invokes -dotnet_diagnostic.CA1839.severity = none # Use Environment.ProcessPath — covered by PSH1405 -dotnet_diagnostic.CA1840.severity = none # Use Environment.CurrentManagedThreadId — covered by PSH1405 -dotnet_diagnostic.CA1841.severity = none # Prefer Dictionary.Contains methods — covered by PSH1407 -dotnet_diagnostic.CA1842.severity = none # Do not use 'WhenAll' with a single task — covered by PSH1301 -dotnet_diagnostic.CA1843.severity = none # Do not use 'WaitAll' with a single task — covered by PSH1301 +dotnet_diagnostic.CA1839.severity = error # Use Environment.ProcessPath — covered by PSH1405 +dotnet_diagnostic.CA1840.severity = error # Use Environment.CurrentManagedThreadId — covered by PSH1405 +dotnet_diagnostic.CA1841.severity = error # Prefer Dictionary.Contains methods — covered by PSH1407 +dotnet_diagnostic.CA1842.severity = error # Do not use 'WhenAll' with a single task — covered by PSH1301 +dotnet_diagnostic.CA1843.severity = error # Do not use 'WaitAll' with a single task — covered by PSH1301 dotnet_diagnostic.CA1844.severity = error # Provide memory-based overrides of async methods when subclassing 'Stream' -dotnet_diagnostic.CA1845.severity = error # Use span-based 'string.Concat' -dotnet_diagnostic.CA1846.severity = none # Prefer AsSpan over Substring — covered by PSH1212 -dotnet_diagnostic.CA1847.severity = none # Use char literal for a single character lookup — disabled because the string.Contains(char) overload doesn't exist on .NET Framework / netstandard2.0 and we target both +dotnet_diagnostic.CA1845.severity = error # Use span-based 'string.Concat' — covered by PSH1222 +dotnet_diagnostic.CA1846.severity = error # Prefer AsSpan over Substring — covered by PSH1212 +dotnet_diagnostic.CA1847.severity = error # Covered by PSH1201 (canonical) dotnet_diagnostic.CA1848.severity = error # Use the LoggerMessage delegates -dotnet_diagnostic.CA1849.severity = none # Call async methods when in an async method — covered by PSH1313 -dotnet_diagnostic.CA1850.severity = none # Prefer static HashData method over ComputeHash — covered by PSH1400 +dotnet_diagnostic.CA1849.severity = error # Call async methods when in an async method — covered by PSH1313 +dotnet_diagnostic.CA1850.severity = error # Prefer static HashData method over ComputeHash — covered by PSH1400 dotnet_diagnostic.CA1851.severity = error # Possible multiple enumerations of IEnumerable collection -dotnet_diagnostic.CA1852.severity = none # Seal internal types — covered by PSH1411 +dotnet_diagnostic.CA1852.severity = error # Seal internal types — covered by PSH1411 dotnet_code_quality.CA1852.api_surface = private, internal # only flag non-public classes; public classes stay open for inheritance -dotnet_diagnostic.CA1853.severity = none # Unnecessary call to 'Dictionary.ContainsKey(key)' — covered by PSH1105 -dotnet_diagnostic.CA1854.severity = none # Prefer the IDictionary.TryGetValue method — covered by PSH1104 +dotnet_diagnostic.CA1853.severity = error # Unnecessary call to 'Dictionary.ContainsKey(key)' — covered by PSH1105 +dotnet_diagnostic.CA1854.severity = error # Prefer the IDictionary.TryGetValue method — covered by PSH1104 dotnet_diagnostic.CA1855.severity = error # Prefer 'Clear' over 'Fill' dotnet_diagnostic.CA1856.severity = error # Incorrect usage of ConstantExpected attribute dotnet_diagnostic.CA1857.severity = error # A constant is expected for the parameter -dotnet_diagnostic.CA1858.severity = error # Use 'StartsWith' instead of 'IndexOf' +dotnet_diagnostic.CA1858.severity = error # Use 'StartsWith' instead of 'IndexOf' — covered by PSH1221 dotnet_diagnostic.CA1859.severity = error # Use concrete types when possible for improved performance -dotnet_diagnostic.CA1860.severity = none # Avoid using 'Enumerable.Any()' extension method — covered by PSH1103 -dotnet_diagnostic.CA1861.severity = none # Avoid constant arrays as arguments — covered by PSH1004 -dotnet_diagnostic.CA1862.severity = none # Use the 'StringComparison' overloads for case-insensitive comparisons — covered by PSH1200 -dotnet_diagnostic.CA1863.severity = error # Use 'CompositeFormat' -dotnet_diagnostic.CA1864.severity = none # Prefer the 'IDictionary.TryAdd' method — covered by PSH1115 -dotnet_diagnostic.CA1865.severity = none # Use char overload (string.StartsWith) — disabled because the string.StartsWith(char) overload doesn't exist on .NET Framework / netstandard2.0 and we target both -dotnet_diagnostic.CA1866.severity = none # Use char overload (string.EndsWith) — disabled because the string.EndsWith(char) overload doesn't exist on .NET Framework / netstandard2.0 and we target both -dotnet_diagnostic.CA1867.severity = none # Use char overload (string.IndexOf / string.LastIndexOf) — disabled because the char overloads don't exist on .NET Framework / netstandard2.0 and we target both -dotnet_diagnostic.CA1868.severity = none # Unnecessary call to 'Contains' for sets — covered by PSH1105 -dotnet_diagnostic.CA1869.severity = none # Cache and reuse 'JsonSerializerOptions' instances — covered by PSH1416 -dotnet_diagnostic.CA1870.severity = none # Use a cached 'SearchValues' instance — covered by PSH1213 +dotnet_diagnostic.CA1860.severity = error # Avoid using 'Enumerable.Any()' extension method — covered by PSH1103 +dotnet_diagnostic.CA1861.severity = error # Avoid constant arrays as arguments — covered by PSH1004 +dotnet_diagnostic.CA1862.severity = error # Use the 'StringComparison' overloads for case-insensitive comparisons — covered by PSH1200 +dotnet_diagnostic.CA1863.severity = error # Use 'CompositeFormat' — covered by PSH1223 +dotnet_diagnostic.CA1864.severity = error # Prefer the 'IDictionary.TryAdd' method — covered by PSH1115 +dotnet_diagnostic.CA1865.severity = error # Covered by PSH1201 (canonical) +dotnet_diagnostic.CA1866.severity = error # Covered by PSH1201 (canonical) +dotnet_diagnostic.CA1867.severity = error # Covered by PSH1201 (canonical) +dotnet_diagnostic.CA1868.severity = error # Unnecessary call to 'Contains' for sets — covered by PSH1105 +dotnet_diagnostic.CA1869.severity = error # Cache and reuse 'JsonSerializerOptions' instances — covered by PSH1416 +dotnet_diagnostic.CA1870.severity = error # Use a cached 'SearchValues' instance — covered by PSH1213 dotnet_diagnostic.CA1871.severity = error # Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull' -dotnet_diagnostic.CA1872.severity = none # Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString' — covered by PSH1224 -dotnet_diagnostic.CA1873.severity = error # Avoid potentially expensive evaluation of arguments to 'Debug.Assert' -dotnet_diagnostic.CA1874.severity = none # Use 'Regex.IsMatch' — covered by PSH1406 -dotnet_diagnostic.CA1875.severity = none # Use 'Regex.Count' — covered by PSH1406 -dotnet_diagnostic.CA1877.severity = error # Use 'Encoding.GetString' instead of 'Encoding.GetChars' - -################### -# Microsoft .NET Analyzers (CA) - Reliability Rules -################### -dotnet_diagnostic.CA2000.severity = suggestion # Dispose objects before losing scope +dotnet_diagnostic.CA1872.severity = error # Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString' — covered by PSH1224 +dotnet_diagnostic.CA1873.severity = error # Avoid potentially expensive evaluation of arguments to 'Debug.Assert' — covered by PSH1417 +dotnet_diagnostic.CA1874.severity = error # Use 'Regex.IsMatch' — covered by PSH1406 +dotnet_diagnostic.CA1875.severity = error # Use 'Regex.Count' — covered by PSH1406 +dotnet_diagnostic.CA1877.severity = error # Use 'Encoding.GetString' instead of 'Encoding.GetChars' — covered by PSH1225 + +# Reliability +dotnet_diagnostic.CA2000.severity = error # Dispose objects before losing scope dotnet_diagnostic.CA2002.severity = error # Do not lock on objects with weak identity -dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task — Rx and library callers drive synchronization context themselves +dotnet_diagnostic.CA2007.severity = error # Do not directly await a Task — Rx and library callers drive synchronization context themselves dotnet_diagnostic.CA2008.severity = error # Do not create tasks without passing a TaskScheduler dotnet_diagnostic.CA2009.severity = error # Do not call ToImmutableCollection on an ImmutableCollection value dotnet_diagnostic.CA2011.severity = error # Do not assign property within its setter @@ -368,41 +361,39 @@ dotnet_diagnostic.CA2024.severity = error # Do not use 'StreamReader.EndOfStream dotnet_diagnostic.CA2025.severity = error # Do not pass 'IDisposable' instances into unawaited tasks dotnet_diagnostic.CA2026.severity = error # Do not use methods or types annotated with [RequiresDynamicCode] in code that uses [RequiresDynamicCode] -################### -# Microsoft .NET Analyzers (CA) - Usage Rules -################### +# Usage dotnet_diagnostic.CA1801.severity = error # Review unused parameters dotnet_code_quality.CA1801.api_surface = private, internal # only flag non-public APIs so we don't break public signatures dotnet_diagnostic.CA1816.severity = error # Call GC.SuppressFinalize correctly -dotnet_diagnostic.CA2200.severity = error # Rethrow to preserve stack details +dotnet_diagnostic.CA2200.severity = error # Rethrow to preserve stack details — covered by SST1430 dotnet_diagnostic.CA2201.severity = error # Do not raise reserved exception types dotnet_diagnostic.CA2207.severity = error # Initialize value type static fields inline -dotnet_diagnostic.CA2208.severity = none # Instantiate argument exceptions correctly — too sensitive: flags valid context-forwarding nameof(arg.Property) patterns -dotnet_diagnostic.CA2211.severity = none # Non-constant fields should not be visible — covered by SST1499 +dotnet_diagnostic.CA2208.severity = error # Instantiate argument exceptions correctly — too sensitive: flags valid context-forwarding nameof(arg.Property) patterns +dotnet_diagnostic.CA2211.severity = error # Non-constant fields should not be visible — covered by SST1499 dotnet_diagnostic.CA2213.severity = error # Disposable fields should be disposed -dotnet_diagnostic.CA2214.severity = error # Do not call overridable methods in constructors +dotnet_diagnostic.CA2214.severity = error # Do not call overridable methods in constructors — covered by SST1483 dotnet_diagnostic.CA2215.severity = error # Dispose methods should call base class dispose -dotnet_diagnostic.CA2216.severity = error # Disposable types should declare finalizer -dotnet_diagnostic.CA2217.severity = none # Do not mark enums with FlagsAttribute — covered by SST2303 +dotnet_diagnostic.CA2216.severity = error # Disposable types should declare finalizer — conflicts with SST2317, which owns the owned-native-handle shape and prescribes a SafeHandle instead of a finalizer +dotnet_diagnostic.CA2217.severity = error # Do not mark enums with FlagsAttribute — covered by SST2303 dotnet_diagnostic.CA2218.severity = error # Override GetHashCode on overriding Equals dotnet_diagnostic.CA2219.severity = error # Do not raise exceptions in finally clauses -dotnet_diagnostic.CA2224.severity = error # Override Equals on overloading operator equals +dotnet_diagnostic.CA2224.severity = error # Override Equals on overloading operator equals — covered by SST2302 dotnet_diagnostic.CA2225.severity = error # Operator overloads have named alternates dotnet_diagnostic.CA2226.severity = error # Operators should have symmetrical overloads -dotnet_diagnostic.CA2227.severity = none # Collection properties should be read only — settable collection properties are common in our DTOs and config types +dotnet_diagnostic.CA2227.severity = error # Collection properties should be read only — settable collection properties are common in our DTOs and config types dotnet_diagnostic.CA2231.severity = error # Overload operator equals on overriding ValueType.Equals dotnet_diagnostic.CA2234.severity = error # Pass System.Uri objects instead of strings dotnet_diagnostic.CA2241.severity = error # Provide correct arguments to formatting methods -dotnet_diagnostic.CA2242.severity = error # Test for NaN correctly +dotnet_diagnostic.CA2242.severity = error # Test for NaN correctly — covered by SST1473 dotnet_diagnostic.CA2243.severity = error # Attribute string literals should parse correctly dotnet_diagnostic.CA2244.severity = error # Do not duplicate indexed element initializations -dotnet_diagnostic.CA2245.severity = error # Do not assign a property to itself +dotnet_diagnostic.CA2245.severity = error # Do not assign a property to itself — covered by SST1189 dotnet_diagnostic.CA2246.severity = error # Do not assign a symbol and its member in the same statement dotnet_diagnostic.CA2247.severity = error # Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum dotnet_diagnostic.CA2248.severity = error # Provide correct enum argument to Enum.HasFlag dotnet_diagnostic.CA2249.severity = error # Use String.Contains instead of String.IndexOf for substring checks dotnet_diagnostic.CA2250.severity = error # Use ThrowIfCancellationRequested -dotnet_diagnostic.CA2251.severity = error # Use String.Equals over String.Compare +dotnet_diagnostic.CA2251.severity = error # Covered by PSH1216 (canonical) dotnet_diagnostic.CA2252.severity = error # Opt in to preview features before using them dotnet_diagnostic.CA2253.severity = error # Named placeholders should not be numeric values dotnet_diagnostic.CA2254.severity = error # Template should be a static expression @@ -423,9 +414,7 @@ dotnet_diagnostic.CA2268.severity = error # Use 'string.Equals(string, string, S # Skipped (deprecated ISerializable formatter): CA2229 Implement serialization constructors, # CA2235 Mark all non-serializable fields, CA2237 Mark ISerializable types with SerializableAttribute. -################### -# Microsoft .NET Analyzers (CA) - Security Rules -################### +# Security # SQL Injection & Command Injection dotnet_diagnostic.CA2100.severity = error # Review SQL queries for security vulnerabilities @@ -548,16 +537,9 @@ dotnet_diagnostic.CA2153.severity = error # Do not catch corrupted state excepti dotnet_diagnostic.CA5367.severity = error # Do not serialize types with pointer fields ################### -# SonarAnalyzer (Sxxxx) — global suppressions -################### -dotnet_diagnostic.S1075.severity = none # Hardcoded URI — canonical SourceLink hosts are the point -dotnet_diagnostic.S2436.severity = none # Too many generic parameters — needed for the projector overload -dotnet_diagnostic.S4036.severity = none # PATH-relative process spawn — benchmark only, trusted env -dotnet_diagnostic.S8969.severity = none # Null-forgiving operators preserve intent across target-framework nullable annotations - -################### -# Microsoft .NET Runtime Obsoletions (SYSLIB0xxx) +# Microsoft .NET SDK Diagnostics (SYSLIB) ################### +# Runtime obsoletions dotnet_diagnostic.SYSLIB0001.severity = error # The UTF-7 encoding is insecure and should not be used dotnet_diagnostic.SYSLIB0002.severity = error # PrincipalPermissionAttribute is not honored by the runtime and must not be used dotnet_diagnostic.SYSLIB0003.severity = error # Code Access Security (CAS) is not supported or honored by the runtime @@ -620,9 +602,7 @@ dotnet_diagnostic.SYSLIB0059.severity = error # SystemEvents.EventsThreadShutdow dotnet_diagnostic.SYSLIB0060.severity = error # Constructors of DirectoryServices.ActiveDirectory.ConfigurationContext are obsolete dotnet_diagnostic.SYSLIB0061.severity = error # CryptographyConfig.AddOID and AddAlgorithm methods are obsolete -################### -# Microsoft .NET Source Generator Diagnostics (SYSLIB1xxx) -################### +# Source generators # LoggerMessage source generator dotnet_diagnostic.SYSLIB1001.severity = error # Logging method names cannot start with _ dotnet_diagnostic.SYSLIB1002.severity = error # Don't include log level parameters as templates in the logging message @@ -710,8 +690,9 @@ dotnet_diagnostic.SYSLIB1103.severity = error # Configuration binding source gen dotnet_diagnostic.SYSLIB1104.severity = error # Configuration binding source generator: language version is too low ################### -# Microsoft .NET Style Rules (IDExxxx) - Language Rules +# Microsoft .NET Code Style Analyzers (IDE) ################### +# Language rules # EnforceCodeStyleInBuild=true (set in Directory.Build.props) promotes these # IDE rules into `dotnet build` so they fire at compile time, not just in the # IDE. We enable the ones that are unambiguous wins and skip the rules that @@ -719,346 +700,398 @@ dotnet_diagnostic.SYSLIB1104.severity = error # Configuration binding source gen # etc.) so we don't double-report. # Bug catchers — always error. -dotnet_diagnostic.IDE0035.severity = none # Remove unreachable code — covered by SST1453 -dotnet_diagnostic.IDE0043.severity = none # Format string contains invalid placeholder — covered by SST1454 -dotnet_diagnostic.IDE0052.severity = none # Remove unread private member — covered by SST1441 +dotnet_diagnostic.IDE0035.severity = error # Remove unreachable code — covered by SST1453 +dotnet_diagnostic.IDE0043.severity = error # Format string contains invalid placeholder — covered by SST1454 +dotnet_diagnostic.IDE0052.severity = error # Remove unread private member — covered by SST1441 # Simplification / cleanup. -dotnet_diagnostic.IDE0002.severity = none # Simplify member access — covered by SST1117 -dotnet_diagnostic.IDE0004.severity = none # Remove unnecessary cast — covered by SST1175 -dotnet_diagnostic.IDE0016.severity = none # Use throw expression — covered by SST2207 -dotnet_diagnostic.IDE0019.severity = none # Use pattern matching to avoid 'as' followed by a 'null' check — covered by SST2005/SST2274 -dotnet_diagnostic.IDE0028.severity = none # Use collection initializers — covered by SST1194 -dotnet_diagnostic.IDE0031.severity = none # Use null propagation — covered by SST1196 -dotnet_diagnostic.IDE0038.severity = none # Use pattern matching ('is' check without a cast) — covered by SST2007 -dotnet_diagnostic.IDE0041.severity = none # Use 'is null' check — covered by SST1149/SST2231/SST2282 -dotnet_diagnostic.IDE0042.severity = none # Deconstruct variable declaration — covered by SST2214 -dotnet_diagnostic.IDE0044.severity = none # Add readonly modifier — covered by SST1424 -dotnet_diagnostic.IDE0047.severity = none # Remove unnecessary parentheses — covered by SST1459 -dotnet_diagnostic.IDE0049.severity = none # Use language keywords instead of framework type names for type references — covered by SST1121 -dotnet_diagnostic.IDE0057.severity = none # Use range operator — covered by SST2204 -dotnet_diagnostic.IDE0059.severity = none # Remove unnecessary value assignment — covered by SST2222 +dotnet_diagnostic.IDE0002.severity = error # Simplify member access — covered by SST1117 +dotnet_diagnostic.IDE0004.severity = error # Remove unnecessary cast — covered by SST1175 +dotnet_diagnostic.IDE0016.severity = error # Use throw expression — covered by SST2207 +dotnet_diagnostic.IDE0019.severity = error # Use pattern matching to avoid 'as' followed by a 'null' check — covered by SST2005/SST2274 +dotnet_diagnostic.IDE0028.severity = error # Use collection initializers — covered by SST1194 +dotnet_diagnostic.IDE0031.severity = error # Use null propagation — covered by SST1196 +dotnet_diagnostic.IDE0038.severity = error # Use pattern matching ('is' check without a cast) — covered by SST2007 +dotnet_diagnostic.IDE0041.severity = error # Use 'is null' check — covered by SST1149/SST2231/SST2282 +dotnet_diagnostic.IDE0042.severity = error # Deconstruct variable declaration — covered by SST2214 +dotnet_diagnostic.IDE0044.severity = error # Add readonly modifier — covered by SST1424 +dotnet_diagnostic.IDE0047.severity = error # Remove unnecessary parentheses — covered by SST1459 +dotnet_diagnostic.IDE0049.severity = error # Use language keywords instead of framework type names for type references — covered by SST1121 +dotnet_diagnostic.IDE0057.severity = error # Use range operator — covered by SST2204 +dotnet_diagnostic.IDE0059.severity = error # Remove unnecessary value assignment — covered by SST2222 dotnet_diagnostic.IDE0064.severity = error # Make struct fields writable — flag readonly-but-mutable struct fields where intent diverges from declaration -dotnet_diagnostic.IDE0066.severity = none # Use switch expression — covered by SST2201 -dotnet_diagnostic.IDE0075.severity = none # Simplify conditional expression — covered by SST1182 -dotnet_diagnostic.IDE0078.severity = none # Use pattern matching — covered by SST2006/SST2231 +dotnet_diagnostic.IDE0066.severity = error # Use switch expression — covered by SST2201 +dotnet_diagnostic.IDE0075.severity = error # Simplify conditional expression — covered by SST1182 +dotnet_diagnostic.IDE0078.severity = error # Use pattern matching — covered by SST2006/SST2231 dotnet_diagnostic.IDE0084.severity = error # Use pattern matching ('IsNot' operator) -dotnet_diagnostic.IDE0120.severity = none # Simplify LINQ expression — covered by PSH1100/PSH1101 -dotnet_diagnostic.IDE0221.severity = none # Add explicit cast — covered by SST2226 -dotnet_diagnostic.IDE0250.severity = none # Make struct 'readonly' — covered by PSH1014 -dotnet_diagnostic.IDE0260.severity = none # Use pattern matching — covered by SST2006/SST2231 +dotnet_diagnostic.IDE0120.severity = error # Simplify LINQ expression — covered by PSH1100/PSH1101 +dotnet_diagnostic.IDE0221.severity = error # Add explicit cast — covered by SST2226 +dotnet_diagnostic.IDE0250.severity = error # Make struct 'readonly' — covered by PSH1014 +dotnet_diagnostic.IDE0260.severity = error # Use pattern matching — covered by SST2006/SST2231 # Disabled — conflict with an existing SA/CA rule or project convention. -dotnet_diagnostic.IDE0007.severity = none # Use var — we don't force var in either direction -dotnet_diagnostic.IDE0008.severity = none # Use explicit type — we don't force var in either direction -dotnet_diagnostic.IDE0009.severity = none # Member access should be qualified — SA1101 = none -dotnet_diagnostic.IDE0021.severity = none # Use expression body for constructors — covered by SST2276 (opt-in) -dotnet_diagnostic.IDE0022.severity = none # Use expression body for methods — covered by SST2275 -dotnet_diagnostic.IDE0023.severity = none # Use expression body for conversion operators — covered by SST2278 (opt-in) -dotnet_diagnostic.IDE0024.severity = none # Use expression body for operators — covered by SST2277 (opt-in) -dotnet_diagnostic.IDE0025.severity = none # Use expression body for properties — covered by SST2279 -dotnet_diagnostic.IDE0026.severity = none # Use expression body for indexers — covered by SST2280 -dotnet_diagnostic.IDE0048.severity = none # Add parentheses for clarity — preference not enforced -dotnet_diagnostic.IDE0055.severity = none # Formatting — StyleCop SA rules own formatting -dotnet_diagnostic.IDE0058.severity = none # Remove unnecessary expression value — covered by SST2221 -dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter — CA1801 handles (with api_surface config) -dotnet_diagnostic.IDE0061.severity = none # Use expression body for local function — covered by SST2281 -dotnet_diagnostic.IDE0079.severity = none # Remove unnecessary suppression — can misfire on multi-TFM suppressions -dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure — we don't enforce strict mirror -dotnet_diagnostic.IDE0160.severity = none # Use block-scoped namespace — we use file-scoped (IDE0161) -dotnet_diagnostic.IDE0210.severity = none # Convert to top-level statements — we use Main style -dotnet_diagnostic.IDE0211.severity = none # Convert to 'Program.Main' style — we use Main style -dotnet_diagnostic.IDE0300.severity = none # Use collection expression for array — covered by SST2101 -dotnet_diagnostic.IDE0306.severity = none # Use collection expression for new — covered by SST2101 -dotnet_diagnostic.IDE0320.severity = none # Make anonymous function static — covered by PSH1000 -dotnet_diagnostic.IDE0050.severity = none # Convert anonymous type to tuple — covered by SST2224 -dotnet_diagnostic.IDE0310.severity = none # Convert lambda expression to method group — handled by RCS1207 -dotnet_diagnostic.IDE0360.severity = none # Simplify property accessor — covered by SST2219 -dotnet_diagnostic.IDE0370.severity = none # Remove unnecessary suppression (null-forgiving operator) — disabled for the same reason as RCS1249: multi-TFM nullability annotations can differ per platform - -################### -# Microsoft .NET Style Rules (IDE1xxx / IDE3xxx) - Naming & Miscellaneous -################### +dotnet_diagnostic.IDE0007.severity = error # Use var — we don't force var in either direction +dotnet_diagnostic.IDE0008.severity = error # Use explicit type — we don't force var in either direction +dotnet_diagnostic.IDE0009.severity = error # Member access should be qualified — SA1101 = none +dotnet_diagnostic.IDE0021.severity = error # Use expression body for constructors — covered by SST2276 (opt-in) +dotnet_diagnostic.IDE0022.severity = error # Use expression body for methods — covered by SST2275 +dotnet_diagnostic.IDE0023.severity = error # Use expression body for conversion operators — covered by SST2278 (opt-in) +dotnet_diagnostic.IDE0024.severity = error # Use expression body for operators — covered by SST2277 (opt-in) +dotnet_diagnostic.IDE0025.severity = error # Use expression body for properties — covered by SST2279 +dotnet_diagnostic.IDE0026.severity = error # Use expression body for indexers — covered by SST2280 +dotnet_diagnostic.IDE0048.severity = error # Add parentheses for clarity — preference not enforced +dotnet_diagnostic.IDE0055.severity = error # Formatting — StyleCop SA rules own formatting +dotnet_diagnostic.IDE0058.severity = error # Remove unnecessary expression value — covered by SST2221 +dotnet_diagnostic.IDE0060.severity = error # Remove unused parameter — CA1801 handles (with api_surface config) +dotnet_diagnostic.IDE0061.severity = error # Use expression body for local function — covered by SST2281 +dotnet_diagnostic.IDE0079.severity = error # Remove unnecessary suppression — can misfire on multi-TFM suppressions +dotnet_diagnostic.IDE0130.severity = error # Namespace does not match folder structure — we don't enforce strict mirror +dotnet_diagnostic.IDE0160.severity = error # Use block-scoped namespace — we use file-scoped (IDE0161) +dotnet_diagnostic.IDE0210.severity = error # Convert to top-level statements — we use Main style +dotnet_diagnostic.IDE0211.severity = error # Convert to 'Program.Main' style — we use Main style +dotnet_diagnostic.IDE0300.severity = error # Use collection expression for array — covered by SST2101 +dotnet_diagnostic.IDE0306.severity = error # Use collection expression for new — covered by SST2101 +dotnet_diagnostic.IDE0320.severity = error # Make anonymous function static — covered by PSH1000 +dotnet_diagnostic.IDE0050.severity = error # Convert anonymous type to tuple — covered by SST2224 +dotnet_diagnostic.IDE0310.severity = error # Convert lambda expression to method group — handled by RCS1207 +dotnet_diagnostic.IDE0360.severity = error # Simplify property accessor — covered by SST2219 +dotnet_diagnostic.IDE0370.severity = error # Remove unnecessary suppression (null-forgiving operator) — disabled for the same reason as RCS1249: multi-TFM nullability annotations can differ per platform + +# Language and unnecessary code rules. +dotnet_diagnostic.IDE0001.severity = error # Simplify name +dotnet_diagnostic.IDE0003.severity = error # Name can be simplified +dotnet_diagnostic.IDE0005.severity = error # Remove unnecessary import +dotnet_diagnostic.IDE0010.severity = error # Add missing cases to switch statement +dotnet_diagnostic.IDE0011.severity = error # Add braces +dotnet_diagnostic.IDE0017.severity = error # Use object initializers +dotnet_diagnostic.IDE0018.severity = error # Inline variable declaration +dotnet_diagnostic.IDE0020.severity = error # Use pattern matching to avoid is check followed by a cast (with variable) +dotnet_diagnostic.IDE0027.severity = error # Use expression body for accessors +dotnet_diagnostic.IDE0029.severity = error # Null check can be simplified +dotnet_diagnostic.IDE0030.severity = error # Null check can be simplified +dotnet_diagnostic.IDE0032.severity = error # Use auto property +dotnet_diagnostic.IDE0033.severity = error # Use explicitly provided tuple name +dotnet_diagnostic.IDE0034.severity = error # Simplify default expression +dotnet_diagnostic.IDE0036.severity = error # Order modifiers +dotnet_diagnostic.IDE0037.severity = error # Use inferred member name +dotnet_diagnostic.IDE0039.severity = error # Use local function instead of lambda +dotnet_diagnostic.IDE0040.severity = error # Add accessibility modifiers +dotnet_diagnostic.IDE0045.severity = error # Use conditional expression for assignment +dotnet_diagnostic.IDE0046.severity = error # Use conditional expression for return +dotnet_diagnostic.IDE0051.severity = error # Remove unused private member +dotnet_diagnostic.IDE0053.severity = error # Use expression body for lambdas +dotnet_diagnostic.IDE0054.severity = error # Use compound assignment +dotnet_diagnostic.IDE0056.severity = error # Use index operator +dotnet_diagnostic.IDE0062.severity = error # Make local function static +dotnet_diagnostic.IDE0063.severity = error # Use simple using statement +dotnet_diagnostic.IDE0065.severity = error # Using directive placement +dotnet_diagnostic.IDE0070.severity = error # Use System.HashCode.Combine +dotnet_diagnostic.IDE0071.severity = error # Simplify interpolation +dotnet_diagnostic.IDE0072.severity = error # Add missing cases to switch expression +dotnet_diagnostic.IDE0073.severity = error # Use file header +dotnet_diagnostic.IDE0074.severity = error # Use coalesce compound assignment +dotnet_diagnostic.IDE0076.severity = error # Remove invalid global SuppressMessageAttribute +dotnet_diagnostic.IDE0077.severity = error # Avoid legacy format target in global SuppressMessageAttribute +dotnet_diagnostic.IDE0080.severity = error # Remove unnecessary suppression operator +dotnet_diagnostic.IDE0082.severity = error # Convert typeof to nameof +dotnet_diagnostic.IDE0083.severity = error # Use pattern matching (not operator) +dotnet_diagnostic.IDE0090.severity = error # Simplify new expression +dotnet_diagnostic.IDE0100.severity = error # Remove unnecessary equality operator +dotnet_diagnostic.IDE0110.severity = error # Remove unnecessary discard +dotnet_diagnostic.IDE0150.severity = error # Prefer null check over type check +dotnet_diagnostic.IDE0161.severity = error # Use file-scoped namespace +dotnet_diagnostic.IDE0170.severity = error # Simplify property pattern +dotnet_diagnostic.IDE0180.severity = error # Use tuple to swap values +dotnet_diagnostic.IDE0200.severity = error # Remove unnecessary lambda expression +dotnet_diagnostic.IDE0220.severity = error # Add explicit cast in foreach loop +dotnet_diagnostic.IDE0230.severity = error # Use UTF-8 string literal +dotnet_diagnostic.IDE0240.severity = error # Nullable directive is redundant +dotnet_diagnostic.IDE0241.severity = error # Nullable directive is unnecessary +dotnet_diagnostic.IDE0251.severity = error # Member can be made readonly +dotnet_diagnostic.IDE0270.severity = error # Null check can be simplified +dotnet_diagnostic.IDE0280.severity = error # Use nameof +dotnet_diagnostic.IDE0290.severity = error # Use primary constructor +dotnet_diagnostic.IDE0301.severity = error # Use collection expression for empty +dotnet_diagnostic.IDE0302.severity = error # Use collection expression for stackalloc +dotnet_diagnostic.IDE0303.severity = error # Use collection expression for Create() +dotnet_diagnostic.IDE0304.severity = error # Use collection expression for builder +dotnet_diagnostic.IDE0305.severity = error # Use collection expression for fluent +dotnet_diagnostic.IDE0340.severity = error # Use unbound generic type +dotnet_diagnostic.IDE0350.severity = error # Use implicitly typed lambda +dotnet_diagnostic.IDE0380.severity = error # Remove unnecessary unsafe modifier +dotnet_diagnostic.IDE1005.severity = error # Use conditional delegate call + +# Naming and miscellaneous # Naming conventions — SA1300 family already enforces PascalCase / interface # prefix / field casing (with our _underscore convention on SA1306/1309/1311 # deliberately disabled). Leaving IDE1006 off because configuring # `dotnet_naming_rule.*` would duplicate what SA already enforces and could # conflict with the _underscore convention. -dotnet_diagnostic.IDE1006.severity = none # Naming rule violation — SA1300 family handles naming -dotnet_diagnostic.IDE3000.severity = none # Disabled per project convention — not enforced +dotnet_diagnostic.IDE1006.severity = error # Naming rule violation — SA1300 family handles naming +dotnet_diagnostic.IDE3000.severity = error # Disabled per project convention — not enforced ################### -# Roslynator Analyzers (RCS1xxx) - Code Simplification +# Roslynator.CSharp.Analyzers (RCS) ################### -dotnet_diagnostic.RCS1001.severity = error # Add braces (when expression spans over multiple lines) -dotnet_diagnostic.RCS1003.severity = error # Add braces to if-else (when expression spans over multiple lines) +# Code simplification +dotnet_diagnostic.RCS1001.severity = error # Add braces (when expression spans over multiple lines) — covered by SST1519 +dotnet_diagnostic.RCS1003.severity = error # Add braces to if-else (when expression spans over multiple lines) — covered by SST1519 dotnet_diagnostic.RCS1005.severity = error # Simplify nested using statement -dotnet_diagnostic.RCS1006.severity = error # Merge 'else' with nested 'if' +dotnet_diagnostic.RCS1006.severity = error # Merge 'else' with nested 'if' — covered by SST1465 dotnet_diagnostic.RCS1007.severity = error # Add braces -dotnet_diagnostic.RCS1031.severity = none # Remove unnecessary braces in switch section -- we don't mind braces in switch statements +dotnet_diagnostic.RCS1031.severity = error # Remove unnecessary braces in switch section -- we don't mind braces in switch statements dotnet_diagnostic.RCS1032.severity = error # Remove redundant parentheses -dotnet_diagnostic.RCS1033.severity = error # Remove redundant boolean literal -dotnet_diagnostic.RCS1039.severity = error # Remove argument list from attribute -dotnet_diagnostic.RCS1042.severity = none # Remove enum default underlying type — covered by SST1177 +dotnet_diagnostic.RCS1033.severity = error # Remove redundant boolean literal — covered by SST1143 +dotnet_diagnostic.RCS1039.severity = error # Remove argument list from attribute — covered by SST1411 +dotnet_diagnostic.RCS1040.severity = error # Remove empty statement — covered by SST1180 +dotnet_diagnostic.RCS1042.severity = error # Remove enum default underlying type — covered by SST1177 dotnet_diagnostic.RCS1043.severity = error # Remove 'partial' modifier from type with a single part -dotnet_diagnostic.RCS1049.severity = error # Simplify boolean comparison -dotnet_diagnostic.RCS1058.severity = none # Use compound assignment — covered by SST1185 -dotnet_diagnostic.RCS1061.severity = none # Merge 'if' with nested 'if' — covered by SST2013 -dotnet_diagnostic.RCS1068.severity = none # Simplify logical negation — covered by SST1172/SST2006 -dotnet_diagnostic.RCS1069.severity = error # Remove unnecessary case label -dotnet_diagnostic.RCS1070.severity = none # Remove redundant default switch section — covered by SST1179 -dotnet_diagnostic.RCS1071.severity = none # Remove redundant base constructor call — covered by SST1178 -dotnet_diagnostic.RCS1072.severity = none # Remove empty namespace declaration — covered by SST1435 -dotnet_diagnostic.RCS1073.severity = error # Convert 'if' to 'return' statement -dotnet_diagnostic.RCS1074.severity = none # Remove redundant constructor — covered by SST1433 -dotnet_diagnostic.RCS1078.severity = error # Use "" or 'string.Empty' -dotnet_diagnostic.RCS1084.severity = error # Use coalesce expression instead of conditional expression -dotnet_diagnostic.RCS1085.severity = none # Use auto-implemented property — covered by SST1420 +dotnet_diagnostic.RCS1049.severity = error # Simplify boolean comparison — covered by SST1143 +dotnet_diagnostic.RCS1058.severity = error # Use compound assignment — covered by SST1185 +dotnet_diagnostic.RCS1061.severity = error # Merge 'if' with nested 'if' — covered by SST2013 +dotnet_diagnostic.RCS1068.severity = error # Simplify logical negation — covered by SST1172/SST2006 +dotnet_diagnostic.RCS1069.severity = error # Remove unnecessary case label — covered by SST1466 +dotnet_diagnostic.RCS1070.severity = error # Remove redundant default switch section — covered by SST1179 +dotnet_diagnostic.RCS1071.severity = error # Remove redundant base constructor call — covered by SST1178 +dotnet_diagnostic.RCS1072.severity = error # Remove empty namespace declaration — covered by SST1435 +dotnet_diagnostic.RCS1073.severity = error # Convert 'if' to 'return' statement — covered by SST1197 +dotnet_diagnostic.RCS1074.severity = error # Remove redundant constructor — covered by SST1433 +dotnet_diagnostic.RCS1078.severity = error # Use "" or 'string.Empty' — conflicts with SST1122, which owns the string.Empty direction +dotnet_diagnostic.RCS1084.severity = error # Use coalesce expression instead of conditional expression — covered by SST1195 +dotnet_diagnostic.RCS1085.severity = error # Use auto-implemented property — covered by SST1420 dotnet_diagnostic.RCS1089.severity = error # Use --/++ operator instead of assignment dotnet_diagnostic.RCS1097.severity = error # Remove redundant 'ToString' call dotnet_diagnostic.RCS1103.severity = error # Convert 'if' to assignment -dotnet_diagnostic.RCS1104.severity = none # Simplify conditional expression — covered by SST1182 +dotnet_diagnostic.RCS1104.severity = error # Simplify conditional expression — covered by SST1182 dotnet_diagnostic.RCS1105.severity = error # Unnecessary interpolation -dotnet_diagnostic.RCS1106.severity = none # Remove empty destructor — covered by PSH1002 -dotnet_diagnostic.RCS1107.severity = error # Remove redundant 'ToCharArray' call +dotnet_diagnostic.RCS1106.severity = error # Remove empty destructor — covered by PSH1002 +dotnet_diagnostic.RCS1107.severity = error # Remove redundant 'ToCharArray' call — covered by PSH1217 dotnet_diagnostic.RCS1114.severity = error # Remove redundant delegate creation dotnet_diagnostic.RCS1124.severity = error # Inline local variable dotnet_diagnostic.RCS1126.severity = error # Add braces to if-else dotnet_diagnostic.RCS1128.severity = error # Use coalesce expression -dotnet_diagnostic.RCS1129.severity = none # Remove redundant field initialization — covered by SST1176 -dotnet_diagnostic.RCS1132.severity = none # Remove redundant overriding member — covered by SST1181 +dotnet_diagnostic.RCS1129.severity = error # Remove redundant field initialization — covered by SST1176 +dotnet_diagnostic.RCS1132.severity = error # Remove redundant overriding member — covered by SST1181 dotnet_diagnostic.RCS1133.severity = error # Remove redundant Dispose/Close call -dotnet_diagnostic.RCS1134.severity = error # Remove redundant statement +dotnet_diagnostic.RCS1134.severity = error # Remove redundant statement — covered by SST1174 dotnet_diagnostic.RCS1143.severity = error # Simplify coalesce expression dotnet_diagnostic.RCS1145.severity = error # Remove redundant 'as' operator dotnet_diagnostic.RCS1146.severity = error # Use conditional access -dotnet_diagnostic.RCS1151.severity = none # Remove redundant cast — covered by SST1175 +dotnet_diagnostic.RCS1151.severity = error # Remove redundant cast — covered by SST1175 dotnet_diagnostic.RCS1171.severity = error # Simplify lazy initialization dotnet_diagnostic.RCS1173.severity = error # Use coalesce expression instead of 'if' -dotnet_diagnostic.RCS1174.severity = error # Remove redundant async/await +dotnet_diagnostic.RCS1174.severity = error # Remove redundant async/await — covered by PSH1311 dotnet_diagnostic.RCS1179.severity = error # Unnecessary assignment dotnet_diagnostic.RCS1180.severity = error # Inline lazy initialization -dotnet_diagnostic.RCS1188.severity = none # Remove redundant auto-property initialization — covered by SST1176 -dotnet_diagnostic.RCS1192.severity = none # Unnecessary usage of verbatim string literal — covered by SST1184 +dotnet_diagnostic.RCS1188.severity = error # Remove redundant auto-property initialization — covered by SST1176 +dotnet_diagnostic.RCS1192.severity = error # Unnecessary usage of verbatim string literal — covered by SST1184 dotnet_diagnostic.RCS1199.severity = error # Unnecessary null check dotnet_diagnostic.RCS1206.severity = error # Use conditional access instead of conditional expression -dotnet_diagnostic.RCS1207.severity = error # Use anonymous function or method group -dotnet_diagnostic.RCS1211.severity = error # Remove unnecessary 'else' +dotnet_diagnostic.RCS1207.severity = error # Use anonymous function or method group — conflicts with SST2239, which owns the method-group direction +dotnet_diagnostic.RCS1211.severity = error # Remove unnecessary 'else' — covered by SST1464 dotnet_diagnostic.RCS1212.severity = error # Remove redundant assignment -dotnet_diagnostic.RCS1214.severity = none # Unnecessary interpolated string — covered by SST1183 +dotnet_diagnostic.RCS1214.severity = error # Unnecessary interpolated string — covered by SST1183 dotnet_diagnostic.RCS1216.severity = error # Unnecessary unsafe context -dotnet_diagnostic.RCS1217.severity = error # Convert interpolated string to concatenation +dotnet_diagnostic.RCS1217.severity = error # Convert interpolated string to concatenation — reverses SST2249, which owns the concatenation-to-interpolation direction dotnet_diagnostic.RCS1218.severity = error # Simplify code branching -dotnet_diagnostic.RCS1220.severity = error # Use pattern matching instead of combination of 'is' and cast +dotnet_diagnostic.RCS1220.severity = error # Use pattern matching instead of combination of 'is' and cast — covered by SST2007 dotnet_diagnostic.RCS1221.severity = error # Use pattern matching instead of combination of 'as' and null check -dotnet_diagnostic.RCS1238.severity = error # Avoid nested ?: operators -dotnet_diagnostic.RCS1244.severity = error # Simplify 'default' expression -dotnet_diagnostic.RCS1249.severity = none # Unnecessary null-forgiving operator — disabled because multi-TFM nullability annotations can differ per platform, leading to false positives +dotnet_diagnostic.RCS1238.severity = error # Avoid nested ?: operators — covered by SST1147 +dotnet_diagnostic.RCS1244.severity = error # Simplify 'default' expression — covered by SST1188 +dotnet_diagnostic.RCS1249.severity = error # Unnecessary null-forgiving operator — disabled because multi-TFM nullability annotations can differ per platform, leading to false positives dotnet_diagnostic.RCS1251.severity = error # Remove unnecessary braces from record declaration dotnet_diagnostic.RCS1259.severity = error # Remove empty syntax (replaces RCS1066) dotnet_diagnostic.RCS1262.severity = error # Unnecessary raw string literal -dotnet_diagnostic.RCS1265.severity = error # Remove redundant catch block +dotnet_diagnostic.RCS1265.severity = error # Remove redundant catch block — covered by SST1470 dotnet_diagnostic.RCS1268.severity = error # Simplify numeric comparison -################### -# Roslynator Analyzers (RCS1xxx) - Code Quality -################### -dotnet_diagnostic.RCS1013.severity = error # Use predefined type +# Code quality +dotnet_diagnostic.RCS1013.severity = error # Use predefined type — covered by SST1121 dotnet_diagnostic.RCS1014.severity = error # Use explicitly/implicitly typed array dotnet_diagnostic.RCS1015.severity = error # Use nameof operator -dotnet_diagnostic.RCS1016.severity = error # Use block body or expression body -dotnet_diagnostic.RCS1020.severity = error # Simplify Nullable to T? +dotnet_diagnostic.RCS1016.severity = error # Use block body or expression body — conflicts with SST2219, which owns the expression-bodied accessor direction +dotnet_diagnostic.RCS1020.severity = error # Covered by SST2234 (canonical) dotnet_diagnostic.RCS1021.severity = error # Convert lambda expression body to expression body -dotnet_diagnostic.RCS1044.severity = none # Remove original exception from throw statement — covered by SST1430 -dotnet_diagnostic.RCS1046.severity = none # Asynchronous method name should end with 'Async' — TUnit test method naming convention doesn't follow the Async suffix — covered by SST1317 +dotnet_diagnostic.RCS1044.severity = error # Remove original exception from throw statement — covered by SST1430 +dotnet_diagnostic.RCS1046.severity = error # Asynchronous method name should end with 'Async' — TUnit test method naming convention doesn't follow the Async suffix — covered by SST1317 dotnet_diagnostic.RCS1047.severity = error # Non-asynchronous method name should not end with 'Async' -dotnet_diagnostic.RCS1048.severity = error # Use lambda expression instead of anonymous method +dotnet_diagnostic.RCS1048.severity = error # Use lambda expression instead of anonymous method — covered by SST1130 dotnet_diagnostic.RCS1050.severity = error # Include/omit parentheses when creating new object -dotnet_diagnostic.RCS1051.severity = error # Add/remove parentheses from condition in conditional operator -dotnet_diagnostic.RCS1056.severity = none # Avoid usage of using alias directive - used to avoid conflicts -dotnet_diagnostic.RCS1059.severity = error # Avoid locking on publicly accessible instance -dotnet_diagnostic.RCS1075.severity = none # Avoid empty catch clause that catches System.Exception — covered by SST1429 +dotnet_diagnostic.RCS1051.severity = error # Add/remove parentheses from condition in conditional operator — conflicts with SST1459, which owns the non-grouping-parenthesis removal direction +dotnet_diagnostic.RCS1056.severity = error # Avoid usage of using alias directive - used to avoid conflicts +dotnet_diagnostic.RCS1059.severity = error # Avoid locking on publicly accessible instance — covered by SST1901 +dotnet_diagnostic.RCS1075.severity = error # Avoid empty catch clause that catches System.Exception — covered by SST1429 dotnet_diagnostic.RCS1079.severity = error # Throwing of new NotImplementedException dotnet_diagnostic.RCS1081.severity = error # Split variable declaration dotnet_diagnostic.RCS1093.severity = error # File contains no code -dotnet_diagnostic.RCS1094.severity = error # Declare using directive on top level -dotnet_diagnostic.RCS1096.severity = error # Use 'HasFlag' method or bitwise operator -dotnet_diagnostic.RCS1098.severity = none # Constant values should be placed on right side of comparisons — covered by SST1186 -dotnet_diagnostic.RCS1099.severity = error # Default label should be the last label in a switch section -dotnet_diagnostic.RCS1102.severity = none # Make class static — covered by SST1432 +dotnet_diagnostic.RCS1094.severity = error # Declare using directive on top level — covered by SST1200 +dotnet_diagnostic.RCS1096.severity = error # Use 'HasFlag' method or bitwise operator — covered by PSH1016 +dotnet_diagnostic.RCS1098.severity = error # Constant values should be placed on right side of comparisons — covered by SST1186 +dotnet_diagnostic.RCS1099.severity = error # Default label should be the last label in a switch section — covered by SST1466 +dotnet_diagnostic.RCS1102.severity = error # Make class static — covered by SST1432 dotnet_diagnostic.RCS1108.severity = error # Add 'static' modifier to all partial class declarations dotnet_diagnostic.RCS1111.severity = error # Add braces to switch section with multiple statements dotnet_diagnostic.RCS1113.severity = error # Use 'string.IsNullOrEmpty' method -dotnet_diagnostic.RCS1118.severity = error # Mark local variable as const -dotnet_diagnostic.RCS1123.severity = error # Add parentheses when necessary -dotnet_diagnostic.RCS1130.severity = error # Bitwise operation on enum without Flags attribute +dotnet_diagnostic.RCS1118.severity = error # Mark local variable as const — covered by PSH1402 +dotnet_diagnostic.RCS1123.severity = error # Add parentheses when necessary — covered by SST1407 +dotnet_diagnostic.RCS1130.severity = error # Bitwise operation on enum without Flags attribute — covered by SST2458 dotnet_diagnostic.RCS1135.severity = error # Declare enum member with zero value (when enum has FlagsAttribute) -dotnet_diagnostic.RCS1136.severity = error # Merge switch sections with equivalent content +dotnet_diagnostic.RCS1136.severity = error # Merge switch sections with equivalent content — covered by SST2414 dotnet_diagnostic.RCS1154.severity = error # Sort enum members -dotnet_diagnostic.RCS1155.severity = error # Use StringComparison when comparing strings -dotnet_diagnostic.RCS1156.severity = error # Use string.Length instead of comparison with empty string -dotnet_diagnostic.RCS1157.severity = none # Composite enum value contains undefined flag — covered by SST2303 +dotnet_diagnostic.RCS1155.severity = error # Use StringComparison when comparing strings — covered by PSH1207 +dotnet_diagnostic.RCS1156.severity = error # Use string.Length instead of comparison with empty string — covered by PSH1204 +dotnet_diagnostic.RCS1157.severity = error # Composite enum value contains undefined flag — covered by SST2303 dotnet_diagnostic.RCS1159.severity = error # Use EventHandler -dotnet_diagnostic.RCS1160.severity = none # Abstract type should not have public constructors — covered by SST1428 -dotnet_diagnostic.RCS1161.severity = none # Enum should declare explicit values - do not need explicit values -dotnet_diagnostic.RCS1162.severity = none # Avoid chain of assignments — covered by SST1187 -dotnet_diagnostic.RCS1166.severity = error # Value type object is never equal to null -dotnet_diagnostic.RCS1168.severity = none # Parameter name differs from base name — covered by SST1318 +dotnet_diagnostic.RCS1160.severity = error # Abstract type should not have public constructors — covered by SST1428 +dotnet_diagnostic.RCS1161.severity = error # Enum should declare explicit values - do not need explicit values +dotnet_diagnostic.RCS1162.severity = error # Avoid chain of assignments — covered by SST1187 +dotnet_diagnostic.RCS1166.severity = error # Value type object is never equal to null — covered by SST1469 +dotnet_diagnostic.RCS1168.severity = error # Parameter name differs from base name — covered by SST1318 dotnet_diagnostic.RCS1169.severity = error # Make field read-only -dotnet_diagnostic.RCS1170.severity = error # Use read-only auto-implemented property -dotnet_diagnostic.RCS1172.severity = none # Use 'is' operator instead of 'as' operator — covered by SST2005 -dotnet_diagnostic.RCS1187.severity = error # Use constant instead of field +dotnet_diagnostic.RCS1170.severity = error # Use read-only auto-implemented property — covered by SST2332 +dotnet_diagnostic.RCS1172.severity = error # Use 'is' operator instead of 'as' operator — covered by SST2005 +dotnet_diagnostic.RCS1187.severity = error # Use constant instead of field — covered by PSH1402 dotnet_diagnostic.RCS1191.severity = error # Declare enum value as combination of names -dotnet_diagnostic.RCS1193.severity = error # Overriding member should not change 'params' modifier +dotnet_diagnostic.RCS1193.severity = error # Overriding member should not change 'params' modifier — covered by SST2426 dotnet_diagnostic.RCS1196.severity = error # Call extension method as instance method -dotnet_diagnostic.RCS1200.severity = error # Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy' +dotnet_diagnostic.RCS1200.severity = error # Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy' — covered by PSH1108 dotnet_diagnostic.RCS1201.severity = error # Use method chaining dotnet_diagnostic.RCS1202.severity = error # Avoid NullReferenceException dotnet_diagnostic.RCS1204.severity = error # Use EventArgs.Empty dotnet_diagnostic.RCS1205.severity = error # Order named arguments according to the order of parameters dotnet_diagnostic.RCS1208.severity = error # Reduce 'if' nesting dotnet_diagnostic.RCS1209.severity = error # Order type parameter constraints -dotnet_diagnostic.RCS1210.severity = error # Return completed task instead of returning null +dotnet_diagnostic.RCS1210.severity = error # Return completed task instead of returning null — covered by PSH1312 dotnet_diagnostic.RCS1215.severity = error # Expression is always equal to true/false dotnet_diagnostic.RCS1222.severity = error # Merge preprocessor directives -dotnet_diagnostic.RCS1223.severity = suggestion # Mark publicly visible type with DebuggerDisplay attribute — only data types benefit; the rule is too broad to be an error +dotnet_diagnostic.RCS1223.severity = error # Mark publicly visible type with DebuggerDisplay attribute — only data types benefit; the rule is too broad to be an error dotnet_diagnostic.RCS1224.severity = error # Make method an extension method dotnet_diagnostic.RCS1225.severity = error # Make class sealed -dotnet_diagnostic.RCS1227.severity = none # Validate arguments correctly — covered by SST2404 +dotnet_diagnostic.RCS1227.severity = error # Validate arguments correctly — covered by SST2404 dotnet_diagnostic.RCS1229.severity = error # Use async/await when necessary -dotnet_diagnostic.RCS1231.severity = suggestion # Make parameter ref read-only -dotnet_diagnostic.RCS1233.severity = error # Use short-circuiting operator +dotnet_diagnostic.RCS1231.severity = error # Make parameter ref read-only — covered by PSH1007 +dotnet_diagnostic.RCS1233.severity = error # Use short-circuiting operator — covered by SST1468 dotnet_diagnostic.RCS1234.severity = error # Duplicate enum value dotnet_diagnostic.RCS1239.severity = error # Use 'for' statement instead of 'while' statement dotnet_diagnostic.RCS1240.severity = error # Operator is unnecessary -dotnet_diagnostic.RCS1242.severity = error # Do not pass non-read-only struct by read-only reference -dotnet_diagnostic.RCS1243.severity = error # Duplicate word in a comment +dotnet_diagnostic.RCS1242.severity = error # Do not pass non-read-only struct by read-only reference — covered by PSH1003 +dotnet_diagnostic.RCS1243.severity = error # Duplicate word in a comment — covered by SST1658 (documentation comments) dotnet_diagnostic.RCS1247.severity = error # Fix documentation comment tag -dotnet_diagnostic.RCS1248.severity = error # Normalize null check -dotnet_diagnostic.RCS1250.severity = error # Use implicit/explicit object creation +dotnet_diagnostic.RCS1248.severity = error # Normalize null check — conflicts with SST1149, which owns the 'is null' pattern direction +dotnet_diagnostic.RCS1250.severity = error # Use implicit/explicit object creation — conflicts with SST2202, which owns the implicit-target-type direction dotnet_diagnostic.RCS1252.severity = error # Normalize usage of infinite loop dotnet_diagnostic.RCS1254.severity = error # Normalize format of enum flag value -dotnet_diagnostic.RCS1255.severity = none # Simplify argument null check — conflicts with our ArgumentExceptionHelper helper pattern +dotnet_diagnostic.RCS1255.severity = error # Simplify argument null check — conflicts with our ArgumentExceptionHelper helper pattern dotnet_diagnostic.RCS1257.severity = error # Use enum field explicitly dotnet_diagnostic.RCS1258.severity = error # Unnecessary enum flag -dotnet_diagnostic.RCS1260.severity = error # Add/remove trailing comma -dotnet_diagnostic.RCS1261.severity = error # Resource can be disposed asynchronously +dotnet_diagnostic.RCS1260.severity = error # Add/remove trailing comma — conflicts with SST1413, which owns the trailing-comma direction +dotnet_diagnostic.RCS1261.severity = error # Resource can be disposed asynchronously — covered by PSH1310 dotnet_diagnostic.RCS1264.severity = error # Use 'var' or explicit type (replaces RCS1010, RCS1176, RCS1177) -dotnet_diagnostic.RCS1266.severity = error # Use raw string literal +dotnet_diagnostic.RCS1266.severity = error # Use raw string literal — covered by SST2243 dotnet_diagnostic.RCS1267.severity = error # Use string interpolation instead of 'string.Concat' -################### -# Roslynator Analyzers (RCS1xxx) - Performance -################### -dotnet_diagnostic.RCS1077.severity = error # Optimize LINQ method call -dotnet_diagnostic.RCS1080.severity = error # Use 'Count/Length' property instead of 'Any' method -dotnet_diagnostic.RCS1112.severity = error # Combine 'Enumerable.Where' method chain +# Performance +dotnet_diagnostic.RCS1077.severity = error # Covered by the PSH1101-PSH1111 family (canonical) +dotnet_diagnostic.RCS1080.severity = error # Covered by PSH1106 (canonical) +dotnet_diagnostic.RCS1112.severity = error # Combine 'Enumerable.Where' method chain — covered by PSH1109 dotnet_diagnostic.RCS1186.severity = error # Use Regex instance instead of static method -dotnet_diagnostic.RCS1190.severity = error # Join string expressions +dotnet_diagnostic.RCS1190.severity = error # Join string expressions — conflicts with SST2470, which reports the fused-literal seam this would create dotnet_diagnostic.RCS1195.severity = error # Use ^ operator -dotnet_diagnostic.RCS1197.severity = error # Optimize StringBuilder.Append/AppendLine call -dotnet_diagnostic.RCS1198.severity = none # Avoid unnecessary boxing of value type — boxing is unavoidable bridging Rx and IEnumerable -dotnet_diagnostic.RCS1230.severity = error # Unnecessary explicit use of enumerator +dotnet_diagnostic.RCS1197.severity = error # Optimize StringBuilder.Append/AppendLine call — covered by PSH1203/PSH1214 +dotnet_diagnostic.RCS1198.severity = error # Avoid unnecessary boxing of value type — boxing is unavoidable bridging Rx and IEnumerable +dotnet_diagnostic.RCS1230.severity = error # Unnecessary explicit use of enumerator — covered by SST1467 dotnet_diagnostic.RCS1235.severity = error # Optimize method call -dotnet_diagnostic.RCS1236.severity = error # Use exception filter -dotnet_diagnostic.RCS1246.severity = error # Use element access +dotnet_diagnostic.RCS1236.severity = error # Use exception filter — covered by SST2009 +dotnet_diagnostic.RCS1246.severity = error # Use element access — covered by PSH1106 -################### -# Roslynator Analyzers (RCS1xxx) - Maintainability -################### -dotnet_diagnostic.RCS1158.severity = none # Static member in generic type should use a type parameter — common factory pattern — covered by SST1431 -dotnet_diagnostic.RCS1163.severity = none # Unused parameter — interface implementations and Rx selectors often have unused parameters -dotnet_diagnostic.RCS1164.severity = none # Unused type parameter - DUPLICATE IDE0060 (UnusedParameter analyzer 210ms; IDE0060 bundled at lower cost) -dotnet_diagnostic.RCS1165.severity = none # Unconstrained type parameter checked for null - we validate all parameters for non-nullable enabled platforms -dotnet_diagnostic.RCS1182.severity = none # Remove redundant base interface — covered by SST1177 -dotnet_diagnostic.RCS1213.severity = none # Remove unused member declaration - DUPLICATE IDE0051 (slower: 230ms vs 75ms) +# Maintainability +dotnet_diagnostic.RCS1158.severity = error # Static member in generic type should use a type parameter — common factory pattern — covered by SST1431 +dotnet_diagnostic.RCS1163.severity = error # Unused parameter — interface implementations and Rx selectors often have unused parameters +dotnet_diagnostic.RCS1164.severity = error # Unused type parameter - DUPLICATE IDE0060 (UnusedParameter analyzer 210ms; IDE0060 bundled at lower cost) +dotnet_diagnostic.RCS1165.severity = error # Unconstrained type parameter checked for null - we validate all parameters for non-nullable enabled platforms +dotnet_diagnostic.RCS1182.severity = error # Remove redundant base interface — covered by SST1177 +dotnet_diagnostic.RCS1213.severity = error # Remove unused member declaration - DUPLICATE IDE0051 (slower: 230ms vs 75ms) dotnet_diagnostic.RCS1241.severity = error # Implement non-generic counterpart -dotnet_diagnostic.RCS1256.severity = none # Invalid argument null check — conflicts with our ArgumentExceptionHelper helper pattern +dotnet_diagnostic.RCS1256.severity = error # Invalid argument null check — conflicts with our ArgumentExceptionHelper helper pattern -################### -# Roslynator Analyzers (RCS1xxx) - Documentation -################### +# Documentation dotnet_diagnostic.RCS1181.severity = error # Convert comment to documentation comment dotnet_diagnostic.RCS1189.severity = error # Add or remove region name -dotnet_diagnostic.RCS1226.severity = none # Add paragraph to documentation comment — <para> wrapping is subjective and adds noise +dotnet_diagnostic.RCS1226.severity = error # Add paragraph to documentation comment — <para> wrapping is subjective and adds noise dotnet_diagnostic.RCS1228.severity = error # Unused element in a documentation comment dotnet_diagnostic.RCS1232.severity = error # Order elements in documentation comment dotnet_diagnostic.RCS1253.severity = error # Format documentation comment summary -dotnet_diagnostic.RCS1263.severity = none # Invalid reference in a documentation comment - -################### -# Roslynator Analyzers (RCS1xxx) - Disabled (covered by CA/SA equivalent) -################### -dotnet_diagnostic.RCS1018.severity = none # Add/remove accessibility modifiers — covered by SA1400 -dotnet_diagnostic.RCS1019.severity = none # Order modifiers — covered by SA1206 / SA1208 -dotnet_diagnostic.RCS1037.severity = none # Remove trailing white-space — covered by SA1028 -dotnet_diagnostic.RCS1052.severity = none # Declare each attribute separately — covered by SA1133 -dotnet_diagnostic.RCS1055.severity = none # Unnecessary semicolon at the end of declaration — covered by SA1106 -dotnet_diagnostic.RCS1060.severity = none # Declare each type in separate file — covered by SA1402 -dotnet_diagnostic.RCS1090.severity = none # Add/remove 'ConfigureAwait(false)' call — covered by CA2007 (also disabled) -dotnet_diagnostic.RCS1110.severity = none # Declare type inside namespace — covered by CA1050 -dotnet_diagnostic.RCS1138.severity = none # Add summary to documentation comment — covered by SA1600 -dotnet_diagnostic.RCS1139.severity = none # Add summary element to documentation comment — covered by SA1604 -dotnet_diagnostic.RCS1140.severity = none # Add exception to documentation comment — covered by SA1614 -dotnet_diagnostic.RCS1141.severity = none # Add 'param' element to documentation comment — covered by SA1611 -dotnet_diagnostic.RCS1142.severity = none # Add 'typeparam' element to documentation comment — covered by SA1618 -dotnet_diagnostic.RCS1175.severity = none # Unused 'this' parameter — covered by CA1822 -dotnet_diagnostic.RCS1194.severity = none # Implement exception constructors — covered by CA1032 -dotnet_diagnostic.RCS1203.severity = none # Use AttributeUsageAttribute — covered by CA1018 - -################### -# Roslynator Formatting Analyzers (RCS0xxx) - covered by StyleCop SA equivalents -################### -dotnet_diagnostic.RCS0001.severity = none # Add blank line after embedded statement — covered by StyleCop layout rules -dotnet_diagnostic.RCS0002.severity = none # Add blank line after #region — covered by StyleCop SA1517 family -dotnet_diagnostic.RCS0003.severity = none # Add blank line after using directive list — covered by SA1516 -dotnet_diagnostic.RCS0005.severity = none # Add blank line before #endregion — covered by StyleCop layout rules -dotnet_diagnostic.RCS0006.severity = none # Add blank line before using directive list — covered by SA1517 -dotnet_diagnostic.RCS0007.severity = none # Add blank line between accessors — covered by SA1513 -dotnet_diagnostic.RCS0008.severity = none # Add blank line between closing brace and next statement — covered by SA1513 -dotnet_diagnostic.RCS0009.severity = none # Add blank line between declaration and documentation comment — covered by SA1514 -dotnet_diagnostic.RCS0010.severity = none # Add blank line between declarations — covered by SA1516 -dotnet_diagnostic.RCS0011.severity = none # Add/remove blank line between single-line accessors — StyleCop already governs this -dotnet_diagnostic.RCS0012.severity = none # Add blank line between single-line declarations — covered by SA1516 -dotnet_diagnostic.RCS0013.severity = none # Add blank line between single-line declarations of different kind — covered by SA1516 -dotnet_diagnostic.RCS0015.severity = none # Add/remove blank line between using directives — covered by SA1209 / SA1210 -dotnet_diagnostic.RCS0016.severity = none # Put attribute list on its own line — StyleCop SA1133 governs attribute lists -dotnet_diagnostic.RCS0020.severity = none # Format accessor's braces — covered by SA1500 -dotnet_diagnostic.RCS0021.severity = none # Format block's braces — covered by SA1500 -dotnet_diagnostic.RCS0023.severity = none # Format type declaration's braces — covered by SA1500 -dotnet_diagnostic.RCS0024.severity = none # Add new line after switch label — covered by SA1003 -dotnet_diagnostic.RCS0025.severity = none # Put full accessor on its own line — covered by SA1502 -dotnet_diagnostic.RCS0027.severity = none # Place new line after/before binary operator — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0028.severity = none # Place new line after/before '?:' operator — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0029.severity = none # Put constructor initializer on its own line — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0030.severity = none # Put embedded statement on its own line — covered by SA1503 -dotnet_diagnostic.RCS0031.severity = none # Put enum member on its own line — covered by SA1136 -dotnet_diagnostic.RCS0032.severity = none # Place new line after/before arrow token — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0033.severity = none # Put statement on its own line — covered by SA1505 family -dotnet_diagnostic.RCS0034.severity = none # Put type parameter constraint on its own line — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0036.severity = none # Remove blank line between single-line declarations of same kind — covered by SA1516 -dotnet_diagnostic.RCS0039.severity = none # Remove new line before base list — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0041.severity = none # Remove new line between 'if' keyword and 'else' keyword — StyleCop layout rules cover this -dotnet_diagnostic.RCS0042.severity = none # Put auto-accessors on a single line — formatting preference, not enforced -dotnet_diagnostic.RCS0044.severity = none # Use carriage return + linefeed as new line — handled by .gitattributes / editorconfig end_of_line -dotnet_diagnostic.RCS0045.severity = none # Use linefeed as new line — handled by .gitattributes / editorconfig end_of_line -dotnet_diagnostic.RCS0046.severity = none # Use spaces instead of tab — handled by editorconfig indent_style -dotnet_diagnostic.RCS0048.severity = none # Put initializer on a single line — formatting preference, not enforced -dotnet_diagnostic.RCS0049.severity = none # Add blank line after top comment — covered by SA1517 -dotnet_diagnostic.RCS0050.severity = none # Add blank line before top declaration — covered by SA1517 -dotnet_diagnostic.RCS0051.severity = none # Add/remove new line before 'while' in 'do' statement — formatting preference -dotnet_diagnostic.RCS0052.severity = none # Place new line after/before equals token — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0053.severity = none # Fix formatting of a list — formatting preference -dotnet_diagnostic.RCS0054.severity = none # Fix formatting of a call chain — formatting preference -dotnet_diagnostic.RCS0055.severity = none # Fix formatting of a binary expression chain — formatting preference -dotnet_diagnostic.RCS0056.severity = none # A line is too long — line-length not enforced -dotnet_diagnostic.RCS0057.severity = none # Normalize whitespace at the beginning of a file — handled by editorconfig -dotnet_diagnostic.RCS0058.severity = none # Normalize whitespace at the end of a file — covered by SST1518 -dotnet_diagnostic.RCS0059.severity = none # Place new line after/before null-conditional operator — StyleSharp wrapping rules cover this -dotnet_diagnostic.RCS0060.severity = none # Add/remove line after file scoped namespace declaration — formatting preference -dotnet_diagnostic.RCS0061.severity = none # Add/remove blank line between switch sections — formatting preference -dotnet_diagnostic.RCS0062.severity = none # Put expression body on its own line — formatting preference -dotnet_diagnostic.RCS0063.severity = none # Remove unnecessary blank line — covered by SST1505 / SST1507 +dotnet_diagnostic.RCS1263.severity = error # Invalid reference in a documentation comment + +# Disabled +dotnet_diagnostic.RCS1018.severity = error # Add/remove accessibility modifiers — covered by SA1400 +dotnet_diagnostic.RCS1019.severity = error # Order modifiers — covered by SA1206 / SA1208 +dotnet_diagnostic.RCS1037.severity = error # Remove trailing white-space — covered by SA1028 +dotnet_diagnostic.RCS1052.severity = error # Declare each attribute separately — covered by SA1133 +dotnet_diagnostic.RCS1055.severity = error # Unnecessary semicolon at the end of declaration — covered by SA1106 +dotnet_diagnostic.RCS1060.severity = error # Declare each type in separate file — covered by SA1402 +dotnet_diagnostic.RCS1090.severity = error # Add/remove 'ConfigureAwait(false)' call — covered by CA2007 (also disabled) +dotnet_diagnostic.RCS1110.severity = error # Declare type inside namespace — covered by CA1050 +dotnet_diagnostic.RCS1138.severity = error # Add summary to documentation comment — covered by SA1600 +dotnet_diagnostic.RCS1139.severity = error # Add summary element to documentation comment — covered by SA1604 +dotnet_diagnostic.RCS1140.severity = error # Add exception to documentation comment — covered by SA1614 +dotnet_diagnostic.RCS1141.severity = error # Add 'param' element to documentation comment — covered by SA1611 +dotnet_diagnostic.RCS1142.severity = error # Add 'typeparam' element to documentation comment — covered by SA1618 +dotnet_diagnostic.RCS1175.severity = error # Unused 'this' parameter — covered by CA1822 +dotnet_diagnostic.RCS1194.severity = error # Implement exception constructors — covered by CA1032 +dotnet_diagnostic.RCS1203.severity = error # Use AttributeUsageAttribute — covered by CA1018 + +# Formatting +dotnet_diagnostic.RCS0001.severity = error # Add blank line after embedded statement — covered by StyleCop layout rules +dotnet_diagnostic.RCS0002.severity = error # Add blank line after #region — covered by StyleCop SA1517 family +dotnet_diagnostic.RCS0003.severity = error # Add blank line after using directive list — covered by SA1516 +dotnet_diagnostic.RCS0005.severity = error # Add blank line before #endregion — covered by StyleCop layout rules +dotnet_diagnostic.RCS0006.severity = error # Add blank line before using directive list — covered by SA1517 +dotnet_diagnostic.RCS0007.severity = error # Add blank line between accessors — covered by SA1513 +dotnet_diagnostic.RCS0008.severity = error # Add blank line between closing brace and next statement — covered by SA1513 +dotnet_diagnostic.RCS0009.severity = error # Add blank line between declaration and documentation comment — covered by SA1514 +dotnet_diagnostic.RCS0010.severity = error # Add blank line between declarations — covered by SA1516 +dotnet_diagnostic.RCS0011.severity = error # Add/remove blank line between single-line accessors — StyleCop already governs this +dotnet_diagnostic.RCS0012.severity = error # Add blank line between single-line declarations — covered by SA1516 +dotnet_diagnostic.RCS0013.severity = error # Add blank line between single-line declarations of different kind — covered by SA1516 +dotnet_diagnostic.RCS0015.severity = error # Add/remove blank line between using directives — covered by SA1209 / SA1210 +dotnet_diagnostic.RCS0016.severity = error # Put attribute list on its own line — StyleCop SA1133 governs attribute lists +dotnet_diagnostic.RCS0020.severity = error # Format accessor's braces — covered by SA1500 +dotnet_diagnostic.RCS0021.severity = error # Format block's braces — covered by SA1500 +dotnet_diagnostic.RCS0023.severity = error # Format type declaration's braces — covered by SA1500 +dotnet_diagnostic.RCS0024.severity = error # Add new line after switch label — covered by SA1003 +dotnet_diagnostic.RCS0025.severity = error # Put full accessor on its own line — covered by SA1502 +dotnet_diagnostic.RCS0027.severity = error # Place new line after/before binary operator — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0028.severity = error # Place new line after/before '?:' operator — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0029.severity = error # Put constructor initializer on its own line — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0030.severity = error # Put embedded statement on its own line — covered by SA1503 +dotnet_diagnostic.RCS0031.severity = error # Put enum member on its own line — covered by SA1136 +dotnet_diagnostic.RCS0032.severity = error # Place new line after/before arrow token — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0033.severity = error # Put statement on its own line — covered by SA1505 family +dotnet_diagnostic.RCS0034.severity = error # Put type parameter constraint on its own line — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0036.severity = error # Remove blank line between single-line declarations of same kind — covered by SA1516 +dotnet_diagnostic.RCS0039.severity = error # Remove new line before base list — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0041.severity = error # Remove new line between 'if' keyword and 'else' keyword — StyleCop layout rules cover this +dotnet_diagnostic.RCS0042.severity = error # Put auto-accessors on a single line — formatting preference, not enforced +dotnet_diagnostic.RCS0044.severity = error # Use carriage return + linefeed as new line — handled by .gitattributes / editorconfig end_of_line +dotnet_diagnostic.RCS0045.severity = error # Use linefeed as new line — handled by .gitattributes / editorconfig end_of_line +dotnet_diagnostic.RCS0046.severity = error # Use spaces instead of tab — handled by editorconfig indent_style +dotnet_diagnostic.RCS0048.severity = error # Put initializer on a single line — formatting preference, not enforced +dotnet_diagnostic.RCS0049.severity = error # Add blank line after top comment — covered by SA1517 +dotnet_diagnostic.RCS0050.severity = error # Add blank line before top declaration — covered by SA1517 +dotnet_diagnostic.RCS0051.severity = error # Add/remove new line before 'while' in 'do' statement — formatting preference +dotnet_diagnostic.RCS0052.severity = error # Place new line after/before equals token — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0053.severity = error # Fix formatting of a list — formatting preference +dotnet_diagnostic.RCS0054.severity = error # Fix formatting of a call chain — formatting preference +dotnet_diagnostic.RCS0055.severity = error # Fix formatting of a binary expression chain — formatting preference +dotnet_diagnostic.RCS0056.severity = error # A line is too long — line-length not enforced +dotnet_diagnostic.RCS0057.severity = error # Normalize whitespace at the beginning of a file — handled by editorconfig +dotnet_diagnostic.RCS0058.severity = error # Normalize whitespace at the end of a file — covered by SST1518 +dotnet_diagnostic.RCS0059.severity = error # Place new line after/before null-conditional operator — StyleSharp wrapping rules cover this +dotnet_diagnostic.RCS0060.severity = error # Add/remove line after file scoped namespace declaration — formatting preference +dotnet_diagnostic.RCS0061.severity = error # Add/remove blank line between switch sections — formatting preference +dotnet_diagnostic.RCS0062.severity = error # Put expression body on its own line — formatting preference +dotnet_diagnostic.RCS0063.severity = error # Remove unnecessary blank line — covered by SST1505 / SST1507 ################### # StyleSharp Analyzers (SST) @@ -1092,11 +1125,6 @@ stylesharp.max_file_lines = 1000 # SST1522 (code lines # stylesharp.include_internal = true # SST1499 (set false to report only fields visible outside the assembly) # stylesharp.require_parameterless = true # SST1488 (set false where every exception must carry a message) # stylesharp.include_non_public_types = true # SST1488 (set false to check only externally visible exceptions) -performancesharp.avoid_linq_on_hot_path = true # PSH1100 (product code bans LINQ outright; tests relax this) -# performancesharp.empty_string_style = pattern # PSH1204 (pattern | length | is_null_or_empty; the last two are only offered where the string is provably not null) -# performancesharp.include_public = false # PSH1411 (set true in an app to seal public types too; a break in a library) -# performancesharp.excluded_properties = Items, Keys # PSH1017 (comma-separated; properties allowed to copy on read) - # Spacing dotnet_diagnostic.SST1000.severity = error # A control-flow keyword is not followed by a space dotnet_diagnostic.SST1001.severity = error # A comma is spaced incorrectly @@ -1108,7 +1136,7 @@ dotnet_diagnostic.SST1006.severity = error # A preprocessor keyword is preceded dotnet_diagnostic.SST1007.severity = error # An operator keyword is not followed by a space dotnet_diagnostic.SST1008.severity = error # An opening parenthesis is followed by a space dotnet_diagnostic.SST1009.severity = error # A closing parenthesis is preceded by a space -dotnet_diagnostic.SST1010.severity = none # An opening square bracket has adjacent whitespace — conflicts with modern collection expressions +dotnet_diagnostic.SST1010.severity = error # An opening square bracket has adjacent whitespace — conflicts with modern collection expressions dotnet_diagnostic.SST1011.severity = error # A closing square bracket is preceded by a space dotnet_diagnostic.SST1012.severity = error # An opening brace is not followed by a space on a single line dotnet_diagnostic.SST1013.severity = error # A closing brace is not preceded by a space on a single line @@ -1130,6 +1158,7 @@ dotnet_diagnostic.SST1028.severity = error # A line ends with trailing whitespac # Readability and maintainability dotnet_diagnostic.SST1100.severity = error # A base. prefix is used where the type does not override the member +dotnet_diagnostic.SST1101.severity = error # see docs/rules/SST1101.md dotnet_diagnostic.SST1102.severity = error # A query clause is separated from the previous clause by a blank line dotnet_diagnostic.SST1103.severity = error # Query clauses mix single-line and multi-line layout dotnet_diagnostic.SST1104.severity = error # A query clause shares the last line of a multi-line previous clause @@ -1144,9 +1173,10 @@ dotnet_diagnostic.SST1114.severity = error # A blank line separates the declarat dotnet_diagnostic.SST1115.severity = error # A blank line separates a parameter from the preceding comma dotnet_diagnostic.SST1116.severity = error # A qualified name can be shortened without changing the symbol it binds to dotnet_diagnostic.SST1117.severity = error # Instance member access follows the configured this. qualification style -dotnet_diagnostic.SST1118.severity = none # A parameter should not span multiple lines +dotnet_diagnostic.SST1118.severity = error # A parameter should not span multiple lines +dotnet_diagnostic.SST1119.severity = error # A numeric literal groups its digit separators irregularly dotnet_diagnostic.SST1120.severity = error # A comment contains no text -dotnet_diagnostic.SST1121.severity = none # A framework type name is used instead of its built-in alias — duplicate of RCS1013 +dotnet_diagnostic.SST1121.severity = error # A framework type name is used instead of its built-in alias (opt-in rule, enabled here) dotnet_diagnostic.SST1122.severity = error # An empty string literal is used instead of string.Empty dotnet_diagnostic.SST1123.severity = error # A #region is placed inside a code element body dotnet_diagnostic.SST1124.severity = error # A #region directive is used @@ -1162,6 +1192,7 @@ dotnet_diagnostic.SST1134.severity = error # An attribute shares a line with ano dotnet_diagnostic.SST1135.severity = error # A using directive names a namespace or type that is not fully qualified dotnet_diagnostic.SST1136.severity = error # Several enum members share a line dotnet_diagnostic.SST1137.severity = error # Sibling elements are indented differently from one another +dotnet_diagnostic.SST1138.severity = error # A free-standing block declares nothing dotnet_diagnostic.SST1139.severity = error # A numeric literal is cast where a literal suffix would express the type dotnet_diagnostic.SST1140.severity = error # Wrapped conditional operators should start indented continuation lines dotnet_diagnostic.SST1141.severity = error # An explicit ValueTuple<...> is used where tuple syntax would do @@ -1215,7 +1246,7 @@ dotnet_diagnostic.SST1188.severity = error # Use the 'default' literal instead o dotnet_diagnostic.SST1189.severity = error # Variables should not be self-assigned dotnet_diagnostic.SST1190.severity = error # Doubled negation operators should be removed dotnet_diagnostic.SST1191.severity = error # Long numeric literals should use digit separators -dotnet_diagnostic.SST1192.severity = none # Control characters in string literals should be escaped +dotnet_diagnostic.SST1192.severity = error # Control characters in string literals should be escaped dotnet_diagnostic.SST1193.severity = error # Keep initial member values with construction dotnet_diagnostic.SST1194.severity = error # Keep initial collection values with construction dotnet_diagnostic.SST1195.severity = error # Write null fallback with ?? @@ -1225,7 +1256,7 @@ dotnet_diagnostic.SST1198.severity = error # Collapse assignment-only branches i dotnet_diagnostic.SST1199.severity = error # Prefer compile-time type names # Ordering -dotnet_diagnostic.SST1200.severity = none # Using directives should be placed outside the namespace — usings live outside file-scoped namespaces +dotnet_diagnostic.SST1200.severity = error # Using directives should be placed outside the namespace dotnet_diagnostic.SST1201.severity = error # Members should be ordered by kind dotnet_diagnostic.SST1202.severity = error # Members should be ordered by accessibility dotnet_diagnostic.SST1203.severity = error # Constants should appear before fields @@ -1244,27 +1275,32 @@ dotnet_diagnostic.SST1215.severity = error # Instance readonly fields should app dotnet_diagnostic.SST1216.severity = error # Using static directives should be placed after regular usings and before aliases dotnet_diagnostic.SST1217.severity = error # Using static directives should be ordered alphabetically dotnet_diagnostic.SST1218.severity = error # Other members separate a method's overloads +dotnet_diagnostic.SST1219.severity = error # A switch default clause is not placed last +dotnet_diagnostic.SST1220.severity = error # An all-named argument list is in a different order than the parameters. Code fix reorders it to declaration order. Info. +dotnet_diagnostic.SST1221.severity = error # `where` constraint clauses are not ordered to match the type-parameter list. Code fix reorders them. Info. # Naming -dotnet_diagnostic.SST1300.severity = none # Types and members should be PascalCase — naming duplicates existing analyzers +dotnet_diagnostic.SST1300.severity = error # Types and members should be PascalCase — naming duplicates existing analyzers dotnet_diagnostic.SST1302.severity = error # Interface names should begin with I dotnet_diagnostic.SST1303.severity = error # Const names should be PascalCase dotnet_diagnostic.SST1304.severity = error # Non-private readonly fields should be PascalCase dotnet_diagnostic.SST1305.severity = error # Field names should not use Hungarian notation -dotnet_diagnostic.SST1306.severity = none # Field names should begin with a lower-case letter — private fields use _camelCase here +dotnet_diagnostic.SST1306.severity = error # Field names should begin with a lower-case letter — private fields use _camelCase here dotnet_diagnostic.SST1307.severity = error # Accessible fields should be PascalCase -dotnet_diagnostic.SST1308.severity = none # Field names should not be prefixed with m_ or s_ — too broad for existing conventions +dotnet_diagnostic.SST1308.severity = error # Field names should not be prefixed with m_ or s_ — too broad for existing conventions dotnet_diagnostic.SST1309.severity = error # Private fields should be _camelCase -dotnet_diagnostic.SST1310.severity = none # Field names should not contain underscores — conflicts with _camelCase -dotnet_diagnostic.SST1311.severity = none # Static readonly fields should be PascalCase — we use _camelCase for private static readonly too +dotnet_diagnostic.SST1310.severity = error # Field names should not contain underscores — conflicts with _camelCase +dotnet_diagnostic.SST1311.severity = error # Static readonly fields should be PascalCase — we use _camelCase for private static readonly too dotnet_diagnostic.SST1312.severity = error # Local variables should be camelCase dotnet_diagnostic.SST1313.severity = error # Parameters should be camelCase dotnet_diagnostic.SST1314.severity = error # Type parameters should begin with T dotnet_diagnostic.SST1315.severity = error # Union member names should match the configured casing -dotnet_diagnostic.SST1316.severity = none # Tuple element names should use the configured casing — tuple naming is not enforced here -dotnet_diagnostic.SST1317.severity = none # Asynchronous method names should end with 'Async' — conflicts with this project's Rx-compatibility and naming mechanism +dotnet_diagnostic.SST1316.severity = error # Tuple element names should use the configured casing — tuple naming is not enforced here +dotnet_diagnostic.SST1317.severity = error # Asynchronous method names should end with 'Async' — conflicts with this project's Rx-compatibility and naming mechanism dotnet_diagnostic.SST1318.severity = error # Overriding parameter names should match the base declaration dotnet_diagnostic.SST1319.severity = error # An enumeration's type name is not PascalCase +dotnet_diagnostic.SST1320.severity = error # A parameter name matches its method's name +dotnet_diagnostic.SST1321.severity = error # Public APIs intentionally use Async to describe asynchronous observable behavior without returning an awaitable. # Maintainability dotnet_diagnostic.SST1400.severity = error # An element does not declare an access modifier @@ -1278,12 +1314,12 @@ dotnet_diagnostic.SST1407.severity = error # Mixed-precedence arithmetic is not dotnet_diagnostic.SST1408.severity = error # Mixed conditional operators are not parenthesized dotnet_diagnostic.SST1410.severity = error # An anonymous method has an empty parameter list dotnet_diagnostic.SST1411.severity = error # An attribute uses an empty argument list -dotnet_diagnostic.SST1412.severity = none # Store files as UTF-8 with a byte order mark — conflicts with SST1450 (UTF-8 without BOM) -dotnet_diagnostic.SST1413.severity = none # A multi-line initializer omits the trailing comma — trailing commas are not required here +dotnet_diagnostic.SST1412.severity = error # Store files as UTF-8 with a byte order mark — conflicts with SST1450 (UTF-8 without BOM) +dotnet_diagnostic.SST1413.severity = error # A multi-line initializer omits the trailing comma — trailing commas are not required here dotnet_diagnostic.SST1414.severity = error # A tuple type in a member signature has an unnamed element dotnet_diagnostic.SST1415.severity = error # An argument-exception constructor uses a string literal where nameof would track renames -dotnet_diagnostic.SST1416.severity = none # Do not declare public members in a non-public type -dotnet_diagnostic.SST1417.severity = suggestion # Namespace should match the folder structure +dotnet_diagnostic.SST1416.severity = error # Do not declare public members in a non-public type +dotnet_diagnostic.SST1417.severity = error # Namespace should match the folder structure dotnet_diagnostic.SST1418.severity = error # Declare precedence when mixing the null-coalescing operator dotnet_diagnostic.SST1419.severity = error # Remove redundant modifiers dotnet_diagnostic.SST1420.severity = error # Trivial properties should be auto-implemented @@ -1300,6 +1336,7 @@ dotnet_diagnostic.SST1430.severity = error # Rethrow with 'throw;' to preserve t dotnet_diagnostic.SST1431.severity = error # Static members of a generic type should use a type parameter dotnet_diagnostic.SST1432.severity = error # Classes with only static members should be static dotnet_diagnostic.SST1433.severity = error # Redundant constructors should be removed +dotnet_diagnostic.SST1434.severity = error # see docs/rules/SST1434.md dotnet_diagnostic.SST1435.severity = error # Empty namespace declarations should be removed dotnet_diagnostic.SST1436.severity = error # Empty types should not be declared dotnet_diagnostic.SST1437.severity = error # Empty interfaces should not be declared @@ -1312,7 +1349,7 @@ dotnet_diagnostic.SST1443.severity = error # A function has too much nested cont dotnet_diagnostic.SST1444.severity = error # A loop cannot naturally reach a second iteration dotnet_diagnostic.SST1445.severity = error # A using directive is unnecessary dotnet_diagnostic.SST1446.severity = error # An inheritance chain is deeper than the configured maximum -dotnet_diagnostic.SST1447.severity = error # An equality override delegates to object's reference semantics +dotnet_diagnostic.SST1447.severity = error # An equality override delegates to object reference semantics dotnet_diagnostic.SST1448.severity = error # An argument is passed explicitly to a caller-info parameter dotnet_diagnostic.SST1449.severity = error # Code writes directly to the console dotnet_diagnostic.SST1450.severity = error # Store files as UTF-8 without a byte order mark @@ -1329,13 +1366,13 @@ dotnet_diagnostic.SST1460.severity = error # Non-mutating struct members should dotnet_diagnostic.SST1461.severity = error # Private parameters that are never read should be removed dotnet_diagnostic.SST1462.severity = error # Suppressions for diagnostics already disabled by config should be removed dotnet_diagnostic.SST1463.severity = error # Symbol-name strings should use nameof -dotnet_diagnostic.SST1464.severity = error # An else follows a branch that never falls through -dotnet_diagnostic.SST1465.severity = error # An else block only wraps an if and should collapse to else if -dotnet_diagnostic.SST1466.severity = error # A case label shares its section with default and adds nothing -dotnet_diagnostic.SST1467.severity = error # An enumerator is driven by hand where foreach would do -dotnet_diagnostic.SST1468.severity = error # Boolean logic uses a non-short-circuiting operator -dotnet_diagnostic.SST1469.severity = error # A value type is compared to null -dotnet_diagnostic.SST1470.severity = error # A catch clause only rethrows +dotnet_diagnostic.SST1464.severity = error # An else clause follows a branch that always jumps and can be unwrapped +dotnet_diagnostic.SST1465.severity = error # An else block that only wraps an if can collapse to else-if +dotnet_diagnostic.SST1466.severity = error # A case label sharing a section with default is redundant +dotnet_diagnostic.SST1467.severity = error # A hand-driven enumerator loop can use foreach +dotnet_diagnostic.SST1468.severity = error # Boolean logic should use the short-circuiting && and || operators +dotnet_diagnostic.SST1469.severity = error # A non-nullable value type is compared to null +dotnet_diagnostic.SST1470.severity = error # A trailing catch clause that only rethrows should be removed dotnet_diagnostic.SST1471.severity = error # Magic numbers should be named constants dotnet_diagnostic.SST1472.severity = error # Signatures should not declare too many parameters dotnet_diagnostic.SST1473.severity = error # A floating-point value is compared for exact equality (zero comparison allowed by default) @@ -1370,7 +1407,7 @@ dotnet_diagnostic.SST1499.severity = error # A static field visible outside its dotnet_diagnostic.SST1500.severity = error # A brace in a multi-line construct shares its line with other code dotnet_diagnostic.SST1501.severity = error # A statement block is collapsed onto a single line dotnet_diagnostic.SST1502.severity = error # An element body is collapsed onto a single line -dotnet_diagnostic.SST1503.severity = none # A control-flow statement omits the braces around its child statement — duplicate with existing brace preferences +dotnet_diagnostic.SST1503.severity = error # A control-flow statement omits the braces around its child statement — duplicate with existing brace preferences dotnet_diagnostic.SST1504.severity = error # The accessors of a property/event mix single-line and multi-line forms dotnet_diagnostic.SST1505.severity = error # An opening brace is followed by a blank line dotnet_diagnostic.SST1506.severity = error # An element documentation header is followed by a blank line @@ -1392,6 +1429,18 @@ dotnet_diagnostic.SST1521.severity = error # A line is longer than the configure dotnet_diagnostic.SST1522.severity = error # A file has more code lines than the configured maximum (default 500) dotnet_diagnostic.SST1523.severity = error # A member has more code lines than the configured maximum (default 60) dotnet_diagnostic.SST1524.severity = error # A switch section has more code lines than the configured maximum (default 20) +dotnet_diagnostic.SST1525.severity = error # A multi-statement `switch` section has no braces; the braces-on policy extends to switch sections. Code fix wraps it. +dotnet_diagnostic.SST1526.severity = error # A wrapped binary expression places the operator inconsistently. Configurable (`before`/`after`, default before). Opt-in. +dotnet_diagnostic.SST1527.severity = error # The `=>` of an expression-bodied member wraps inconsistently. Configurable. Opt-in. +dotnet_diagnostic.SST1528.severity = error # The `=` of a wrapped initializer wraps inconsistently. Configurable. Opt-in. +dotnet_diagnostic.SST1529.severity = error # A wrapped `?.`/`.` call chain places the break inconsistently. Configurable. Opt-in. +dotnet_diagnostic.SST1530.severity = error # A newline sits between a type declaration and its base list. Code fix pulls the base list onto the declaration line. Opt-in. +dotnet_diagnostic.SST1531.severity = error # A short object initializer is split across lines. Code fix collapses it when it fits. Opt-in. +dotnet_diagnostic.SST1532.severity = error # A file mixes line endings. Configurable (`lf`/`crlf`, default lf). Opt-in. +dotnet_diagnostic.SST1533.severity = error # A source file contains no code. Opt-in. +dotnet_diagnostic.SST1535.severity = error # A constructor initializer colon should not be followed by a blank line +dotnet_diagnostic.SST1536.severity = error # A conditional operator token should not be followed by a blank line +dotnet_diagnostic.SST1537.severity = error # An expression-body arrow should not be followed by a blank line # Documentation dotnet_diagnostic.SST1600.severity = error # Externally visible members should be documented @@ -1402,7 +1451,7 @@ dotnet_diagnostic.SST1605.severity = error # Partial element documentation shoul dotnet_diagnostic.SST1606.severity = error # The summary should have text dotnet_diagnostic.SST1607.severity = error # Partial element summary should have text dotnet_diagnostic.SST1608.severity = error # Documentation should not use the default placeholder summary -dotnet_diagnostic.SST1609.severity = none # Property documentation should have a value +dotnet_diagnostic.SST1609.severity = error # Property documentation should have a value dotnet_diagnostic.SST1610.severity = error # Property value documentation should have text dotnet_diagnostic.SST1611.severity = error # Parameters should be documented dotnet_diagnostic.SST1612.severity = error # Parameter documentation should match the parameters @@ -1439,23 +1488,31 @@ dotnet_diagnostic.SST1654.severity = error # Extension blocks should be document dotnet_diagnostic.SST1655.severity = error # Extension block parameters should be documented dotnet_diagnostic.SST1656.severity = error # Extension block type parameters should be documented dotnet_diagnostic.SST1657.severity = error # Extension block documentation should reference a real parameter or type parameter -dotnet_diagnostic.SST1658.severity = error # Documentation repeats a word +dotnet_diagnostic.SST1658.severity = error # Documentation text repeats a word dotnet_diagnostic.SST1659.severity = error # A comment has no text at all +dotnet_diagnostic.SST1660.severity = error # The `` tags are not in parameter order. Code fix reorders them. Info. +dotnet_diagnostic.SST1661.severity = error # A snippet uses ``/`` mismatched to single- vs multi-line content. Code fix swaps the tag. Info. +dotnet_diagnostic.SST1662.severity = error # A thrown exception type has no `` documentation. Code fix adds the skeleton. Opt-in. +dotnet_diagnostic.SST1663.severity = error # A `//` comment before a public member reads like a summary; use `///`. Code fix converts it. Opt-in. +dotnet_diagnostic.SST1664.severity = error # A summary separates paragraphs with blank lines instead of ``. Code fix wraps them. Opt-in. # Concurrency and modernization +dotnet_diagnostic.SST1900.severity = error # see docs/rules/SST1900.md dotnet_diagnostic.SST1901.severity = error # A lock targets a field or property reachable from outside the declaring type dotnet_diagnostic.SST1902.severity = error # Do not lock on 'this', a Type, or a string dotnet_diagnostic.SST1903.severity = error # Do not lock on a newly-created object -dotnet_diagnostic.SST2000.severity = suggestion # A null check plus throw should use ArgumentNullException.ThrowIfNull +dotnet_diagnostic.SST1904.severity = error # A lock targets a non-readonly field +dotnet_diagnostic.SST1905.severity = error # An async method or converted delegate returns void +dotnet_diagnostic.SST2000.severity = error # A null check plus throw should use ArgumentNullException.ThrowIfNull dotnet_diagnostic.SST2001.severity = error # Use ArgumentException.ThrowIfNullOrEmpty dotnet_diagnostic.SST2002.severity = error # Use ArgumentException.ThrowIfNullOrWhiteSpace -dotnet_diagnostic.SST2003.severity = suggestion # A disposed check should use ObjectDisposedException.ThrowIf -dotnet_diagnostic.SST2004.severity = suggestion # A range check should use an ArgumentOutOfRangeException.ThrowIf... helper +dotnet_diagnostic.SST2003.severity = error # A disposed check should use ObjectDisposedException.ThrowIf +dotnet_diagnostic.SST2004.severity = error # A range check should use an ArgumentOutOfRangeException.ThrowIf... helper dotnet_diagnostic.SST2005.severity = error # Use the 'is' type pattern instead of comparing an 'as' cast to null dotnet_diagnostic.SST2006.severity = error # Use the 'is not' pattern instead of negating an 'is' check dotnet_diagnostic.SST2007.severity = error # Use declaration patterns instead of an is check followed by a cast local dotnet_diagnostic.SST2008.severity = error # Negated pattern tests should use is-not patterns -dotnet_diagnostic.SST2009.severity = error # A catch that rethrows unless a condition holds should use a when filter +dotnet_diagnostic.SST2009.severity = error # A catch that tests then rethrows can use a when filter dotnet_diagnostic.SST2010.severity = error # A type reads the machine clock directly instead of through a TimeProvider dotnet_diagnostic.SST2011.severity = error # An instant is recorded from the local clock rather than in UTC dotnet_diagnostic.SST2012.severity = error # A GUID is constructed with the parameterless constructor instead of Guid.Empty @@ -1464,6 +1521,8 @@ dotnet_diagnostic.SST2014.severity = error # A goto jumps to a label dotnet_diagnostic.SST2015.severity = error # A ++ or -- is buried inside a larger expression dotnet_diagnostic.SST2016.severity = error # A DateTime on a visible signature loses its offset at the boundary dotnet_diagnostic.SST2017.severity = error # A .Date or .TimeOfDay read proves the value is only a date, or only a time of day +dotnet_diagnostic.SST2018.severity = error # A redundant null check sits beside an is type pattern +dotnet_diagnostic.SST2019.severity = error # Test for null rather than for object # Modern language and library usage dotnet_diagnostic.SST1700.severity = error # An extension block declares no members @@ -1474,10 +1533,13 @@ dotnet_diagnostic.SST1704.severity = error # A class declaring extension blocks dotnet_diagnostic.SST1705.severity = error # A class mixes classic extension methods with extension blocks dotnet_diagnostic.SST1706.severity = error # An extension block targets a broad receiver type such as object or dynamic dotnet_diagnostic.SST1707.severity = error # Extension blocks should be ordered by receiver type +dotnet_diagnostic.SST1708.severity = error # An extension method never uses its `this` receiver, so it need not be an extension. +dotnet_diagnostic.SST1709.severity = error # A method in a `*Extensions` class whose first parameter lacks `this`. Code fix converts it to an extension block. Opt-in. dotnet_diagnostic.SST1800.severity = error # Record classes should be sealed dotnet_diagnostic.SST1801.severity = error # A positional record parameter does not match the configured casing dotnet_diagnostic.SST1802.severity = error # A record declares a settable rather than init-only instance property dotnet_diagnostic.SST1803.severity = error # A record struct is not declared readonly +dotnet_diagnostic.SST1804.severity = error # A positional record has an empty `{ }` body where `;` would do. Code fix rewrites it. Info. dotnet_diagnostic.SST2100.severity = error # An empty collection creation can use [] dotnet_diagnostic.SST2101.severity = error # An explicit collection creation can use [...] dotnet_diagnostic.SST2102.severity = error # A span-targeted stackalloc initializer can use a collection expression @@ -1489,11 +1551,11 @@ dotnet_diagnostic.SST2201.severity = error # A return-only switch statement can dotnet_diagnostic.SST2202.severity = error # An object creation repeats an explicit target type dotnet_diagnostic.SST2203.severity = error # An array or string index can use from-end indexing dotnet_diagnostic.SST2204.severity = error # A string slice can use range syntax -dotnet_diagnostic.SST2205.severity = none # An enum switch statement omits named enum values — duplicate of IDE0010 (disabled: too noisy for default/fallthrough) and S131; statement switches deliberately no-op omitted values, and a default to satisfy it is rejected by SST1179/S3532. SST2206 keeps the valuable switch-expression exhaustiveness check. +dotnet_diagnostic.SST2205.severity = error # An enum switch statement omits named enum values — duplicate of IDE0010 (disabled: too noisy for default/fallthrough) and S131; statement switches deliberately no-op omitted values, and a default to satisfy it is rejected by SST1179/S3532. SST2206 keeps the valuable switch-expression exhaustiveness check. dotnet_diagnostic.SST2206.severity = error # An enum switch expression omits named enum values dotnet_diagnostic.SST2207.severity = error # A null guard and return can keep the throw in the returned expression dotnet_diagnostic.SST2208.severity = error # An out variable can be declared at the call site -dotnet_diagnostic.SST2209.severity = none # A null-forgiving operator has no local effect +dotnet_diagnostic.SST2209.severity = error # A null-forgiving operator has no local effect dotnet_diagnostic.SST2210.severity = error # A nullable directive repeats the current file-local state dotnet_diagnostic.SST2211.severity = error # A nullable restore directive has no file-local state to restore dotnet_diagnostic.SST2212.severity = error # Literal UTF-8 byte data can use a u8 string literal @@ -1513,8 +1575,11 @@ dotnet_diagnostic.SST2225.severity = error # A foreach loop hides an explicit el dotnet_diagnostic.SST2226.severity = error # A cast hides an inner explicit conversion dotnet_diagnostic.SST2227.severity = error # A post-assignment null fallback can be folded into the assigned expression dotnet_diagnostic.SST2228.severity = error # A delegate local used only as a call target can be a local function +dotnet_diagnostic.SST2229.severity = error # see docs/rules/SST2229.md +dotnet_diagnostic.SST2230.severity = error # see docs/rules/SST2230.md dotnet_diagnostic.SST2231.severity = error # A broad object pattern can use a direct null pattern dotnet_diagnostic.SST2232.severity = error # nameof does not need concrete generic type arguments +dotnet_diagnostic.SST2233.severity = error # see docs/rules/SST2233.md dotnet_diagnostic.SST2234.severity = error # Nullable should use the T? shorthand dotnet_diagnostic.SST2235.severity = error # Capture-free local functions should be static dotnet_diagnostic.SST2236.severity = error # Tail-position using blocks can use using declarations @@ -1524,11 +1589,46 @@ dotnet_diagnostic.SST2239.severity = error # Forwarding lambdas can use method g dotnet_diagnostic.SST2240.severity = error # Delegate null checks can use conditional invocation dotnet_diagnostic.SST2241.severity = error # Constructors that only store parameters can use primary-constructor storage dotnet_diagnostic.SST2242.severity = error # Enum switch statement mappings should name every enum value or include a catch-all -dotnet_diagnostic.SST2243.severity = error # A string literal escaping quotes or backslashes should be a raw string literal +dotnet_diagnostic.SST2243.severity = error # A verbatim string with escapes or line breaks can use a raw string literal dotnet_diagnostic.SST2244.severity = error # A numeric literal's suffix is lower case dotnet_diagnostic.SST2245.severity = error # A for loop with only a condition should be a while loop -dotnet_diagnostic.RCS1040.severity = none # covered by SST1180 - +dotnet_diagnostic.SST2246.severity = error # A chain of conditional expressions testing one value against constants can be a switch expression +dotnet_diagnostic.SST2247.severity = error # Consecutive locals copying one value's members in order can be a deconstruction +dotnet_diagnostic.SST2248.severity = error # Two constant comparisons of the same value can fold into one is-pattern +dotnet_diagnostic.SST2249.severity = error # A literal-format string.Format or literal concatenation can be an interpolated string +dotnet_diagnostic.SST2250.severity = error # A bare local assigned once by the next statement can be an initialized declaration +dotnet_diagnostic.SST2251.severity = error # A method call names type arguments that inference would supply +dotnet_diagnostic.SST2252.severity = error # A switch statement is nested inside another switch statement +dotnet_diagnostic.SST2254.severity = error # A target-typed `new()` is written where an explicit type reads more clearly; the code fix restores `new TypeName(...)`. Opt-in — the counterpart to SST2202's target-typed direction, so a team enables at most one. +dotnet_diagnostic.SST2255.severity = error # A hand-written null-or-empty string test. Code fix uses `string.IsNullOrEmpty`. +dotnet_diagnostic.SST2256.severity = error # An extension method called in static form. Code fix rewrites to instance form. Info. +dotnet_diagnostic.SST2257.severity = error # A lambda block body that is a single `return`. Code fix uses an expression body. Info. +dotnet_diagnostic.SST2258.severity = error # A redundant explicit delegate wrapper (`new EventHandler(M)`). Code fix drops it. Info. +dotnet_diagnostic.SST2259.severity = error # A stray `;` after a type declaration. Code fix removes it. Info. +dotnet_diagnostic.SST2260.severity = error # An `as` cast to a type the operand already has. Code fix removes it. Info. +dotnet_diagnostic.SST2261.severity = error # `(x && !y) +dotnet_diagnostic.SST2262.severity = error # A raw string literal whose content needs no raw syntax. Code fix demotes it. Info. +dotnet_diagnostic.SST2263.severity = error # An infinite loop whose body re-derives its stop condition. Code fix hoists the condition into the header. Info. +dotnet_diagnostic.SST2264.severity = error # A numeric literal cast to an enum. Code fix names the member. +dotnet_diagnostic.SST2265.severity = error # Consecutive fluent calls on one receiver can fold into a chain. Opt-in. +dotnet_diagnostic.SST2266.severity = error # A local read exactly once can be inlined into that use. Opt-in. +dotnet_diagnostic.SST2267.severity = error # Infinite loops written in mixed `while(true)`/`for(;;)` styles. Configurable. Opt-in. +dotnet_diagnostic.SST2268.severity = error # Inconsistent `()` on object creation with an initializer. Configurable. Opt-in. +dotnet_diagnostic.SST2269.severity = error # Inconsistent parentheses around a conditional's condition. Configurable. Opt-in. +dotnet_diagnostic.SST2270.severity = error # Inconsistent explicit-vs-implicit array-creation type. Configurable. Opt-in. +dotnet_diagnostic.SST2271.severity = error # `var`-vs-explicit local type per the configured preference. Configurable. Opt-in. +dotnet_diagnostic.SST2272.severity = error # `[Flags]` member values written as mixed decimals and shifts. Configurable. Opt-in. +dotnet_diagnostic.SST2273.severity = error # A function or loop body wraps its work in a trailing `if` that could be an early-exit guard clause. Code fix inverts it. Configurable threshold. Opt-in. +dotnet_diagnostic.SST2274.severity = error # A value assigned with `as` and then null-checked is an `is` declaration pattern in one step. Code fix rewrites it. +dotnet_diagnostic.SST2275.severity = error # A method whose block body is a single statement can use an expression body `=> expr`. Code fix rewrites it. +dotnet_diagnostic.SST2276.severity = error # A constructor whose block body is a single statement can use an expression body. Code fix rewrites it. Opt-in. +dotnet_diagnostic.SST2277.severity = error # An operator whose block body is a single `return` can use an expression body. Code fix rewrites it. Opt-in. +dotnet_diagnostic.SST2278.severity = error # A conversion operator whose block body is a single `return` can use an expression body. Code fix rewrites it. Opt-in. +dotnet_diagnostic.SST2279.severity = error # A get-only property whose getter is a single `return` can use a whole-member expression body. Code fix rewrites it. +dotnet_diagnostic.SST2280.severity = error # A get-only indexer whose getter is a single `return` can use a whole-member expression body. Code fix rewrites it. +dotnet_diagnostic.SST2281.severity = error # A local function whose block body is a single statement can use an expression body. Code fix rewrites it. +dotnet_diagnostic.SST2282.severity = error # A reference-type `ReferenceEquals` check against `null` reads as an `is null` / `is not null` pattern. Code fix rewrites it. +dotnet_diagnostic.SST2283.severity = error # A null guard that throws right before assigning the guarded value can fold into the assignment as `?? throw`. Code fix rewrites it. # Design dotnet_diagnostic.SST2300.severity = error # A class implements IDisposable but builds only half of the disposal pattern dotnet_diagnostic.SST2301.severity = error # A class implementing IEquatable for itself can still be derived from @@ -1537,14 +1637,35 @@ dotnet_diagnostic.SST2303.severity = error # A [Flags] enum's members are not di dotnet_diagnostic.SST2304.severity = error # An event's delegate does not have the standard (object sender, TEventArgs e) shape dotnet_diagnostic.SST2305.severity = error # A mutable collection property declares a caller-visible setter dotnet_diagnostic.SST2306.severity = error # A collection-returning member hands back null -dotnet_diagnostic.SST2307.severity = error # A generic method has a type parameter that cannot be inferred from its parameters +dotnet_diagnostic.SST2307.severity = error # A generic method's type parameter appears in no parameter, so no caller can infer it dotnet_diagnostic.SST2308.severity = error # An [Obsolete] attribute carries no message dotnet_diagnostic.SST2309.severity = error # An externally visible member declares an optional parameter, so callers bake in the default dotnet_diagnostic.SST2310.severity = error # Deprecated code is still here; remove it once its last caller is gone dotnet_diagnostic.SST2311.severity = error # A visible const is copied into every assembly that reads it dotnet_diagnostic.SST2312.severity = error # A type is declared outside any namespace dotnet_diagnostic.SST2313.severity = error # An enum is stored as a type the project does not allow -dotnet_diagnostic.SST2314.severity = none # An [Obsolete] has a message but no DiagnosticId — unusable here: ObsoleteAttribute.DiagnosticId is .NET 5+, and this source is shared with net462 +dotnet_diagnostic.SST2314.severity = error # An [Obsolete] has a message but no DiagnosticId — unusable here: ObsoleteAttribute.DiagnosticId is .NET 5+, and this source is shared with net462 +dotnet_diagnostic.SST2315.severity = error # A type owns a disposable field but does not implement IDisposable +dotnet_diagnostic.SST2316.severity = error # A type declares Dispose or DisposeAsync without implementing IDisposable +dotnet_diagnostic.SST2317.severity = error # A disposable type owns a raw IntPtr without a SafeHandle or finalizer +dotnet_diagnostic.SST2318.severity = error # Two members have token-identical bodies +dotnet_diagnostic.SST2319.severity = error # An overload's optional default can never be used +dotnet_diagnostic.SST2320.severity = error # An interface inherits two interfaces that declare the same member +dotnet_diagnostic.SST2321.severity = error # Environment.Exit or Environment.FailFast is called from library code +dotnet_diagnostic.SST2322.severity = error # A non-private readonly field holds a mutable collection callers can still change +dotnet_diagnostic.SST2323.severity = error # A stateless abstract class declaring only public abstract members should be an interface +dotnet_diagnostic.SST2324.severity = error # A member is declared more accessible than its containing type +dotnet_diagnostic.SST2325.severity = error # An async method checks an argument after its first await +dotnet_diagnostic.SST2326.severity = error # An interface-typed value is narrowed to a concrete implementation — this is a high-performance core library, not strictly SOLID code, and narrowing to a known runtime type is a normal fast-path technique here: foreach over IEnumerable boxes List's struct enumerator (40 bytes per call, measured) where the indexed loop behind the type test allocates nothing +dotnet_diagnostic.SST2327.severity = error # A type tests its own runtime type against a class instead of dispatching through a virtual member +dotnet_diagnostic.SST2328.severity = error # A raw native pointer handle is exposed instead of a SafeHandle +dotnet_diagnostic.SST2329.severity = error # A `[Flags]` enum declares no zero-valued member. Code fix adds `None = 0`. +dotnet_diagnostic.SST2330.severity = error # A `[Flags]` member is a numeric literal equal to a combination of others (`All = 7`). Code fix writes `A +dotnet_diagnostic.SST2331.severity = error # An enum leaves member values implicit, so their numbers depend on declaration order. Opt-in. +dotnet_diagnostic.SST2332.severity = error # An auto-property's `private set` is only written during construction; make it get-only. +dotnet_diagnostic.SST2333.severity = error # A generic comparison/equality contract is implemented without its non-generic counterpart. Opt-in. +dotnet_diagnostic.SST2334.severity = error # A publicly visible type has no `[DebuggerDisplay]`. Opt-in. +dotnet_diagnostic.SST2335.severity = error # Parts of a partial type disagree on the `static` modifier. Opt-in. # Correctness dotnet_diagnostic.SST2400.severity = error # Two arguments name each other's parameters and have been transposed @@ -1558,11 +1679,120 @@ dotnet_diagnostic.SST2407.severity = error # A declared event is never raised dotnet_diagnostic.SST2408.severity = error # A StringBuilder is filled and never read dotnet_diagnostic.SST2409.severity = error # A throw constructs a general exception type (Exception/SystemException/ApplicationException) dotnet_diagnostic.SST2410.severity = error # A created disposable is never disposed and never leaves the method +dotnet_diagnostic.SST2411.severity = error # A for loop declares and tests a counter it never steps +dotnet_diagnostic.SST2412.severity = error # A for loop update moves the counter away from its stop condition +dotnet_diagnostic.SST2413.severity = error # A for loop condition can never be true on the first pass +dotnet_diagnostic.SST2414.severity = error # Two branches of a conditional share the same implementation +dotnet_diagnostic.SST2415.severity = error # A non-short-circuiting & or | evaluates a right operand that does work +dotnet_diagnostic.SST2416.severity = error # A modulus result on a signed type is compared directly to 1 +dotnet_diagnostic.SST2417.severity = error # A compound assignment operator is transposed (=+, =-, =!) +dotnet_diagnostic.SST2418.severity = error # The result of an immutable value's method is discarded +dotnet_diagnostic.SST2419.severity = error # A set or collection operation is performed against itself +dotnet_diagnostic.SST2420.severity = error # An IndexOf result is tested with > 0, skipping index 0 +dotnet_diagnostic.SST2421.severity = error # A write targets a readonly field of an unconstrained type parameter +dotnet_diagnostic.SST2422.severity = error # A property getter returns a different field than its setter writes +dotnet_diagnostic.SST2423.severity = error # A disposable created in a using statement is returned +dotnet_diagnostic.SST2424.severity = error # An override changes a parameter's default value +dotnet_diagnostic.SST2425.severity = error # An override drops an optional argument on its base call +dotnet_diagnostic.SST2426.severity = error # An override adds or removes params on a parameter +dotnet_diagnostic.SST2427.severity = error # A derived overload widens a parameter and hides the base overload +dotnet_diagnostic.SST2428.severity = error # A static initializer reads a static field declared later +dotnet_diagnostic.SST2429.severity = error # A setter, init, add, or remove accessor never reads value +dotnet_diagnostic.SST2430.severity = error # A serialization callback has the wrong signature +dotnet_diagnostic.SST2431.severity = error # A ToString override can return null +dotnet_diagnostic.SST2432.severity = error # GetType is called on a value that is already a System.Type +dotnet_diagnostic.SST2433.severity = error # A caller-info parameter is not last in the list +dotnet_diagnostic.SST2434.severity = error # An array is assigned through a covariant element type +dotnet_diagnostic.SST2435.severity = error # A non-object base's value-equality Equals is used as a reference-equality fast path +dotnet_diagnostic.SST2436.severity = error # An event is raised with a null sender or null args +dotnet_diagnostic.SST2437.severity = error # A generic type inherits from itself recursively +dotnet_diagnostic.SST2438.severity = error # A catch that discards its exception logs at Error or Critical without it +dotnet_diagnostic.SST2439.severity = error # An exception is passed as a log template argument instead of the exception parameter +dotnet_diagnostic.SST2440.severity = error # Log template arguments are transposed +dotnet_diagnostic.SST2441.severity = error # A log template has an empty or non-identifier placeholder +dotnet_diagnostic.SST2442.severity = error # A log template repeats a named placeholder +dotnet_diagnostic.SST2443.severity = error # An ILogger is injected or created with the wrong category type +dotnet_diagnostic.SST2444.severity = error # A regular expression pattern is invalid +dotnet_diagnostic.SST2445.severity = error # A culture-sensitive custom date or time format is used without an invariant culture +dotnet_diagnostic.SST2446.severity = error # A Stream.ReadAsync result is discarded through ConfigureAwait or a local +dotnet_diagnostic.SST2448.severity = error # A combined or opaque delegate is removed with - or -=, which strips only a contiguous run +dotnet_diagnostic.SST2449.severity = error # A lambda or anonymous-method handler is removed with -=, which never matches it +dotnet_diagnostic.SST2450.severity = error # A Debug.Assert condition performs a side effect that a release build compiles out +dotnet_diagnostic.SST2451.severity = error # Every constructor is private and no member ever creates an instance +dotnet_diagnostic.SST2452.severity = error # A [Pure] method returns void, Task, or ValueTask, so it has no observable result +dotnet_diagnostic.SST2456.severity = error # An override or new field-like event gets its own backing delegate field +dotnet_diagnostic.SST2457.severity = error # An integer Sum wrapped in unchecked still throws on overflow +dotnet_diagnostic.SST2458.severity = error # A bitwise operator is applied to an enum not declared [Flags] +dotnet_diagnostic.SST2459.severity = error # [Optional] on a ref or out parameter advertises an optionality no caller can use +dotnet_diagnostic.SST2460.severity = error # [DefaultValue] on a method or record parameter is inert +dotnet_diagnostic.SST2462.severity = error # A new member is less accessible than the inherited member it hides +dotnet_diagnostic.SST2463.severity = error # A field differs from an inherited accessible field only by case +dotnet_diagnostic.SST2464.severity = error # A mutable class declares a value-equality operator ==, so it is lost as a hash key +dotnet_diagnostic.SST2465.severity = error # A for loop body reassigns the counter or the local its condition tests +dotnet_diagnostic.SST2467.severity = error # A params overload is shadowed by a same-arity overload with a more specific last parameter +dotnet_diagnostic.SST2468.severity = error # A classic partial method is declared but never implemented, so its calls are removed +dotnet_diagnostic.SST2470.severity = error # Two string literals concatenate with no space, fusing a SQL keyword into the next token +dotnet_diagnostic.SST2472.severity = error # A type is exported for a contract it neither implements nor inherits +dotnet_diagnostic.SST2473.severity = error # A shared export part is constructed with new, bypassing the container +dotnet_diagnostic.SST2474.severity = error # A part-creation-policy attribute is applied to a type with no [Export] +dotnet_diagnostic.SST2475.severity = error # An entity's primary key is typed DateTime or DateTimeOffset +dotnet_diagnostic.SST2479.severity = error # A loop variable captured by a callback stored beyond the iteration reads its final value +dotnet_diagnostic.SST2481.severity = error # A GetHashCode override folds the base identity hash into a value hash +dotnet_diagnostic.SST2484.severity = error # A handle read through DangerousGetHandle is not reference-counted +dotnet_diagnostic.SST2485.severity = error # A NotImplementedException is left in shipped code +dotnet_diagnostic.SST2486.severity = error # An assembly is loaded by path or partial name instead of Assembly.Load +dotnet_diagnostic.SST2487.severity = error # A [ConstructorArgument] does not name a constructor parameter +dotnet_diagnostic.SST2488.severity = error # An exception is logged and rethrown, duplicating the record +dotnet_diagnostic.SST2489.severity = error # A relational comparison is decided by the operand's type rather than its value +dotnet_diagnostic.SST2490.severity = error # Adjacent try statements with identical handling should be merged +dotnet_diagnostic.SST2491.severity = error # A non-`async` method returns an awaitable from inside `using`/`try-finally`/`lock`, so the resource is torn down before the task completes. Code fix makes it `async`. +dotnet_diagnostic.SST2492.severity = error # A null-guard throws on a parameter the signature declares may be null. +dotnet_diagnostic.SST2493.severity = error # `== null`/`!= null` on an unconstrained generic `T`. Code fix uses `is null`/`is not null`. +dotnet_diagnostic.SST2494.severity = error # A `??` whose left operand is a constant null, so the right is always taken. Code fix folds it. +dotnet_diagnostic.SST2495.severity = error # A `[Flags]` combination includes an operand whose bits another already covers. Code fix removes it. +dotnet_diagnostic.SST2496.severity = error # An explicit `Dispose`/`Close` on a resource an enclosing `using` already disposes. Code fix removes it. Info. +dotnet_diagnostic.SST2497.severity = error # Do not forward a member to itself +dotnet_diagnostic.SST2498.severity = error # Do not use nameof on a type parameter + +# Testing +dotnet_diagnostic.SST2500.severity = error # A test method contains no assertion and no expected-exception check +dotnet_diagnostic.SST2501.severity = error # An equality or identity assertion compares an expression with itself +dotnet_diagnostic.SST2502.severity = error # An equality assertion passes the constant as actual and the computed value as expected +dotnet_diagnostic.SST2503.severity = error # An equality assertion compares a value against a boolean literal +dotnet_diagnostic.SST2504.severity = error # A test fixture declares and inherits no test method +dotnet_diagnostic.SST2505.severity = error # A test method declares parameters but no data source +dotnet_diagnostic.SST2506.severity = error # A test method calls Thread.Sleep +dotnet_diagnostic.SST2507.severity = error # A test method declares its expected failure with an expected-exception attribute +dotnet_diagnostic.SST2508.severity = error # A fluent assertion is started but never completed +dotnet_diagnostic.SST2509.severity = error # A test method has a shape the runner cannot execute + +# Logging +dotnet_diagnostic.SST2600.severity = error # Application output is written through legacy Trace instead of a structured logger +dotnet_diagnostic.SST2601.severity = error # A logger field or property does not follow the logger naming convention + +# Frameworks +dotnet_diagnostic.SST2700.severity = error # An MVC route template contains a backslash; route segments are separated by `/`, so the route is unreachable. Code fix replaces `\` with `/`. +dotnet_diagnostic.SST2701.severity = error # A `[JSInvokable]` method is not public, so JavaScript interop cannot call it. Code fix makes it public. +dotnet_diagnostic.SST2702.severity = error # A `[SupplyParameterFromQuery]` property has a type the framework cannot bind from the query string, which throws at runtime. +dotnet_diagnostic.SST2703.severity = error # A routable component's route constraint (`{id:int}`) disagrees with the matching `[Parameter]` CLR type, so the route silently fails to match. +dotnet_diagnostic.SST2704.severity = error # A public action on an `[ApiController]` declares no HTTP-verb attribute, so it answers every verb and can make routing ambiguous. +dotnet_diagnostic.SST2705.severity = error # A bound model member is a non-nullable value type with no required marker, so a request that omits it binds the default with no error. Opt-in. +dotnet_diagnostic.SST2706.severity = error # A Windows Forms entry point carries neither `[STAThread]` nor `[MTAThread]`; without STA, clipboard, drag-and-drop, and common dialogs misbehave. Code fix adds `[STAThread]`. +dotnet_diagnostic.SST2707.severity = error # A fire-and-forget `Task.Run` in a controller captures the request's `HttpContext`, which is disposed when the request ends, so the background work throws `ObjectDisposedException`. Opt-in. +dotnet_diagnostic.SST2708.severity = error # A component subscribes to an event in a lifecycle method but never unsubscribes, so the event source keeps the component alive — a per-session leak on a Server circuit. +dotnet_diagnostic.SST2709.severity = error # `StateHasChanged` is called while the component is being disposed, which the renderer no longer supports and throws. +dotnet_diagnostic.SST2710.severity = error # `StateHasChanged` is called directly from a timer callback, off the renderer's dispatcher; marshal it with `InvokeAsync(StateHasChanged)`. +dotnet_diagnostic.SST2711.severity = error # A synchronous component lifecycle method is overridden as `async void`, which the framework never awaits; override the `…Async` twin returning `Task`. Code fix rewrites the signature. +dotnet_diagnostic.SST2712.severity = error # An `[Inject]`/`[CascadingParameter]` property has no setter, so the framework's reflection-based binding leaves it null. Code fix adds a setter. +dotnet_diagnostic.SST2713.severity = error # A `DotNetObjectReference.Create(this)` is passed inline and never stored, so nothing can dispose it and it leaks on the JavaScript side. ################### # PerformanceSharp Analyzers (PSH) ################### -# Allocations +performancesharp.avoid_linq_on_hot_path = true +# performancesharp.empty_string_style = pattern # PSH1204 (pattern | length | is_null_or_empty; the last two are only offered where the string is provably not null) +# performancesharp.excluded_properties = Items, Keys # PSH1017 (comma-separated; properties allowed to copy on read) +# performancesharp.include_public = false # PSH1411 (set true in an app to seal public types too; a break in a library) dotnet_diagnostic.PSH1000.severity = error # Anonymous functions without captures should be static dotnet_diagnostic.PSH1001.severity = error # Avoid allocating zero-length arrays (fix prefers [] on C# 12+, else Array.Empty()) dotnet_diagnostic.PSH1002.severity = error # Empty finalizers should be removed @@ -1579,16 +1809,17 @@ dotnet_diagnostic.PSH1012.severity = error # Compare type parameter values with dotnet_diagnostic.PSH1013.severity = error # Expose constant UTF-8 data as a ReadOnlySpan property dotnet_diagnostic.PSH1014.severity = error # Declare immutable structs as readonly dotnet_diagnostic.PSH1015.severity = error # Avoid casting value types through object -dotnet_diagnostic.PSH1016.severity = error # Test enum flags with bitwise operators instead of boxing +dotnet_diagnostic.PSH1016.severity = error # Test enum flags with bitwise operators instead of Enum.HasFlag dotnet_diagnostic.PSH1017.severity = error # A property allocates a copy of a collection on every read (excludable via performancesharp.PSH1017.excluded_properties) dotnet_diagnostic.PSH1018.severity = error # A hand-written array is passed to a params parameter dotnet_diagnostic.PSH1019.severity = error # The range indexer on an array allocates a copy; slice with AsSpan/AsMemory dotnet_diagnostic.PSH1020.severity = error # Prefer a jagged array over a multidimensional one - -# Collections +dotnet_diagnostic.PSH1021.severity = error # An explicit GC.Collect or GC.WaitForPendingFinalizers forces collection the runtime tunes itself +dotnet_diagnostic.PSH1022.severity = error # A parameterless `new EventArgs()` allocates where the shared `EventArgs.Empty` singleton would serve. Code fix uses the singleton. +dotnet_diagnostic.PSH1023.severity = error # Use a tuple instead of an anonymous type for a local value dotnet_diagnostic.PSH1100.severity = error # Hot-path code should avoid System.Linq.Enumerable calls -dotnet_diagnostic.PSH1101.severity = none # LINQ terminal predicate simplification is reserved for test code; production code should avoid LINQ on hot paths -dotnet_diagnostic.PSH1102.severity = none # LINQ type-filter simplification is reserved for test code; production code should avoid LINQ on hot paths +dotnet_diagnostic.PSH1101.severity = error # LINQ terminal predicate simplification is reserved for test code; production code should avoid LINQ on hot paths +dotnet_diagnostic.PSH1102.severity = error # LINQ type-filter simplification is reserved for test code; production code should avoid LINQ on hot paths dotnet_diagnostic.PSH1103.severity = error # Prefer the collection's own count over enumerating dotnet_diagnostic.PSH1104.severity = error # Use TryGetValue instead of ContainsKey followed by an indexer read dotnet_diagnostic.PSH1105.severity = error # Avoid double lookups on dictionaries and sets @@ -1600,20 +1831,18 @@ dotnet_diagnostic.PSH1110.severity = error # Use the collection's own predicate dotnet_diagnostic.PSH1111.severity = error # Use Contains for membership tests dotnet_diagnostic.PSH1112.severity = error # Seed the collection through its constructor (fix honors performancesharp.prefer_collection_expressions) dotnet_diagnostic.PSH1113.severity = error # Sort naturally instead of ordering by the element itself -# dotnet_diagnostic.PSH1114.severity = error # Freeze static lookup collections (opt-in; freezing trades slower construction for faster reads) +dotnet_diagnostic.PSH1114.severity = error # Freeze static lookup collections that are never mutated. Opt-in. dotnet_diagnostic.PSH1115.severity = error # Insert-if-absent should probe the dictionary once dotnet_diagnostic.PSH1116.severity = error # Probe string-keyed collections with a span through GetAlternateLookup dotnet_diagnostic.PSH1117.severity = error # Ask the collection whether it is empty -dotnet_diagnostic.PSH1118.severity = error # Take the extreme element without sorting the whole sequence -dotnet_diagnostic.PSH1119.severity = error # Check for elements without counting them all -dotnet_diagnostic.PSH1120.severity = error # Do not materialize a sequence just to enumerate it +dotnet_diagnostic.PSH1118.severity = error # Take the extreme element with Min/Max/MinBy/MaxBy instead of sorting +dotnet_diagnostic.PSH1119.severity = error # Check for elements with Any instead of counting them all +dotnet_diagnostic.PSH1120.severity = error # Do not materialize a sequence with ToList/ToArray just to enumerate it dotnet_diagnostic.PSH1122.severity = error # Read a sorted set's extreme through its Min/Max property, not the LINQ extension dotnet_diagnostic.PSH1124.severity = error # Read a linked list's end through its First/Last property, not the LINQ extension dotnet_diagnostic.PSH1125.severity = error # Do not enumerate the same lazy sequence twice dotnet_diagnostic.PSH1126.severity = error # Ask whether an async sequence has elements instead of counting them dotnet_diagnostic.PSH1127.severity = error # Clear an array instead of filling it with its default - -# Strings dotnet_diagnostic.PSH1200.severity = error # Compare strings without allocating case-converted copies dotnet_diagnostic.PSH1201.severity = error # Use the char overload for single-character strings dotnet_diagnostic.PSH1202.severity = error # Append characters as char, not single-character strings @@ -1628,9 +1857,9 @@ dotnet_diagnostic.PSH1210.severity = error # Compare UTF-8 bytes without decodin dotnet_diagnostic.PSH1211.severity = error # Pass values directly instead of ToString results dotnet_diagnostic.PSH1212.severity = error # Slice with AsSpan when the call accepts a span dotnet_diagnostic.PSH1213.severity = error # Probe repeated character sets through SearchValues -dotnet_diagnostic.PSH1214.severity = error # Append the parts, not a concatenated whole -dotnet_diagnostic.PSH1215.severity = error # Concatenate when there is no separator to join on -dotnet_diagnostic.PSH1216.severity = error # Ask for equality, not ordering, when only equality matters +dotnet_diagnostic.PSH1214.severity = error # Append the parts of a concatenation separately, not the concatenated whole +dotnet_diagnostic.PSH1215.severity = error # Use string.Concat instead of string.Join with an empty separator +dotnet_diagnostic.PSH1216.severity = error # Use string.Equals instead of comparing string.Compare to zero dotnet_diagnostic.PSH1217.severity = error # A sequence is copied to an array just to be read straight back dotnet_diagnostic.PSH1218.severity = error # A substring is allocated only to search it; slice with AsSpan instead dotnet_diagnostic.PSH1219.severity = error # Ask whether a string is blank without trimming it @@ -1640,26 +1869,25 @@ dotnet_diagnostic.PSH1222.severity = error # Concatenate slices without material dotnet_diagnostic.PSH1223.severity = error # A reused composite format string is re-parsed on every call dotnet_diagnostic.PSH1224.severity = error # Convert bytes to hex in one call, not by building the string twice dotnet_diagnostic.PSH1225.severity = error # Decode bytes to a string in one call, without a throwaway char[] - -# Concurrency +dotnet_diagnostic.PSH1226.severity = error # A string's `ToCharArray()` result is only iterated, allocating a throwaway `char[]`; iterate the string directly. Code fix drops the copy. +dotnet_diagnostic.PSH1227.severity = error # A cheaper equivalent exists — `string.CompareOrdinal` over `Compare(…, Ordinal)`, `Debug.Fail` over `Debug.Assert(false, …)`. Info. Code fix rewrites the call. dotnet_diagnostic.PSH1300.severity = error # Use System.Threading.Lock for a dedicated lock object dotnet_diagnostic.PSH1301.severity = error # Do not wrap a single task in WhenAll or WaitAll dotnet_diagnostic.PSH1302.severity = error # TaskCompletionSource should run continuations asynchronously dotnet_diagnostic.PSH1303.severity = error # Do not block an async method with Thread.Sleep dotnet_diagnostic.PSH1304.severity = error # Use PeriodicTimer instead of pacing a loop with Task.Delay dotnet_diagnostic.PSH1305.severity = error # Enumerate a ConcurrentDictionary directly, not its Keys/Values snapshots -# dotnet_diagnostic.PSH1306.severity = error # Guard one-time execution with an interlocked latch (opt-in; thread-safety needs are contextual) +dotnet_diagnostic.PSH1306.severity = error # Guard one-time execution with an interlocked latch. Opt-in. dotnet_diagnostic.PSH1307.severity = error # Access interlocked fields with Volatile dotnet_diagnostic.PSH1308.severity = error # Return the completed task instead of Task.FromResult -# dotnet_diagnostic.PSH1309.severity = error # Register cancellation callbacks without flowing the execution context (opt-in; changes AsyncLocal visibility) -dotnet_diagnostic.PSH1310.severity = error # Dispose asynchronously in async code -dotnet_diagnostic.PSH1311.severity = error # Remove a pass-through async state machine -dotnet_diagnostic.PSH1312.severity = error # Return a completed task, never null +dotnet_diagnostic.PSH1309.severity = error # Register cancellation callbacks without flowing the execution context. Opt-in. +dotnet_diagnostic.PSH1310.severity = error # Dispose IAsyncDisposable resources with await using in async code +dotnet_diagnostic.PSH1311.severity = error # Remove a pass-through async state machine and return the task directly +dotnet_diagnostic.PSH1312.severity = error # Return a completed task instead of null dotnet_diagnostic.PSH1313.severity = error # A synchronous call where an async overload fits dotnet_diagnostic.PSH1314.severity = error # Read and write streams through the memory-based overloads dotnet_diagnostic.PSH1315.severity = error # A blocking wait on an awaitable that may not be done - -# API selection +dotnet_diagnostic.PSH1316.severity = error # A ValueTask is awaited in a loop or awaited after being copied dotnet_diagnostic.PSH1400.severity = error # Use the static HashData method for one-shot hashing dotnet_diagnostic.PSH1401.severity = error # Attribute types should be sealed dotnet_diagnostic.PSH1402.severity = error # Use const for compile-time constants @@ -1670,7 +1898,7 @@ dotnet_diagnostic.PSH1406.severity = error # Ask Regex for the answer directly dotnet_diagnostic.PSH1407.severity = error # Query the dictionary, not its Keys view dotnet_diagnostic.PSH1408.severity = error # Measure elapsed time with Stopwatch timestamps dotnet_diagnostic.PSH1409.severity = error # Use the built-in throw helpers for argument guards -# dotnet_diagnostic.PSH1410.severity = error # Mark trivial forwarders for aggressive inlining (opt-in; opinionated convention) +dotnet_diagnostic.PSH1410.severity = error # Mark trivial forwarders for aggressive inlining. Opt-in. dotnet_diagnostic.PSH1411.severity = error # Seal non-public types nothing derives from so the JIT can devirtualize dotnet_diagnostic.PSH1412.severity = error # Use Random.Shared instead of allocating a Random dotnet_diagnostic.PSH1413.severity = error # Read the Unix epoch from the framework, not a hand-built DateTime @@ -1678,17 +1906,128 @@ dotnet_diagnostic.PSH1414.severity = error # Mark members that do not touch inst dotnet_diagnostic.PSH1415.severity = error # Hold the concrete type when the concrete type is what you have dotnet_diagnostic.PSH1416.severity = error # Cache the serializer options instead of building them per call dotnet_diagnostic.PSH1417.severity = error # Do not compute an expensive argument for an assertion +dotnet_diagnostic.PSH1418.severity = error # An HttpClient is constructed on every call +dotnet_diagnostic.PSH1419.severity = error # A time-zone is resolved with a platform-specific id instead of the cross-platform API +dotnet_diagnostic.PSH1420.severity = error # A shareable client held in an instance field of an Azure Functions worker class is rebuilt on every invocation, leaking sockets and connections; share a static/singleton client or inject `IHttpClientFactory`. + +# ASP.NET Core - inert in this repo (no route handlers or middleware), enabled so the set stays complete +dotnet_diagnostic.PSH1500.severity = error # A minimal API handler returns Results instead of TypedResults, boxing the result +dotnet_diagnostic.PSH1501.severity = error # Middleware uses the legacy nested-delegate Use overload, allocating a per-request closure +dotnet_diagnostic.PSH1502.severity = error # A route handler returns a deferred sequence the serializer enumerates on the request thread +dotnet_diagnostic.PSH1503.severity = error # Response caching is used where server-side output caching applies +dotnet_diagnostic.PSH1505.severity = error # Exceptions are handled in an MVC exception filter instead of an IExceptionHandler +dotnet_diagnostic.PSH1506.severity = error # The HTTP request or response body is read or written synchronously (`ReadToEnd`, `Body.Read`, `Body.Write`), which blocks a thread on Kestrel and buffers the whole payload; use the async overload. Code fix awaits it when the method is already async. + +# Blazor +dotnet_diagnostic.PSH1600.severity = error # A delegate captured per iteration inside a component render loop reallocates on every render (measured ~128 B per row per render) and churns the diff; hoist it to a cached delegate or a precomputed per-item model. +dotnet_diagnostic.PSH1601.severity = error # A JavaScript-interop call is issued once per loop iteration; on Interactive Server each is a separate SignalR round-trip. Batch into a single call over the collection. +dotnet_diagnostic.PSH1602.severity = error # `StateHasChanged` is called unconditionally in `OnAfterRender`/`OnAfterRenderAsync`, scheduling another render every time — a runaway loop. Guard it with `firstRender` or a state flag. +dotnet_diagnostic.PSH1603.severity = error # A non-delegate allocation is used as a component-parameter value inside a render loop, allocating per item and forcing the child to re-render each pass. Sibling of PSH1600. ################### -# Public API surface tracking (PASxxxx) -# PAS0001/PAS0002/PAS0003/PAS0005 are errors by default and need no entry here. +# SecuritySharp Analyzers (SES) +################### +# Every rule is raised to error, including the three that ship at suggestion (SES1403, SES1506, +# SES1605). Security rules only ever suggest an API they can resolve in the compilation and report +# local shapes only - there is no interprocedural taint tracking, so the taint-flow CA rules stay on. +# securitysharp.SES1003.iterations = 100000 # minimum accepted PBKDF2 iteration count +# securitysharp.SES1403.maxdepth = 64 # highest accepted System.Text.Json MaxDepth + +# Cryptography +dotnet_diagnostic.SES1001.severity = error # AEAD encryption must not use a constant or reused nonce +dotnet_diagnostic.SES1002.severity = error # Password-based key derivation must not use a constant or predictable salt +dotnet_diagnostic.SES1003.severity = error # Password-based key derivation must use a sufficient iteration count +dotnet_diagnostic.SES1004.severity = error # A secret must not be produced from Guid.NewGuid() +dotnet_diagnostic.SES1005.severity = error # Compare secret values in constant time +dotnet_diagnostic.SES1006.severity = error # A Data Protection key ring is persisted without a ProtectKeysWith call, so keys sit unencrypted at rest +dotnet_diagnostic.SES1007.severity = error # A cryptographic primitive is implemented by hand instead of using a vetted platform algorithm +dotnet_diagnostic.SES1008.severity = error # An XML signature is verified with the no-key CheckSignature overload, trusting the document's own KeyInfo +dotnet_diagnostic.SES1009.severity = error # A password is stored without a slow, salted key-derivation function + +# Transport +dotnet_diagnostic.SES1102.severity = error # Do not accept any server certificate +dotnet_diagnostic.SES1104.severity = error # Certificate-chain validation must not be deliberately weakened +dotnet_diagnostic.SES1105.severity = error # Bearer and OpenID Connect metadata must not be retrieved over plain HTTP outside development +dotnet_diagnostic.SES1106.severity = error # Do not send HttpClient requests to a cleartext http URL +dotnet_diagnostic.SES1107.severity = error # A SQL connection string weakens transport security via TrustServerCertificate or a disabled Encrypt +dotnet_diagnostic.SES1108.severity = error # A custom server-certificate validation callback unconditionally returns true, so any certificate is trusted + +# Secrets +dotnet_diagnostic.SES1201.severity = error # Do not hard-code secrets in source +dotnet_diagnostic.SES1202.severity = error # Do not hard-code a credential value +dotnet_diagnostic.SES1203.severity = error # A connection string names a user but supplies an empty or missing password + +# Injection +dotnet_diagnostic.SES1301.severity = error # Do not build a process command line from non-constant string parts +dotnet_diagnostic.SES1302.severity = error # A shell-executed process must not use a non-constant FileName +dotnet_diagnostic.SES1303.severity = error # Regular-expression pattern must not be built from non-constant data +dotnet_diagnostic.SES1304.severity = error # An archive entry name must not build a write path without a containment check +dotnet_diagnostic.SES1305.severity = error # Do not build a storage path from an uploaded file name +dotnet_diagnostic.SES1306.severity = error # Do not compile or execute non-constant C# via the scripting API +dotnet_diagnostic.SES1307.severity = error # Path.GetTempFileName creates a predictable, world-readable temporary file +dotnet_diagnostic.SES1308.severity = error # A file or directory is created group- or world-writable +dotnet_diagnostic.SES1309.severity = error # An XSLT stylesheet is loaded with embedded script enabled +dotnet_diagnostic.SES1310.severity = error # A directory bind is performed without authenticating + +# Serialization +dotnet_diagnostic.SES1401.severity = error # A type resolved from non-constant data must not be instantiated or deserialized +dotnet_diagnostic.SES1402.severity = error # Do not load an assembly from raw bytes or a non-constant location +dotnet_diagnostic.SES1403.severity = error # JSON deserialization depth limit must stay within a safe ceiling +dotnet_diagnostic.SES1404.severity = error # A type is instantiated by name from a non-constant Activator typeName +dotnet_diagnostic.SES1405.severity = error # MessagePack typeless deserialization reconstructs whatever type the payload names +dotnet_diagnostic.SES1406.severity = error # Reflection must not reach non-public members via BindingFlags.NonPublic (opt-in; replaces S3011) + +# Web hardening +dotnet_diagnostic.SES1501.severity = error # A CORS policy must not allow credentials together with any origin +dotnet_diagnostic.SES1502.severity = error # A CORS origin predicate must not unconditionally allow every origin +dotnet_diagnostic.SES1503.severity = error # JWT signature verification must not be disabled on TokenValidationParameters +dotnet_diagnostic.SES1504.severity = error # A cookie with SameSite=None must be marked Secure +dotnet_diagnostic.SES1505.severity = error # The request body size limit must not be removed +dotnet_diagnostic.SES1506.severity = error # The developer exception page must be guarded by a development-environment check +dotnet_diagnostic.SES1507.severity = error # AllowAnonymous and Authorize on the same declaration conflict +dotnet_diagnostic.SES1508.severity = error # A validation method must not fail open by returning success from a catch +dotnet_diagnostic.SES1509.severity = error # A backtracking-prone constant regex runs without a match timeout or NonBacktracking +dotnet_diagnostic.SES1510.severity = error # A controller redirects to a non-constant URL, allowing an open redirect +dotnet_diagnostic.SES1511.severity = error # The forwarded-headers trust boundary is cleared, letting proxies spoof the client IP +dotnet_diagnostic.SES1512.severity = error # Sensitive framework diagnostics are enabled without a development-environment guard +dotnet_diagnostic.SES1513.severity = error # An AuthorizeAsync result is discarded, so the guarded operation runs regardless +dotnet_diagnostic.SES1514.severity = error # OpenID Connect protections (PKCE, state, nonce) are disabled +dotnet_diagnostic.SES1515.severity = error # A Content-Security-Policy value disables its own protection + +# AI trust boundaries +dotnet_diagnostic.SES1601.severity = error # An LLM system prompt must be a constant, trusted template +dotnet_diagnostic.SES1602.severity = error # Do not route AI model output into a process, file, or raw SQL sink +dotnet_diagnostic.SES1603.severity = error # An AI tool declared read-only or non-destructive must not call a state-changing API +dotnet_diagnostic.SES1604.severity = error # Prompt-template input encoding must not be disabled +dotnet_diagnostic.SES1605.severity = error # AI instrumentation must not enable sensitive-data capture +dotnet_diagnostic.SES1606.severity = error # Do not fetch model weights over cleartext HTTP + +# Web UI trust boundaries +dotnet_diagnostic.SES1701.severity = error # Raw HTML is rendered from a non-constant value (`MarkupString`/`AddMarkupContent`), bypassing automatic encoding — an XSS risk. Sanitizer allow-list via `securitysharp.SES1701.sanitizers`. +dotnet_diagnostic.SES1702.severity = error # A JavaScript-interop call targets a script-evaluation primitive (`eval`, `Function`, `document.write`), turning interop into a script-injection channel. +dotnet_diagnostic.SES1703.severity = error # `[Authorize]` on a non-routable component enforces nothing — authorization runs as a routing concern. Exempt types via `securitysharp.SES1703.exempt_types`. +dotnet_diagnostic.SES1704.severity = error # `IHttpContextAccessor` or a cascading `HttpContext` is used in an interactively-rendered component, where it is null or frozen at circuit start. +dotnet_diagnostic.SES1705.severity = error # `NavigationManager.NavigateTo` is called with a target that is not a verified relative URL — an open-redirect risk. Validator allow-list via `securitysharp.SES1705.validators`. +dotnet_diagnostic.SES1706.severity = error # An uploaded file is read with an unbounded or client-chosen size limit, letting an attacker fill server memory. Threshold via `securitysharp.SES1706.max_bytes`. +dotnet_diagnostic.SES1707.severity = error # A secret-shaped literal appears in code reachable as WebAssembly, which downloads to the browser in full — guaranteed disclosure. +dotnet_diagnostic.SES1708.severity = error # `CircuitOptions.DetailedErrors` is enabled, shipping server exception detail to every connected client. +dotnet_diagnostic.SES1709.severity = error # `SerializeAllClaims` serializes every claim into client-readable WebAssembly authentication state, exposing internal ids, tokens, and PII. +dotnet_diagnostic.SES1710.severity = error # Antiforgery validation is disabled on a form (`[RequireAntiforgeryToken(required: false)]`), removing CSRF protection. +dotnet_diagnostic.RS0016.severity = error # public symbol missing from the PublicAPI baseline +dotnet_diagnostic.RS0017.severity = error # PublicAPI baseline entry no longer in source + + +################### +# Public API surface tracking (PAS) ################### -dotnet_diagnostic.PAS0004.severity = warning # no public API baseline for this target framework +# PAS0001/PAS0002/PAS0003/PAS0005 are errors by default and need no entry here. +dotnet_diagnostic.PAS0004.severity = error # no public API baseline for this target framework ################### -# Trimming Analyzer Warnings (IL2001 - IL2123) -# See: https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-warnings/ +# Microsoft.NET.ILLink.Analyzers (IL) ################### +# Trimming +# See: https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-warnings/ dotnet_diagnostic.IL2001.severity = error # Type in UnreferencedCode attribute doesn't have matching RequiresUnreferencedCode dotnet_diagnostic.IL2002.severity = error # Method with RequiresUnreferencedCode called from code without that attribute dotnet_diagnostic.IL2003.severity = error # RequiresUnreferencedCode attribute is only supported on methods @@ -1804,10 +2143,8 @@ dotnet_diagnostic.IL2117.severity = error # Methods with DynamicallyAccessedMemb dotnet_diagnostic.IL2122.severity = error # Reflection call to method with UnreferencedCode attribute cannot be statically analyzed dotnet_diagnostic.IL2123.severity = error # DynamicallyAccessedMembers on method or parameter doesn't match overridden member -################### -# AOT Analyzer Warnings (IL3xxx) +# Native AOT # See: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/warnings/ -################### dotnet_diagnostic.IL3050.severity = error # Using member annotated with RequiresDynamicCode dotnet_diagnostic.IL3051.severity = error # RequiresDynamicCode attribute is only supported on methods and constructors dotnet_diagnostic.IL3052.severity = error # RequiresDynamicCode attribute on type is not supported @@ -1818,830 +2155,472 @@ dotnet_diagnostic.IL3056.severity = error # MakeGenericMethod on non-supported m dotnet_diagnostic.IL3057.severity = error # Reflection access to generic parameter requires dynamic code ################### -# SonarAnalyzer (Sxxxx) - Blocker Bug -################### -dotnet_diagnostic.S1048.severity = none # Finalizers should not throw exceptions — covered by SST1485 -dotnet_diagnostic.S2190.severity = none # Loops and recursions should not be infinite -dotnet_diagnostic.S2275.severity = none # Composite format strings should not lead to unexpected behavior at runtime - DUPLICATE CA2241 -dotnet_diagnostic.S2857.severity = none # SQL keywords should be delimited by whitespace — covered by SST2470 -dotnet_diagnostic.S2930.severity = none # "IDisposables" should be disposed — covered by SST2410 -dotnet_diagnostic.S2931.severity = none # Classes with "IDisposable" members should implement "IDisposable" — covered by SST2315 -dotnet_diagnostic.S3464.severity = none # Type inheritance should not be recursive — covered by SST2437 -dotnet_diagnostic.S3869.severity = none # "SafeHandle.DangerousGetHandle" should not be called -> replaced by SST2484 -dotnet_diagnostic.S3889.severity = none # "Thread.Resume" and "Thread.Suspend" should not be used -> replaced by obsolete or compiler -dotnet_diagnostic.S4159.severity = none # Classes should implement their "ExportAttribute" interfaces — covered by SST2472 - -################### -# SonarAnalyzer (Sxxxx) - Critical Bug -################### -dotnet_diagnostic.S2551.severity = none # Shared resources should not be used for locking — covered by SST1902 -dotnet_diagnostic.S2952.severity = none # Classes should "Dispose" of members from the classes' own "Dispose" methods -> replaced by SST2315 -dotnet_diagnostic.S3449.severity = none # Right operands of shift operators should be integers -> replaced by SST1478 -dotnet_diagnostic.S4275.severity = none # Getters and setters should access the expected fields — covered by SST2422 -dotnet_diagnostic.S4277.severity = none # "Shared" parts should not be created with "new" — covered by SST2473 -dotnet_diagnostic.S4583.severity = none # Calls to delegate's method "BeginInvoke" should be paired with calls to "EndInvoke" -> replaced by obsolete (APM BeginInvoke/EndInvoke) -dotnet_diagnostic.S4586.severity = none # Non-async "Task/Task" methods should not return null — covered by PSH1312 -dotnet_diagnostic.S5856.severity = none # Regular expressions should be syntactically valid — covered by SST2444 -dotnet_diagnostic.S6674.severity = none # Log message template should be syntactically correct — covered by SST2441 - -################### -# SonarAnalyzer (Sxxxx) - Major Bug -################### -dotnet_diagnostic.S1244.severity = none # Floating point numbers should not be tested for equality — covered by SST1473 -dotnet_diagnostic.S1656.severity = none # Variables should not be self-assigned — covered by SST1189 -dotnet_diagnostic.S1751.severity = none # Loops with at most one iteration should be refactored - covered by SST1444 -dotnet_diagnostic.S1764.severity = none # Identical expressions should not be used on both sides of operators — covered by SST1474 -dotnet_diagnostic.S1848.severity = none # Objects should not be created to be dropped immediately without being used -> replaced by SST1480 -dotnet_diagnostic.S1862.severity = none # Related "if/else if" statements should not have the same condition — covered by SST1475 -dotnet_diagnostic.S2114.severity = none # Collections should not be passed as arguments to their own methods — covered by SST2419 -dotnet_diagnostic.S2123.severity = none # Values should not be uselessly incremented -> replaced by SST2222 -dotnet_diagnostic.S2201.severity = none # Methods without side effects should not have their return values ignored — covered by SST2418 -dotnet_diagnostic.S2225.severity = none # "ToString()" method should not return null — covered by SST2431 -dotnet_diagnostic.S2251.severity = none # A "for" loop update clause should move the counter in the right direction — covered by SST2412 -dotnet_diagnostic.S2252.severity = none # For-loop conditions should be true at least once — covered by SST2413 -dotnet_diagnostic.S2445.severity = none # Blocks should be synchronized on read-only fields — covered by SST1904 -dotnet_diagnostic.S2688.severity = none # "NaN" should not be used in comparisons — covered by SST1473 -dotnet_diagnostic.S2757.severity = none # Non-existent operators like "=+" should not be used — covered by SST2417 -dotnet_diagnostic.S2761.severity = none # Doubled prefix operators "!!" and "~~" should not be used — covered by SST1190 -dotnet_diagnostic.S2995.severity = none # "Object.ReferenceEquals" should not be used for value types -> replaced by CA2013 -dotnet_diagnostic.S2996.severity = none # "ThreadStatic" fields should not be initialized -> replaced by CA2019 -dotnet_diagnostic.S2997.severity = none # "IDisposables" created in a "using" statement should not be returned — covered by SST2423 -dotnet_diagnostic.S3005.severity = none # "ThreadStatic" should not be used on non-static fields -> replaced by CA2259 -dotnet_diagnostic.S3168.severity = none # "async" methods should not return "void" — covered by SST1905 -dotnet_diagnostic.S3172.severity = none # Delegates should not be subtracted — covered by SST2448 -dotnet_diagnostic.S3244.severity = none # Anonymous delegates should not be used to unsubscribe from Events — covered by SST2449 -dotnet_diagnostic.S3249.severity = none # Covered by SST1447 (canonical) -dotnet_diagnostic.S3263.severity = none # Static fields should appear in the order they must be initialized — covered by SST2428 -dotnet_diagnostic.S3343.severity = none # Caller information parameters should come at the end of the parameter list — covered by SST2433 -dotnet_diagnostic.S3346.severity = none # Expressions used in "Debug.Assert" should not produce side effects — covered by SST2450 -dotnet_diagnostic.S3453.severity = none # Classes should not have only "private" constructors — covered by SST2451 -dotnet_diagnostic.S3466.severity = none # Optional parameters should be passed to "base" calls — covered by SST2425 -dotnet_diagnostic.S3598.severity = none # One-way "OperationContract" methods should have "void" return type -> replaced by obsolete (WCF) -dotnet_diagnostic.S3603.severity = none # Methods with "Pure" attribute should return a value — covered by SST2452 -dotnet_diagnostic.S3610.severity = none # Nullable type comparison should not be redundant -> replaced by compiler CS0472 -dotnet_diagnostic.S3903.severity = none # Types should be defined in named namespaces — covered by SST2312 -dotnet_diagnostic.S3923.severity = none # All branches in a conditional structure should not have exactly the same implementation — covered by SST1476 -dotnet_diagnostic.S3926.severity = none # Deserialization methods should be provided for "OptionalField" members -> replaced by obsolete (legacy binary serialization) -dotnet_diagnostic.S3927.severity = none # Serialization event handlers should be implemented correctly — covered by SST2430 -dotnet_diagnostic.S3981.severity = none # Collection sizes and array length comparisons should make sense — covered by SST1479 -dotnet_diagnostic.S3984.severity = none # Exceptions should not be created without being thrown — covered by SST1480 -dotnet_diagnostic.S4143.severity = none # Collection elements should not be replaced unconditionally — covered by SST1487 -dotnet_diagnostic.S4210.severity = none # Windows Forms entry points should be marked with STAThread -> replaced by SST2706 -dotnet_diagnostic.S4260.severity = none # "ConstructorArgument" parameters should exist in constructors -> replaced by SST2487 -dotnet_diagnostic.S4428.severity = none # "PartCreationPolicyAttribute" should be used with "ExportAttribute" — covered by SST2474 -dotnet_diagnostic.S6507.severity = none # Blocks should not be synchronized on local variables — covered by SST1903 -dotnet_diagnostic.S6677.severity = none # Message template placeholders should be unique — covered by SST2442 -dotnet_diagnostic.S6797.severity = none # Blazor query parameter type should be supported -> replaced by SST2702 -dotnet_diagnostic.S6798.severity = none # [JSInvokable] attribute should only be used on public methods -> replaced by SST2701 -dotnet_diagnostic.S6800.severity = none # Component parameter type should match the route parameter type constraint -> replaced by SST2703 -dotnet_diagnostic.S6930.severity = none # Backslash should be avoided in route templates -> replaced by SST2700 - -################### -# SonarAnalyzer (Sxxxx) - Minor Bug -################### -dotnet_diagnostic.S1206.severity = none # "Equals(Object)" and "GetHashCode()" should be overridden in pairs - DUPLICATE CA2218 -dotnet_diagnostic.S1226.severity = none # Method parameters, caught exceptions and foreach variables' initial values should not be ignored -dotnet_diagnostic.S2183.severity = none # Integral numbers should not be shifted by zero or more than their number of bits-1 — covered by SST1478 -dotnet_diagnostic.S2184.severity = none # Results of integer division should not be assigned to floating point variables — covered by SST1477 -dotnet_diagnostic.S2328.severity = none # "GetHashCode" should not reference mutable fields — covered by SST1482 -dotnet_diagnostic.S2345.severity = none # Flags enumerations should explicitly initialize all their members — covered by SST2303 -dotnet_diagnostic.S2674.severity = none # The length returned from a stream read should be checked — covered by SST2446 -dotnet_diagnostic.S2934.severity = none # Property assignments should not be made for "readonly" fields not constrained to reference types — covered by SST2421 -dotnet_diagnostic.S2955.severity = none # Generic parameters not constrained to reference types should not be compared to "null" -> replaced by compiler CS0019/CS0037 -dotnet_diagnostic.S3363.severity = none # Date and time should not be used as a type for primary keys — covered by SST2475 -dotnet_diagnostic.S3397.severity = none # "base.Equals" should not be used to check for reference equality in "Equals" if "base" is not "object" — covered by SST2435 -dotnet_diagnostic.S3456.severity = none # "string.ToCharArray()" and "ReadOnlySpan.ToArray()" should not be called redundantly — covered by PSH1217 -dotnet_diagnostic.S3887.severity = none # Mutable, non-private fields should not be "readonly" — covered by SST2322 - -################### -# SonarAnalyzer (Sxxxx) - Blocker Vulnerability -################### -dotnet_diagnostic.S2115.severity = none # A secure password should be used when connecting to a database -> replaced by SES1203 -dotnet_diagnostic.S2755.severity = none # XML parsers should not be vulnerable to XXE attacks -> replaced by CA3075 -dotnet_diagnostic.S3884.severity = none # "CoSetProxyBlanket" and "CoInitializeSecurity" should not be used -> replaced by obsolete (COM interop security) -dotnet_diagnostic.S6418.severity = none # Secrets should not be hard-coded — covered by SES1201 - -################### -# SonarAnalyzer (Sxxxx) - Critical Vulnerability -################### -dotnet_diagnostic.S4423.severity = none # Weak SSL/TLS protocols should not be used -> replaced by CA5397/CA5398 -dotnet_diagnostic.S4426.severity = none # Cryptographic keys should be robust -> replaced by CA5385 (RSA) / CA5384 (DSA) -dotnet_diagnostic.S4433.severity = none # LDAP connections should be authenticated -> replaced by SES1310 -dotnet_diagnostic.S4830.severity = none # Server certificates should be verified during SSL/TLS connections -> replaced by SES1102 or SES1108 -dotnet_diagnostic.S5344.severity = none # Passwords should not be stored in plaintext or with a fast hashing algorithm -> replaced by SES1009 -dotnet_diagnostic.S5445.severity = none # Insecure temporary file creation methods should not be used -> replaced by SES1307 -dotnet_diagnostic.S5542.severity = none # Encryption algorithms should be used with secure mode and padding scheme -> replaced by CA5358 -dotnet_diagnostic.S5547.severity = none # Cipher algorithms should be robust -> replaced by CA5351 -dotnet_diagnostic.S5659.severity = none # JWT should be signed and verified with strong cipher algorithms -> replaced by SES1503 - -################### -# SonarAnalyzer (Sxxxx) - Major Vulnerability -################### -dotnet_diagnostic.S2068.severity = none # Credentials should not be hard-coded -> replaced by SES1201 -dotnet_diagnostic.S2612.severity = none # File permissions should not be set to world-accessible values -> replaced by SES1308 -dotnet_diagnostic.S4211.severity = none # Members should not have conflicting transparency annotations -> replaced by obsolete (Code Access Security) -dotnet_diagnostic.S4212.severity = none # Serialization constructors should be secured -> replaced by obsolete (Code Access Security) -dotnet_diagnostic.S6377.severity = none # XML signatures should be validated securely -> replaced by SES1008 -dotnet_diagnostic.S7039.severity = none # Content Security Policies should be restrictive -> replaced by SES1515 - -################### -# SonarAnalyzer (Sxxxx) - Blocker Code Smell -################### -dotnet_diagnostic.S1147.severity = none # Exit methods should not be called — covered by SST2321 -dotnet_diagnostic.S1451.severity = none # Track lack of copyright and license headers -dotnet_diagnostic.S2178.severity = none # Short-circuit logic should be used in boolean contexts — covered by SST2415 -dotnet_diagnostic.S2187.severity = none # Test classes should contain at least one test case — covered by SST2504 -dotnet_diagnostic.S2306.severity = none # "async" and "await" should not be used as identifiers -> replaced by compiler (contextual keyword) -dotnet_diagnostic.S2368.severity = none # Public methods should not have multidimensional array parameters — jagged arrays are the chosen layout for hot-path lookup tables -dotnet_diagnostic.S2387.severity = none # Child class fields should not shadow parent class fields — covered by SST1484 -dotnet_diagnostic.S2437.severity = none # Unnecessary bit operations should not be performed — covered by SST1481 -dotnet_diagnostic.S2699.severity = none # Tests should include assertions -> replaced by SST2500 -dotnet_diagnostic.S2953.severity = none # Methods named "Dispose" should implement "IDisposable.Dispose" — covered by SST2316 -dotnet_diagnostic.S2970.severity = none # Assertions should be complete -> replaced by SST2508 -dotnet_diagnostic.S3060.severity = none # "is" should not be used with "this" -> replaced by SST2327 -dotnet_diagnostic.S3237.severity = none # "value" contextual keyword should be used — covered by SST2429 -dotnet_diagnostic.S3427.severity = none # Method overloads with default parameter values should not overlap — covered by SST2319 -dotnet_diagnostic.S3433.severity = none # Test method signatures should be correct -> replaced by SST2509 -dotnet_diagnostic.S3443.severity = none # Type should not be examined on "System.Type" instances — covered by SST2432 -dotnet_diagnostic.S3875.severity = none # "operator==" should not be overloaded on reference types -> replaced by SST2464 -dotnet_diagnostic.S3877.severity = none # Exceptions should not be thrown from unexpected methods — covered by SST1485 -dotnet_diagnostic.S4462.severity = none # Calls to "async" methods should not be blocking - covered by PSH1315 -dotnet_diagnostic.S6422.severity = none # Calls to "async" methods should not be blocking in Azure Functions — covered by PSH1315 -dotnet_diagnostic.S6424.severity = none # Interfaces for durable entities should satisfy the restrictions -> off: Durable Entity-specific; not used in this library - -################### -# SonarAnalyzer (Sxxxx) - Critical Code Smell -################### -dotnet_diagnostic.S1006.severity = none # Method overrides should not change parameter defaults — covered by SST2424 -dotnet_diagnostic.S1067.severity = none # Expressions should not be too complex -dotnet_diagnostic.S1163.severity = none # Exceptions should not be thrown in finally blocks -> replaced by CA2219 -dotnet_diagnostic.S1186.severity = none # Methods should not be empty — covered by SST1438 -dotnet_diagnostic.S121.severity = none # Control structures should use curly braces (kept over SA1503 — Sonar 20ms vs SA1503 50ms) -> replaced by SST1503 -dotnet_diagnostic.S1215.severity = none # "GC.Collect" should not be called — covered by PSH1021 -dotnet_diagnostic.S126.severity = none # "if ... else if" constructs should end with "else" clauses -dotnet_diagnostic.S131.severity = none # "switch/Select" statements should contain a "default/Case Else" clauses -dotnet_diagnostic.S134.severity = none # Control flow statements "if", "switch", "for", "foreach", "while", "do" and "try" should not be nested too deeply -dotnet_diagnostic.S1541.severity = none # Methods and properties should not be too complex - covered by SST1442 -dotnet_diagnostic.S1699.severity = none # Constructors should only call non-overridable methods — covered by SST1483 -dotnet_diagnostic.S1821.severity = none # "switch" statements should not be nested -> replaced by SST2252 -dotnet_diagnostic.S1944.severity = none # Invalid casts should be avoided -> replaced by compiler CS0030 -dotnet_diagnostic.S1994.severity = none # "for" loop increment clauses should modify the loops' counters — covered by SST2411 -dotnet_diagnostic.S2197.severity = none # Modulus results should not be checked for direct equality — covered by SST2416 -dotnet_diagnostic.S2198.severity = none # Unnecessary mathematical comparisons should not be made -> replaced by SST2489 -dotnet_diagnostic.S2223.severity = none # Non-constant static fields should not be visible - DUPLICATE CA2211 -dotnet_diagnostic.S2290.severity = none # Field-like events should not be virtual -> replaced by SST2456 -dotnet_diagnostic.S2291.severity = none # Overflow checking should not be disabled for "Enumerable.Sum" — covered by SST2457 -dotnet_diagnostic.S2302.severity = none # "nameof" should be used — covered by SST1415 -dotnet_diagnostic.S2330.severity = none # Array covariance should not be used — covered by SST2434 -dotnet_diagnostic.S2339.severity = none # Public constant members should not be used — covered by SST2311 -dotnet_diagnostic.S2346.severity = none # Flags enumerations zero-value members should be named "None" - DUPLICATE CA1008 -dotnet_diagnostic.S2360.severity = none # Optional parameters should not be used — conflicts with SST2433, which owns caller-info parameters requiring a default -dotnet_diagnostic.S2365.severity = none # Properties should not make collection or array copies — covered by PSH1017 -dotnet_diagnostic.S2479.severity = none # Whitespace and control characters in string literals should be explicit — covered by SST1192 -dotnet_diagnostic.S2692.severity = none # "IndexOf" checks should not be for positive numbers — covered by SST2420 -dotnet_diagnostic.S2696.severity = none # Instance members should not write to "static" fields -> replaced by SST2402 -dotnet_diagnostic.S2701.severity = none # Literal boolean values should not be used in assertions — covered by SST2503 -dotnet_diagnostic.S3215.severity = none # "interface" instances should not be cast to concrete types -> deliberately unenforced, same reason as SST2326 -dotnet_diagnostic.S3216.severity = none # "ConfigureAwait(false)" should be used -> replaced by CA2007 -dotnet_diagnostic.S3217.severity = none # "Explicit" conversions of "foreach" loops should not be used — covered by SST2225 -dotnet_diagnostic.S3218.severity = none # Inner class members should not shadow outer class "static" or type members — covered by SST1484 -dotnet_diagnostic.S3265.severity = none # Non-flags enums should not be used in bitwise operations — covered by SST2458 -dotnet_diagnostic.S3353.severity = none # Unchanged variables should be marked as "const" — covered by PSH1402 -dotnet_diagnostic.S3447.severity = none # "[Optional]" should not be used on "ref" or "out" parameters — covered by SST2459 -dotnet_diagnostic.S3451.severity = none # "[DefaultValue]" should not be used when "[DefaultParameterValue]" is meant — covered by SST2460 -dotnet_diagnostic.S3600.severity = none # "params" should not be introduced on overrides — covered by SST2426 -dotnet_diagnostic.S3776.severity = none # Cognitive Complexity of methods should not be too high - covered by SST1443 -dotnet_diagnostic.S3871.severity = none # Exception types should be "public" -> replaced by CA1064 -dotnet_diagnostic.S3874.severity = none # "out" and "ref" parameters — repo idiom is TryX(..., out T value) -dotnet_diagnostic.S3904.severity = none # Assemblies should have version information -> replaced by obsolete (SDK supplies assembly version) -dotnet_diagnostic.S3937.severity = none # Number patterns should be regular — covered by SST1119 -dotnet_diagnostic.S3972.severity = none # Conditionals should start on new lines — covered by SST1146 -dotnet_diagnostic.S3973.severity = none # A conditionally executed single line should be denoted by indentation -> replaced by SST1503 -dotnet_diagnostic.S3998.severity = none # Threads should not lock on objects with weak identity -> replaced by SST1902 -dotnet_diagnostic.S4000.severity = none # Pointers to unmanaged memory should not be visible -> replaced by SST2328 -dotnet_diagnostic.S4015.severity = none # Inherited member visibility should not be decreased — covered by SST2462 -dotnet_diagnostic.S4019.severity = none # Base class methods should not be hidden — covered by SST2427 -dotnet_diagnostic.S4025.severity = none # Child class fields should not differ from parent class fields only by capitalization — covered by SST2463 -dotnet_diagnostic.S4039.severity = none # Interface methods should be callable by derived types - DUPLICATE CA1033 -dotnet_diagnostic.S4487.severity = none # Unread "private" fields should be removed -dotnet_diagnostic.S4524.severity = none # "default" clauses should be first or last — covered by SST1219 -dotnet_diagnostic.S4635.severity = none # Start index should be used instead of calling Substring — covered by PSH1218 -dotnet_diagnostic.S5034.severity = none # "ValueTask" should be consumed correctly — covered by PSH1316 -dotnet_diagnostic.S6967.severity = none # ModelState.IsValid should be called in controller actions -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S8367.severity = none # Identifiers should not conflict with the C# 14 "field" contextual keyword - the C# 14 compiler reports this: CS9273 (error) for a local named field in an accessor, CS9258 (warning) for a rebinding read -dotnet_diagnostic.S8368.severity = none # Identifiers should not conflict with the C# 14 "extension" contextual keyword - the C# 14 compiler reports this as CS9306, and SST1300 already flags the lowercase type name -dotnet_diagnostic.S8380.severity = none # Return types named "partial" should be escaped with "@" - the compiler reports this as CS8981, and SST1300 already flags the lowercase type name -dotnet_diagnostic.S8381.severity = none # "scoped" should be escaped when used as an identifier or type name in parenthesized lambda parameter lists -> replaced by compiler -dotnet_diagnostic.S927.severity = none # Parameter names should match base declaration and other partial definitions - DUPLICATE CA1725 - -################### -# SonarAnalyzer (Sxxxx) - Major Code Smell -################### -dotnet_diagnostic.S103.severity = none # Lines should not be too long — covered by SST1521 -dotnet_diagnostic.S104.severity = none # Files should not have too many lines of code — covered by SST1522 -dotnet_diagnostic.S106.severity = none # Covered by SST1449 (canonical) -dotnet_diagnostic.S1066.severity = none # Mergeable "if" statements should be combined — covered by SST2013 -dotnet_diagnostic.S107.severity = none # Methods should not have too many parameters — covered by SST1472 -dotnet_diagnostic.S108.severity = none # Nested blocks of code should not be left empty — covered by SST1439 -dotnet_diagnostic.S109.severity = none # Magic numbers should not be used — covered by SST1471 -dotnet_diagnostic.S110.severity = none # Inheritance tree of classes should not be too deep — covered by SST1446 -dotnet_diagnostic.S1110.severity = none # Redundant pairs of parentheses should be removed — covered by SST1459 -dotnet_diagnostic.S1117.severity = none # Local variables should not shadow class fields or properties — covered by SST1484 -dotnet_diagnostic.S1118.severity = none # Utility classes should not have public constructors - DUPLICATE CA1052 -dotnet_diagnostic.S112.severity = none # General or reserved exceptions should never be thrown — covered by SST2409 -dotnet_diagnostic.S1121.severity = none # Assignments should not be made from within sub-expressions — covered by SST1187 -dotnet_diagnostic.S1123.severity = none # "Obsolete" attributes should include explanations — covered by SST2308 -dotnet_diagnostic.S1134.severity = none # Track uses of "FIXME" tags -> off: TODO comment tracker; not enforced here -dotnet_diagnostic.S1144.severity = none # Covered by SST1440 (canonical) -dotnet_diagnostic.S1151.severity = none # "switch case" clauses should not have too many lines of code — covered by SST1524 -dotnet_diagnostic.S1168.severity = none # Empty arrays and collections should be returned instead of null — covered by SST2306 -dotnet_diagnostic.S1172.severity = none # Unused method parameters should be removed — covered by SST1461 -dotnet_diagnostic.S1200.severity = none # Classes should not be coupled to too many other classes -dotnet_diagnostic.S122.severity = none # Statements should be on separate lines — covered by SST1107 -dotnet_diagnostic.S125.severity = none # Sections of code should not be commented out — covered by SST1148 -dotnet_diagnostic.S127.severity = none # "for" loop stop conditions should be invariant — covered by SST2465 -dotnet_diagnostic.S138.severity = none # Functions should not have too many lines of code — covered by SST1523 -dotnet_diagnostic.S1479.severity = none # "switch" statements with many "case" clauses — covered by SST1423 -dotnet_diagnostic.S1607.severity = none # Tests should not be ignored -> off: ignored-test tracker; not enforced here -dotnet_diagnostic.S1696.severity = none # NullReferenceException should not be caught — covered by SST2401 -dotnet_diagnostic.S1854.severity = none # Unused assignments should be removed - DUPLICATE IDE0059 -dotnet_diagnostic.S1871.severity = none # Two branches in a conditional structure should not have exactly the same implementation — covered by SST2414 -dotnet_diagnostic.S2139.severity = none # Exceptions should be either logged or rethrown but not both -> replaced by SST2488 -dotnet_diagnostic.S2166.severity = none # Classes named like "Exception" should extend "Exception" or a subclass - DUPLICATE CA1710 -dotnet_diagnostic.S2234.severity = none # Arguments should be passed in the same order as the method parameters -> replaced by SST2400 -dotnet_diagnostic.S2326.severity = none # Covered by SST1452 (canonical) -dotnet_diagnostic.S2327.severity = none # "try" statements with identical "catch" and/or "finally" blocks should be merged -> replaced by SST2490 -dotnet_diagnostic.S2357.severity = none # Fields should be private — duplicate of SST1401 (canonical); fields intentionally exposed (e.g. public test fields for reflection) already carry per-site SST1401 suppressions -dotnet_diagnostic.S2372.severity = none # Exceptions should not be thrown from property getters — covered by SST1485 -dotnet_diagnostic.S2376.severity = none # Write-only properties should not be used — covered by SST1421 -dotnet_diagnostic.S2629.severity = none # Logging templates should be constant -> replaced by CA2254 -dotnet_diagnostic.S2681.severity = none # Multiline blocks should be enclosed in curly braces — covered by SST1503 -dotnet_diagnostic.S2743.severity = none # Static fields should not be used in generic types - DUPLICATE CA1000 — covered by SST1431 -dotnet_diagnostic.S2925.severity = none # "Thread.Sleep" should not be used in tests — covered by SST2506 -dotnet_diagnostic.S2933.severity = none # Fields that are only assigned in the constructor should be "readonly" - DUPLICATE IDE0044 -dotnet_diagnostic.S2971.severity = none # LINQ expressions should be simplified — covered by PSH1101/PSH1102 -dotnet_diagnostic.S3010.severity = none # Static fields should not be updated in constructors — covered by SST2402 -dotnet_diagnostic.S3011.severity = none # Reflection should not be used to increase accessibility of classes, methods, or fields -> replaced by SES1406 -dotnet_diagnostic.SES1406.severity = warning # Reflection must not reach non-public members via BindingFlags.NonPublic (opt-in; replaces S3011) - -# RoslynCommonAnalyzers rules added to reach 3.37.0 (on-by-default enforced; opt-in left off) -dotnet_diagnostic.PSH1021.severity = error # An explicit `GC.Collect` or `GC.WaitForPendingFinalizers` call forces collection the runtime tunes itself. -dotnet_diagnostic.PSH1022.severity = error # A parameterless `new EventArgs()` allocates where the shared `EventArgs.Empty` singleton would serve. Code fix uses the singleton. -dotnet_diagnostic.PSH1114.severity = none # Freeze static lookup collections that are never mutated. Opt-in. -dotnet_diagnostic.PSH1226.severity = error # A string's `ToCharArray()` result is only iterated, allocating a throwaway `char[]`; iterate the string directly. Code fix drops the copy. -dotnet_diagnostic.PSH1227.severity = error # A cheaper equivalent exists — `string.CompareOrdinal` over `Compare(…, Ordinal)`, `Debug.Fail` over `Debug.Assert(false, …)`. Info. Code fix rewrites the call. -dotnet_diagnostic.PSH1306.severity = none # Guard one-time execution with an interlocked latch. Opt-in. -dotnet_diagnostic.PSH1309.severity = none # Register cancellation callbacks without flowing the execution context. Opt-in. -dotnet_diagnostic.PSH1316.severity = error # A `ValueTask` is consumed more than once - awaited across loop iterations, or through a copy - so a later consume reads a recycled pooled token. Code fix hoists the producer into the loop. -dotnet_diagnostic.PSH1410.severity = none # Mark trivial forwarders for aggressive inlining. Opt-in. -dotnet_diagnostic.PSH1418.severity = error # A shareable client (`HttpClient` or an Azure SDK service client) is constructed for a single call, so its pooled connections and caches die with it and every call pays the setup cost again. -dotnet_diagnostic.PSH1419.severity = error # A call to the TimeZoneConverter package where the built-in `TimeZoneInfo` now resolves IANA and Windows ids cross-platform (.NET 6+). Code fix rewrites `GetTimeZoneInfo` to `TimeZoneInfo.FindSystemTimeZoneById`. -dotnet_diagnostic.PSH1420.severity = error # A shareable client held in an instance field of an Azure Functions worker class is rebuilt on every invocation, leaking sockets and connections; share a static/singleton client or inject `IHttpClientFactory`. -dotnet_diagnostic.PSH1500.severity = error # A route handler returns `Results.*`; `TypedResults.*` avoids boxing the result and gives the endpoint its response metadata. Code fix rewrites the call. -dotnet_diagnostic.PSH1501.severity = error # Middleware is registered in the legacy `Use(next => context => ...)` nested-delegate form, which allocates a per-request closure; the two-parameter `Use((context, next) => ...)` overload does not. -dotnet_diagnostic.PSH1502.severity = error # A route handler returns a deferred `IEnumerable` (an `IQueryable` or an un-materialized LINQ query), so the response serializer enumerates it synchronously on the request thread. -dotnet_diagnostic.PSH1503.severity = error # The legacy response-caching middleware only honors HTTP cache-control headers; output caching (.NET 7+) caches on the server under keys you control and can be invalidated. Info. -dotnet_diagnostic.PSH1505.severity = error # A class implements an MVC exception filter (`IExceptionFilter`/`IAsyncExceptionFilter`); centralized error handling belongs in an `IExceptionHandler` the pipeline runs once. Info. -dotnet_diagnostic.PSH1506.severity = error # The HTTP request or response body is read or written synchronously (`ReadToEnd`, `Body.Read`, `Body.Write`), which blocks a thread on Kestrel and buffers the whole payload; use the async overload. Code fix awaits it when the method is already async. -dotnet_diagnostic.PSH1600.severity = error # A delegate captured per iteration inside a component render loop reallocates on every render (measured ~128 B per row per render) and churns the diff; hoist it to a cached delegate or a precomputed per-item model. -dotnet_diagnostic.PSH1601.severity = error # A JavaScript-interop call is issued once per loop iteration; on Interactive Server each is a separate SignalR round-trip. Batch into a single call over the collection. -dotnet_diagnostic.PSH1602.severity = error # `StateHasChanged` is called unconditionally in `OnAfterRender`/`OnAfterRenderAsync`, scheduling another render every time — a runaway loop. Guard it with `firstRender` or a state flag. -dotnet_diagnostic.PSH1603.severity = error # A non-delegate allocation is used as a component-parameter value inside a render loop, allocating per item and forcing the child to re-render each pass. Sibling of PSH1600. -dotnet_diagnostic.SES1001.severity = error # AEAD encryption (`AesGcm`/`AesCcm`/`ChaCha20Poly1305`) uses a constant or reused nonce, which is catastrophic under a fixed key. -dotnet_diagnostic.SES1002.severity = error # Password-based key derivation (`Rfc2898DeriveBytes`/`Pbkdf2`) is given a constant or predictable salt, letting an attacker precompute rainbow tables and defeating per-secret salting. -dotnet_diagnostic.SES1003.severity = error # A `Rfc2898DeriveBytes.Pbkdf2` one-shot derives a key with a constant iteration count below the configured floor (default 100000), leaving offline password cracking cheap. -dotnet_diagnostic.SES1004.severity = error # A secret (token, key, password, nonce, salt, session id, OTP, reset token) is minted from `Guid.NewGuid()`; a GUID is an identifier, not a cryptographically strong secret. -dotnet_diagnostic.SES1005.severity = error # A secret (HMAC, signature, tag, token, or hash) is compared with a non-constant-time equality (`==`, `.Equals`, `SequenceEqual`), leaking it a byte at a time through timing. Code fix rewrites a byte-buffer comparison to `CryptographicOperations.FixedTimeEquals`. -dotnet_diagnostic.SES1006.severity = error # A Data Protection key ring is persisted to an explicit repository (`PersistKeysToFileSystem`/`DbContext`/`AzureBlobStorage`/`StackExchangeRedis`/`Registry`) with no `ProtectKeysWith...` call in the same chain, so the keys are stored unencrypted at rest. -dotnet_diagnostic.SES1007.severity = error # A type derives from an abstract cryptographic primitive base (`HashAlgorithm`/`KeyedHashAlgorithm`/`HMAC`/`SymmetricAlgorithm`/`AsymmetricAlgorithm`/`DeriveBytes`) and implements the algorithm by hand; use a vetted platform implementation. Subclassing a concrete algorithm to configure it is not reported. -dotnet_diagnostic.SES1008.severity = error # An XML signature is verified with the no-key `SignedXml.CheckSignature()` overload, which trusts the key embedded in the document's `KeyInfo`, so an attacker can re-sign tampered XML with their own key and still pass; pass a known key or certificate instead. -dotnet_diagnostic.SES1009.severity = error # A password is hashed with a fast general-purpose hash (`MD5`/`SHA-1`/`SHA-256`/`SHA-384`/`SHA-512`) via `HashData`/`ComputeHash` instead of a slow, salted password KDF; a fast hash is cheap to brute-force even when salted. -dotnet_diagnostic.SES1102.severity = error # A read of `HttpClientHandler.DangerousAcceptAnyServerCertificateValidator` disables TLS server-certificate validation, so the client trusts any certificate and the connection is open to man-in-the-middle attacks. -dotnet_diagnostic.SES1104.severity = error # X509 certificate-chain validation is deliberately weakened: `RevocationMode` set to `NoCheck`, or `VerificationFlags` set to a value naming `AllowUnknownCertificateAuthority` or `AllFlags` (alone or OR-combined), so revoked or untrusted certificates are accepted. -dotnet_diagnostic.SES1105.severity = error # Bearer/OpenID Connect metadata is fetched over plain HTTP because `RequireHttpsMetadata` is set to false outside a development-environment guard, exposing token validation to a network attacker. -dotnet_diagnostic.SES1106.severity = error # An `HttpClient` request targets a cleartext `http://` URL literal (a string overload, a `new Uri(...)` argument, or a `BaseAddress` assignment); non-loopback hosts only. -dotnet_diagnostic.SES1107.severity = error # A SQL connection weakens transport security: `TrustServerCertificate=true`, `Encrypt=false`, or `Encrypt=Optional` in a literal connection string or a `SqlConnectionStringBuilder`, bypassing server-certificate validation or transport encryption. -dotnet_diagnostic.SES1108.severity = error # A custom `HttpClientHandler.ServerCertificateCustomValidationCallback` always returns `true` (an expression/block lambda, an anonymous method, or a method group to a source method of that shape), disabling TLS server authentication so the client trusts any certificate. -dotnet_diagnostic.SES1201.severity = error # A string literal hard-codes a recognizable credential (API key, token, private key, or connection-string password), which is committed to source and must be treated as leaked. -dotnet_diagnostic.SES1202.severity = error # A non-empty string literal is hard-coded where a credential is expected (a credential-named parameter or a credential-type constructor), even when its text is not a recognizable secret pattern. -dotnet_diagnostic.SES1203.severity = error # A database connection-string literal names a user but supplies an empty or missing password, a zero-strength credential that lets anyone who can reach the server authenticate as that account. -dotnet_diagnostic.SES1301.severity = error # A process command line is composed from a non-constant interpolated or concatenated string via `ProcessStartInfo.Arguments` (assignment or object initializer) or `Process.Start(fileName, arguments)`; use `ArgumentList` so each argument is escaped. -dotnet_diagnostic.SES1302.severity = error # A `ProcessStartInfo` with `UseShellExecute = true` names a non-constant `FileName` (from the initializer or the constructor argument), so the OS shell resolves a data-derived program: a command-injection and unexpected-program risk. -dotnet_diagnostic.SES1303.severity = error # A regular-expression pattern is built from non-constant data, letting an attacker inject regex metacharacters (alternation, catastrophic backtracking, capture rewriting); reports the pattern argument of the `Regex` constructor and the static `Regex.IsMatch`/`Match`/`Matches`/`Replace`/`Split` overloads. -dotnet_diagnostic.SES1304.severity = error # An archive entry name (`ZipArchiveEntry.FullName` / `TarEntry.Name`) is joined via `Path.Combine` or `+` straight into a file-writing sink with no inline containment check, letting a crafted `../` or absolute entry escape the target directory (zip slip / path traversal). -dotnet_diagnostic.SES1305.severity = error # An uploaded file name (`IFormFile.FileName`) is used to build a storage path -- a `Path.Combine` argument, a `+` path concatenation, or a file-creating call (`File.Create`/`OpenWrite`/`WriteAllBytes`/`Copy`, `new FileStream`) -- enabling path traversal; sanitize with `Path.GetFileName` or use a server-generated name. -dotnet_diagnostic.SES1306.severity = error # Non-constant C# source is compiled and executed via the scripting API (`CSharpScript.EvaluateAsync`/`RunAsync`/`Create`), which is arbitrary code execution; the code channel must be a constant, trusted template rather than runtime data. -dotnet_diagnostic.SES1307.severity = error # `Path.GetTempFileName()` creates a predictable, world-readable temporary file open to a time-of-check/time-of-use race and a 65535-file limit (CWE-377); use `Path.GetRandomFileName()` for an unpredictable name, or `Directory.CreateTempSubdirectory()` (.NET 7+) for an isolated directory. -dotnet_diagnostic.SES1308.severity = error # A file or directory is created group- or world-writable (a `UnixFileMode` including `GroupWrite`/`OtherWrite`, CWE-732), letting other local users tamper with it. -dotnet_diagnostic.SES1309.severity = error # An XSLT stylesheet is loaded via `XslCompiledTransform.Load` with `XsltSettings` that enable embedded script (`EnableScript = true`, a constant `enableScript` constructor argument, or `XsltSettings.TrustedXslt`), letting a stylesheet run arbitrary code in the host process (CWE-95). -dotnet_diagnostic.SES1310.severity = error # A `DirectoryEntry` binds to the directory without proving identity — `AuthenticationTypes.Anonymous`, or an `LDAP://` path bound with an explicitly empty/`null` username and password (CWE-287). -dotnet_diagnostic.SES1401.severity = error # A type resolved from non-constant data via `Type.GetType` is passed inline to `Activator.CreateInstance` or a `Deserialize(Type, ...)` call, letting untrusted input choose which type is instantiated. -dotnet_diagnostic.SES1402.severity = error # An assembly is loaded from raw bytes (`Assembly.Load(byte[])` / `AssemblyLoadContext.LoadFromStream`) or from a non-constant `LoadFrom`/`LoadFile`/`UnsafeLoadFrom` path, running unverifiable code with full process trust. -dotnet_diagnostic.SES1403.severity = error # A constant `System.Text.Json` `MaxDepth` (on `JsonSerializerOptions`/`JsonReaderOptions`/`JsonDocumentOptions`) is raised above a configurable ceiling (default 64), re-opening the deep-nesting stack-exhaustion denial-of-service that the default limit guards against. -dotnet_diagnostic.SES1404.severity = error # A type is instantiated by name through the string overloads of `Activator.CreateInstance`/`Activator.CreateInstanceFrom` from a non-constant `typeName`, letting untrusted input choose which type is constructed (CWE-470). -dotnet_diagnostic.SES1405.severity = error # MessagePack typeless deserialization (`MessagePackSerializer.Typeless`, or a serializer built on `TypelessObjectResolver`/`TypelessContractlessStandardResolver`) reconstructs whatever .NET type the payload names, letting untrusted input instantiate arbitrary types (CWE-502). -dotnet_diagnostic.SES1501.severity = error # A single CORS policy calls both `AllowAnyOrigin()` and `AllowCredentials()` on `CorsPolicyBuilder`; a wildcard origin combined with credentials is rejected by browsers and throws when the policy is applied. -dotnet_diagnostic.SES1502.severity = error # A CORS origin predicate passed to `CorsPolicyBuilder.SetIsOriginAllowed` unconditionally returns true (`_ => true`), allowing every origin -- equivalent to `AllowAnyOrigin` and dangerous with credentials. -dotnet_diagnostic.SES1503.severity = error # JWT signature verification is turned off on `TokenValidationParameters` because `RequireSignedTokens` or `ValidateIssuerSigningKey` is set to false, so a forged or unsigned token passes validation. -dotnet_diagnostic.SES1504.severity = error # A cookie initializer (`CookieOptions`/`CookieBuilder`) sets `SameSite=None` without securing the cookie in the same initializer (`Secure = true`, or a non-`None` `SecurePolicy`), so the browser drops it or it travels over plain HTTP. -dotnet_diagnostic.SES1505.severity = error # The request body size limit is removed -- `[DisableRequestSizeLimit]` on a controller or action, or `MaxRequestBodySize` set to null on `KestrelServerLimits`/`IHttpMaxRequestBodySizeFeature` -- letting a client stream an unbounded upload and exhaust server memory or disk. -dotnet_diagnostic.SES1506.severity = error # The developer exception page (`UseDeveloperExceptionPage`) is enabled without a development-environment guard, so in production it renders full exception detail and stack traces to the client. -dotnet_diagnostic.SES1507.severity = error # A single method or type declaration carries both `[AllowAnonymous]` and `[Authorize]`; the anonymous marker wins at runtime, so the co-located `[Authorize]` is dead and the endpoint is unauthenticated. -dotnet_diagnostic.SES1508.severity = error # A validation/verification method (`bool`/`Task` named `Validate`/`Verify`/`Authenticate`/`Authorize`/`Check`/`IsValid`/`IsAuthentic`/`Ensure`) fails open: a `catch` swallows a broad or security-relevant exception and returns success. -dotnet_diagnostic.SES1509.severity = error # A constant, backtracking-prone regular expression (an unbounded quantifier over a group that itself repeats or alternates, as in `(a+)+` or `(a -dotnet_diagnostic.SES1510.severity = error # A controller (`ControllerBase`) redirects to a non-constant URL via `Redirect`/`RedirectPermanent`/`RedirectPreserveMethod`/`RedirectPermanentPreserveMethod`; an attacker-controlled target is an open redirect (CWE-601) to a phishing site — validate the URL is local (e.g. `LocalRedirect`). -dotnet_diagnostic.SES1511.severity = error # The forwarded-headers trust boundary is removed — `.Clear()` on `KnownProxies`/`KnownNetworks`/`KnownIPNetworks`, or `ForwardLimit` set to null — so untrusted proxies can spoof the client IP, host, and scheme via `X-Forwarded-*` headers (CWE-348). -dotnet_diagnostic.SES1512.severity = error # Sensitive framework diagnostics — EF Core `EnableSensitiveDataLogging()`, or `IdentityModelEventSource.ShowPII`/`LogCompleteSecurityArtifact = true` — are enabled without a development-environment guard, so parameter values, PII, and full tokens land in production logs (CWE-215/532). -dotnet_diagnostic.SES1513.severity = error # An `IAuthorizationService.AuthorizeAsync` call discards its `AuthorizationResult` (a bare await or `_ =`), so nothing reads `Succeeded` and the guarded operation runs whether or not authorization passed (CWE-863). -dotnet_diagnostic.SES1514.severity = error # OpenID Connect protocol protections are disabled — `UsePkce`, `RequireState`, `RequireStateValidation`, or `RequireNonce` set to false — weakening the authorization-code flow against CSRF and replay (CWE-352/294). -dotnet_diagnostic.SES1515.severity = error # A `Content-Security-Policy` value carries `'unsafe-inline'`, `'unsafe-eval'`, or a bare `*` source on a `default-src`/`script-src`/`style-src`/`object-src`/`base-uri` directive, re-permitting injected inline scripts and defeating the header's XSS protection (CWE-1021/79). -dotnet_diagnostic.SES1601.severity = error # An LLM system-role message (`Microsoft.Extensions.AI` `ChatMessage(ChatRole.System, ...)`, or Semantic Kernel `ChatHistory.AddSystemMessage`/`AddMessage(AuthorRole.System, ...)`/`ChatMessageContent(AuthorRole.System, ...)`) is given non-constant content; runtime or user data in the instruction channel is a prompt-injection risk. -dotnet_diagnostic.SES1602.severity = error # AI model output (`ChatResponse`/`ChatMessage` `.Text`) flows inline into a dangerous sink (a process start, a scripting call, a raw SQL command, or a `File` path); executing or evaluating model output is a prompt-injection-to-code-execution path. -dotnet_diagnostic.SES1603.severity = error # A model-facing tool declared read-only (`ReadOnly = true`) or non-destructive (`Destructive = false`) via `[McpServerTool]` calls a state-changing API in its body (a file delete or overwrite, a directory delete, a process start, an ADO.NET non-query, an EF bulk mutation, or `SaveChanges`), so a host may auto-invoke it and cause irreversible damage. -dotnet_diagnostic.SES1604.severity = error # A Semantic Kernel prompt template disables the default encoding of substituted input by setting `AllowDangerouslySetContent = true` on `PromptTemplateConfig`/`InputVariable`/a template factory, re-opening prompt injection through template variables. -dotnet_diagnostic.SES1605.severity = error # Sensitive AI telemetry capture is enabled (`EnableSensitiveData = true`) on a `Microsoft.Extensions.AI` OpenTelemetry instrumentation client, shipping raw prompts and model responses -- which routinely carry secrets and PII -- verbatim to the telemetry backend. -dotnet_diagnostic.SES1606.severity = error # A string literal targets a model-weights file (`.onnx`, `.gguf`, `.safetensors`, `.pt`, `.pth`, `.ckpt`) over a cleartext `http://` URL, letting a network attacker swap in a tampered or backdoored model; non-loopback hosts only, and the `HttpClient`-sink case is left to SES1106. -dotnet_diagnostic.SES1701.severity = error # Raw HTML is rendered from a non-constant value (`MarkupString`/`AddMarkupContent`), bypassing automatic encoding — an XSS risk. Sanitizer allow-list via `securitysharp.SES1701.sanitizers`. -dotnet_diagnostic.SES1702.severity = error # A JavaScript-interop call targets a script-evaluation primitive (`eval`, `Function`, `document.write`), turning interop into a script-injection channel. -dotnet_diagnostic.SES1703.severity = error # `[Authorize]` on a non-routable component enforces nothing — authorization runs as a routing concern. Exempt types via `securitysharp.SES1703.exempt_types`. -dotnet_diagnostic.SES1704.severity = error # `IHttpContextAccessor` or a cascading `HttpContext` is used in an interactively-rendered component, where it is null or frozen at circuit start. -dotnet_diagnostic.SES1705.severity = error # `NavigationManager.NavigateTo` is called with a target that is not a verified relative URL — an open-redirect risk. Validator allow-list via `securitysharp.SES1705.validators`. -dotnet_diagnostic.SES1706.severity = error # An uploaded file is read with an unbounded or client-chosen size limit, letting an attacker fill server memory. Threshold via `securitysharp.SES1706.max_bytes`. -dotnet_diagnostic.SES1707.severity = error # A secret-shaped literal appears in code reachable as WebAssembly, which downloads to the browser in full — guaranteed disclosure. -dotnet_diagnostic.SES1708.severity = error # `CircuitOptions.DetailedErrors` is enabled, shipping server exception detail to every connected client. -dotnet_diagnostic.SES1709.severity = error # `SerializeAllClaims` serializes every claim into client-readable WebAssembly authentication state, exposing internal ids, tokens, and PII. -dotnet_diagnostic.SES1710.severity = error # Antiforgery validation is disabled on a form (`[RequireAntiforgeryToken(required: false)]`), removing CSRF protection. -dotnet_diagnostic.SST1101.severity = none # see docs/rules/SST1101.md -dotnet_diagnostic.SST1119.severity = error # A numeric literal's digit separators group its digits irregularly. Code fix regroups them evenly. -dotnet_diagnostic.SST1138.severity = error # A free-standing block declares nothing and only nests its statements. Code fix splices them into the enclosing block. -dotnet_diagnostic.SST1219.severity = error # A `switch` statement's `default` section is not last. Code fix moves it to the end. -dotnet_diagnostic.SST1220.severity = error # An all-named argument list is in a different order than the parameters. Code fix reorders it to declaration order. Info. -dotnet_diagnostic.SST1221.severity = error # `where` constraint clauses are not ordered to match the type-parameter list. Code fix reorders them. Info. -dotnet_diagnostic.SST1320.severity = error # A method parameter's name is identical to its containing method's name. -dotnet_diagnostic.SST1321.severity = error # A method whose name ends in `Async` returns nothing awaitable — the inverse of SST1317. Code fix (rename) drops the suffix. -dotnet_diagnostic.SST1434.severity = error # see docs/rules/SST1434.md -dotnet_diagnostic.SST1525.severity = error # A multi-statement `switch` section has no braces; the braces-on policy extends to switch sections. Code fix wraps it. -dotnet_diagnostic.SST1526.severity = none # A wrapped binary expression places the operator inconsistently. Configurable (`before`/`after`, default before). Opt-in. -dotnet_diagnostic.SST1527.severity = none # The `=>` of an expression-bodied member wraps inconsistently. Configurable. Opt-in. -dotnet_diagnostic.SST1528.severity = none # The `=` of a wrapped initializer wraps inconsistently. Configurable. Opt-in. -dotnet_diagnostic.SST1529.severity = none # A wrapped `?.`/`.` call chain places the break inconsistently. Configurable. Opt-in. -dotnet_diagnostic.SST1530.severity = none # A newline sits between a type declaration and its base list. Code fix pulls the base list onto the declaration line. Opt-in. -dotnet_diagnostic.SST1531.severity = none # A short object initializer is split across lines. Code fix collapses it when it fits. Opt-in. -dotnet_diagnostic.SST1532.severity = none # A file mixes line endings. Configurable (`lf`/`crlf`, default lf). Opt-in. -dotnet_diagnostic.SST1533.severity = none # A source file contains no code. Opt-in. -dotnet_diagnostic.SST1660.severity = error # The `` tags are not in parameter order. Code fix reorders them. Info. -dotnet_diagnostic.SST1661.severity = error # A snippet uses ``/`` mismatched to single- vs multi-line content. Code fix swaps the tag. Info. -dotnet_diagnostic.SST1662.severity = none # A thrown exception type has no `` documentation. Code fix adds the skeleton. Opt-in. -dotnet_diagnostic.SST1663.severity = none # A `//` comment before a public member reads like a summary; use `///`. Code fix converts it. Opt-in. -dotnet_diagnostic.SST1664.severity = none # A summary separates paragraphs with blank lines instead of ``. Code fix wraps them. Opt-in. -dotnet_diagnostic.SST1708.severity = error # An extension method never uses its `this` receiver, so it need not be an extension. -dotnet_diagnostic.SST1709.severity = none # A method in a `*Extensions` class whose first parameter lacks `this`. Code fix converts it to an extension block. Opt-in. -dotnet_diagnostic.SST1804.severity = error # A positional record has an empty `{ }` body where `;` would do. Code fix rewrites it. Info. -dotnet_diagnostic.SST1900.severity = error # see docs/rules/SST1900.md -dotnet_diagnostic.SST1904.severity = error # A lock targets a non-readonly field, which a later assignment can swap out from under a caller. Code fix makes it readonly. -dotnet_diagnostic.SST1905.severity = error # An `async void` method, lambda, or local function that is not a genuine event handler. Code fix returns `Task`. -dotnet_diagnostic.SST2018.severity = error # A null check sits beside an `is` type pattern that already excludes null. Code fix removes the null check. -dotnet_diagnostic.SST2229.severity = error # see docs/rules/SST2229.md -dotnet_diagnostic.SST2230.severity = error # see docs/rules/SST2230.md -dotnet_diagnostic.SST2233.severity = none # see docs/rules/SST2233.md -dotnet_diagnostic.SST2246.severity = error # A chain of `?:` expressions that tests one value against constants can be a switch expression. Code fix rewrites it. -dotnet_diagnostic.SST2247.severity = error # Consecutive locals that copy one tuple- or `Deconstruct`-able value's members in order should be a deconstruction. Code fix folds them into `var (a, b) = source;`. -dotnet_diagnostic.SST2248.severity = error # Two comparisons of the same value against constants can fold into one `is`-pattern. Code fix rewrites them. -dotnet_diagnostic.SST2249.severity = error # A `string.Format` call with a literal format, or a concatenation of literals with values, reads more clearly as an interpolated string. Code fix rewrites it; a call passing an explicit format provider is left alone so its culture is not dropped. -dotnet_diagnostic.SST2250.severity = error # A bare local declared without a value and assigned once by the next straight-line statement can be joined into an initialized declaration. Code fix joins them. -dotnet_diagnostic.SST2251.severity = error # A method call names type arguments that inference would supply. Code fix removes them. -dotnet_diagnostic.SST2252.severity = error # A `switch` statement nested inside another `switch` statement's section; lift it into a method, a `switch` expression, or a lookup. -dotnet_diagnostic.SST2254.severity = none # A target-typed `new()` is written where an explicit type reads more clearly; the code fix restores `new TypeName(...)`. Opt-in — the counterpart to SST2202's target-typed direction, so a team enables at most one. -dotnet_diagnostic.SST2255.severity = error # A hand-written null-or-empty string test. Code fix uses `string.IsNullOrEmpty`. -dotnet_diagnostic.SST2256.severity = error # An extension method called in static form. Code fix rewrites to instance form. Info. -dotnet_diagnostic.SST2257.severity = error # A lambda block body that is a single `return`. Code fix uses an expression body. Info. -dotnet_diagnostic.SST2258.severity = error # A redundant explicit delegate wrapper (`new EventHandler(M)`). Code fix drops it. Info. -dotnet_diagnostic.SST2259.severity = error # A stray `;` after a type declaration. Code fix removes it. Info. -dotnet_diagnostic.SST2260.severity = error # An `as` cast to a type the operand already has. Code fix removes it. Info. -dotnet_diagnostic.SST2261.severity = error # `(x && !y) -dotnet_diagnostic.SST2262.severity = error # A raw string literal whose content needs no raw syntax. Code fix demotes it. Info. -dotnet_diagnostic.SST2263.severity = error # An infinite loop whose body re-derives its stop condition. Code fix hoists the condition into the header. Info. -dotnet_diagnostic.SST2264.severity = error # A numeric literal cast to an enum. Code fix names the member. -dotnet_diagnostic.SST2265.severity = none # Consecutive fluent calls on one receiver can fold into a chain. Opt-in. -dotnet_diagnostic.SST2266.severity = none # A local read exactly once can be inlined into that use. Opt-in. -dotnet_diagnostic.SST2267.severity = none # Infinite loops written in mixed `while(true)`/`for(;;)` styles. Configurable. Opt-in. -dotnet_diagnostic.SST2268.severity = none # Inconsistent `()` on object creation with an initializer. Configurable. Opt-in. -dotnet_diagnostic.SST2269.severity = none # Inconsistent parentheses around a conditional's condition. Configurable. Opt-in. -dotnet_diagnostic.SST2270.severity = none # Inconsistent explicit-vs-implicit array-creation type. Configurable. Opt-in. -dotnet_diagnostic.SST2271.severity = none # `var`-vs-explicit local type per the configured preference. Configurable. Opt-in. -dotnet_diagnostic.SST2272.severity = none # `[Flags]` member values written as mixed decimals and shifts. Configurable. Opt-in. -dotnet_diagnostic.SST2273.severity = none # A function or loop body wraps its work in a trailing `if` that could be an early-exit guard clause. Code fix inverts it. Configurable threshold. Opt-in. -dotnet_diagnostic.SST2274.severity = error # A value assigned with `as` and then null-checked is an `is` declaration pattern in one step. Code fix rewrites it. -dotnet_diagnostic.SST2275.severity = error # A method whose block body is a single statement can use an expression body `=> expr`. Code fix rewrites it. -dotnet_diagnostic.SST2276.severity = none # A constructor whose block body is a single statement can use an expression body. Code fix rewrites it. Opt-in. -dotnet_diagnostic.SST2277.severity = none # An operator whose block body is a single `return` can use an expression body. Code fix rewrites it. Opt-in. -dotnet_diagnostic.SST2278.severity = none # A conversion operator whose block body is a single `return` can use an expression body. Code fix rewrites it. Opt-in. -dotnet_diagnostic.SST2279.severity = error # A get-only property whose getter is a single `return` can use a whole-member expression body. Code fix rewrites it. -dotnet_diagnostic.SST2280.severity = error # A get-only indexer whose getter is a single `return` can use a whole-member expression body. Code fix rewrites it. -dotnet_diagnostic.SST2281.severity = error # A local function whose block body is a single statement can use an expression body. Code fix rewrites it. -dotnet_diagnostic.SST2282.severity = error # A reference-type `ReferenceEquals` check against `null` reads as an `is null` / `is not null` pattern. Code fix rewrites it. -dotnet_diagnostic.SST2283.severity = error # A null guard that throws right before assigning the guarded value can fold into the assignment as `?? throw`. Code fix rewrites it. -dotnet_diagnostic.SST2315.severity = error # A type creates and keeps a disposable but is not `IDisposable` - a static factory field, an auto-property `new`, or a collection of disposables. Code fix implements it. -dotnet_diagnostic.SST2316.severity = error # A type declares a public `Dispose`/`DisposeAsync` but not the matching interface, so owners that dispose through the interface never call it. `ref struct` exempt. Code fix adds the interface. -dotnet_diagnostic.SST2317.severity = error # A disposable owns a raw native handle with no finalizer, so it leaks when `Dispose` is not called. The message promotes a `SafeHandle`. -dotnet_diagnostic.SST2318.severity = none # Two methods in one type have token-identical, non-trivial bodies, usually a copy-paste that was meant to differ. Off by default. -dotnet_diagnostic.SST2319.severity = error # An optional parameter's default can never bind because a same-named overload already takes exactly its required prefix. -dotnet_diagnostic.SST2320.severity = error # An interface inherits the same member from two unrelated base interfaces, so every consumer that accesses it gets an ambiguity error. -dotnet_diagnostic.SST2321.severity = error # A class library calls `Environment.Exit` or `Environment.FailFast`, ending the whole host process instead of throwing. -dotnet_diagnostic.SST2322.severity = error # A non-private instance `readonly` field holds a mutable collection, so any caller can still add, remove, or clear its items; `readonly` freezes the reference, not the contents. -dotnet_diagnostic.SST2323.severity = error # A non-static abstract class that extends only `object` and declares nothing but public abstract members is a stateless contract better written as an interface. -dotnet_diagnostic.SST2324.severity = error # A member is declared more accessible than its containing type, so the wider modifier is dead — the container caps its reach. -dotnet_diagnostic.SST2325.severity = error # An async method checks an argument after its first await, so the guard does not throw at the call site but later, when the returned task is awaited. -dotnet_diagnostic.SST2326.severity = error # An interface-typed value is narrowed to a concrete class that implements it — via a cast, `as`, or `is` test — coupling the code to one implementation. Info. -dotnet_diagnostic.SST2327.severity = error # A type inspects its own runtime type against a specific class (`this is Derived`, `this as Derived`, or `this.GetType() == typeof(Derived)`) instead of dispatching through a virtual member. -dotnet_diagnostic.SST2328.severity = error # A visible instance field or property hands out a raw native pointer (`IntPtr`/`UIntPtr`/`nint`/`nuint`), letting callers read, write, free, or corrupt the native memory the type owns. Keep it private behind a `SafeHandle`. -dotnet_diagnostic.SST2329.severity = error # A `[Flags]` enum declares no zero-valued member. Code fix adds `None = 0`. -dotnet_diagnostic.SST2330.severity = error # A `[Flags]` member is a numeric literal equal to a combination of others (`All = 7`). Code fix writes `A -dotnet_diagnostic.SST2331.severity = none # An enum leaves member values implicit, so their numbers depend on declaration order. Opt-in. -dotnet_diagnostic.SST2332.severity = error # An auto-property's `private set` is only written during construction; make it get-only. -dotnet_diagnostic.SST2333.severity = none # A generic comparison/equality contract is implemented without its non-generic counterpart. Opt-in. -dotnet_diagnostic.SST2334.severity = none # A publicly visible type has no `[DebuggerDisplay]`. Opt-in. -dotnet_diagnostic.SST2335.severity = none # Parts of a partial type disagree on the `static` modifier. Opt-in. -dotnet_diagnostic.SST2411.severity = error # A `for` loop declares and tests a counter it never advances, so the loop runs forever or not at all. -dotnet_diagnostic.SST2412.severity = error # A `for` loop steps its counter away from the side of its bound. Code fix flips the comparison. -dotnet_diagnostic.SST2413.severity = error # A `for` loop's condition is already false at the counter's constant starting value, so its body never runs. -dotnet_diagnostic.SST2414.severity = error # Two branches of one conditional share an implementation, so one was probably meant to differ. Code fix merges duplicated switch sections. -dotnet_diagnostic.SST2415.severity = error # A non-short-circuiting `&`/` -dotnet_diagnostic.SST2416.severity = error # A remainder test against a non-zero value misses every negative on a signed type. Code fix promotes `IsOddInteger`, or `% 2 != 0`. -dotnet_diagnostic.SST2417.severity = error # An assignment is spaced like a transposed operator (`x =+ 1`). Code fix offers `x += 1` or `x = +1`. -dotnet_diagnostic.SST2418.severity = error # The result of an immutable value's method is discarded, so the call does nothing. -dotnet_diagnostic.SST2419.severity = error # A set or list operation is applied to the collection itself. -dotnet_diagnostic.SST2420.severity = error # An index-of result tested with `> 0` treats a match at the first position as not found. Code fix uses `Contains`, or `>= 0`. -dotnet_diagnostic.SST2421.severity = error # A write through a `readonly` field of an unconstrained type parameter lands on a copy and is lost. -dotnet_diagnostic.SST2422.severity = error # A property's getter reads a different field than its setter writes. Code fix points the getter at the setter's field. -dotnet_diagnostic.SST2423.severity = error # A value owned by a `using` is returned out of the `using` scope, so the caller receives an already-disposed object. Code fix transfers ownership. -dotnet_diagnostic.SST2424.severity = error # An override declares a different parameter default than the base, so the same call means different things through the base and derived types. -dotnet_diagnostic.SST2425.severity = error # An override forwards to the base but drops one of its own optional arguments, so the base substitutes its default and the caller's value is lost. -dotnet_diagnostic.SST2426.severity = error # An override's `params` modifier disagrees with the base and is ignored, so it only misleads readers. Code fix matches the base. -dotnet_diagnostic.SST2427.severity = error # A derived overload takes a base type of a same-named base overload's parameter, so calls through the derived type never reach the base overload. -dotnet_diagnostic.SST2428.severity = error # A static field initializer reads a static field declared later, so it sees that field's default and keeps it. -dotnet_diagnostic.SST2429.severity = error # A `set`, `init`, `add`, or `remove` accessor never reads `value`, so the assignment or subscription is discarded. -dotnet_diagnostic.SST2430.severity = error # A serialization callback's signature does not match the shape the serializer invokes, so it never runs. -dotnet_diagnostic.SST2431.severity = error # An overridden `ToString` can return null, which breaks interpolation, concatenation, and debugger display. Code fix returns `string.Empty`. -dotnet_diagnostic.SST2432.severity = error # `GetType()` is called on a value that is already a `Type`, returning the reflection object's runtime type. Code fix removes the call. -dotnet_diagnostic.SST2433.severity = error # A caller-info parameter is followed by an ordinary parameter, so a positional argument lands in the wrong one, or it has no default. -dotnet_diagnostic.SST2434.severity = error # A reference-type array is widened to an array of its base type, making every element write a runtime-checked store that can throw. -dotnet_diagnostic.SST2435.severity = error # A base class's value-equality `Equals` is used as an early-out fast path, so a derived override skips comparing its own fields. -dotnet_diagnostic.SST2436.severity = error # An instance event is raised with a null sender or null args, so every subscriber that reads them throws. Code fix passes `this` or `EventArgs.Empty`. -dotnet_diagnostic.SST2437.severity = error # A generic type is nested inside its own base's type arguments, which expands without end and throws `TypeLoadException` at load. -dotnet_diagnostic.SST2438.severity = error # A catch logs at error or critical level but never passes the caught exception, so the stack trace is lost. Code fix passes it. Level floor configurable. -dotnet_diagnostic.SST2439.severity = error # An exception is passed as a log message value instead of the exception argument. Code fix hoists it into the exception argument. -dotnet_diagnostic.SST2440.severity = error # Two log values named after the template placeholders sit in each other's slots. Code fix swaps them back. -dotnet_diagnostic.SST2441.severity = error # A message-template placeholder is empty, whitespace, or not a property name, so its value is dropped from the payload. -dotnet_diagnostic.SST2442.severity = error # A message template names the same placeholder twice, so one value silently overwrites the other in a structured sink. -dotnet_diagnostic.SST2443.severity = error # A typed logger's category is a type other than the one that logs, so its level filters and sink routes do nothing. Code fix rewrites the category. -dotnet_diagnostic.SST2444.severity = error # A constant regular-expression pattern does not parse, so it throws on first use. Refactoring converts a valid literal to a source-generated `[GeneratedRegex]` method. -dotnet_diagnostic.SST2445.severity = error # A custom date/time format uses an unquoted `/` or `:` with a culture-sensitive provider, so the separators change with the culture. Code fixes quote the separators or switch to the invariant culture. -dotnet_diagnostic.SST2446.severity = error # A stream read's returned byte count is awaited and discarded through a configured awaiter or a local, so a short read passes unnoticed. Code fix rewrites to `ReadExactlyAsync` where it exists. -dotnet_diagnostic.SST2448.severity = error # A combined or opaque delegate is removed with `-`/`-=`, which strips handlers only as one contiguous run, so the order they were combined in silently decides the result. -dotnet_diagnostic.SST2449.severity = error # An event or delegate handler added as a lambda or anonymous method is removed with `-=`, which never matches it, so the subscription is never removed. -dotnet_diagnostic.SST2450.severity = error # A `Debug.Assert` condition performs a side effect, so a release build compiles the call out and the work never runs. -dotnet_diagnostic.SST2451.severity = error # Every constructor of a non-static, non-abstract class is private, yet no member ever creates an instance, so the type can never exist. -dotnet_diagnostic.SST2452.severity = error # A method marked `[Pure]` returns `void`, a bare `Task`, or a bare `ValueTask`, so it has no observable result — the attribute is wrong or the method is dead. Code fix removes the attribute. -dotnet_diagnostic.SST2456.severity = error # A field-like event declared `override`, or `new` hiding an inherited event, gets its own backing delegate field, so handlers added through one type are invisible to raises through the other. -dotnet_diagnostic.SST2457.severity = error # An integer sequence `Sum` is wrapped in `unchecked`, which does not stop it throwing on overflow. -dotnet_diagnostic.SST2458.severity = error # A bitwise operator is applied to an enum not declared `[Flags]`, producing a value with no defined meaning. -dotnet_diagnostic.SST2459.severity = error # `[Optional]` on a `ref` or `out` parameter advertises an optionality no C# caller can use, while reflection reads `IsOptional` as true. Code fix removes the attribute. -dotnet_diagnostic.SST2460.severity = error # `[DefaultValue]` on a method or record parameter is inert: it does not make the parameter optional and no call site reads it. Code fix swaps it for the interop `[DefaultParameterValue]`. -dotnet_diagnostic.SST2462.severity = error # A member declared with `new` is less accessible than the inherited member it hides, so a base-typed reference still binds to the more accessible member and the reduced accessibility has no effect. -dotnet_diagnostic.SST2463.severity = error # A derived type's instance field differs from an inherited accessible field only by case, so an unqualified reference to either name compiles and silently uses the wrong storage. -dotnet_diagnostic.SST2464.severity = error # A mutable class (a settable field or property) declares a value-equality `operator ==`, so a mutated instance's hash no longer matches the bucket it was stored in and it is lost as a dictionary or hash-set key. -dotnet_diagnostic.SST2465.severity = error # A for loop's body reassigns the counter or the local its condition tests, so the loop runs a different number of times than its header states. -dotnet_diagnostic.SST2467.severity = error # A type declares a `params` overload and a same-arity overload whose last parameter is more specific than the array's element type, so a single argument of that type silently binds to the specific overload instead of the params one. -dotnet_diagnostic.SST2468.severity = error # A classic partial method is declared but never implemented, so the compiler silently removes the declaration and every call to it. -dotnet_diagnostic.SST2470.severity = error # Two string literals concatenate with no space between them, fusing a SQL keyword into the adjacent token so the query changes at runtime. Code fix adds a space to a regular right literal. -dotnet_diagnostic.SST2472.severity = error # A type is exported for a contract (`[Export(typeof(IFoo))]`) it neither implements nor inherits, so the container cannot supply it for that contract. -dotnet_diagnostic.SST2473.severity = error # A `new` expression constructs a type that is itself a shared export part, bypassing the container and its single-instance guarantee. -dotnet_diagnostic.SST2474.severity = error # A part-creation-policy attribute is applied to a type with no `[Export]`, so it governs nothing. -dotnet_diagnostic.SST2475.severity = error # An entity's primary key is typed `DateTime` or `DateTimeOffset`, so keys collide within a tick, are not stable identifiers, cluster the table by insertion time, and round-trip imprecisely across providers. -dotnet_diagnostic.SST2479.severity = error # A for/while/do loop variable captured by a lambda, anonymous method, or local function that is stored beyond the iteration reads its final value on every deferred call. -dotnet_diagnostic.SST2481.severity = error # A `GetHashCode` override folds the base object identity hash into a value hash, so two value-equal instances hash differently and are lost in any hash-based collection. -dotnet_diagnostic.SST2484.severity = error # A raw handle read through `SafeHandle.DangerousGetHandle()` is not reference-counted, so a concurrent dispose or finalize can recycle the value and it is used after free. -dotnet_diagnostic.SST2485.severity = error # A member throws `new NotImplementedException`, a stub that compiles but crashes at runtime on any path that reaches it. `NotSupportedException` is left alone. -dotnet_diagnostic.SST2486.severity = error # An assembly is loaded through `Assembly.LoadFrom`, `LoadFile`, or `LoadWithPartialName` instead of `Assembly.Load` with a full display name; a code fix swaps `LoadWithPartialName` to `Assembly.Load`. -dotnet_diagnostic.SST2487.severity = error # A `[ConstructorArgument]` names no parameter of any constructor of its declaring type, so a markup extension cannot round-trip the property back to a constructor argument. -dotnet_diagnostic.SST2488.severity = error # A catch logs the caught exception and then rethrows it with a bare `throw;`, so the same failure is recorded here and again where it is finally handled. -dotnet_diagnostic.SST2489.severity = error # A relational comparison an integer operand's type already decides — an unsigned value `>= 0` (always true) or `< 0` (always false), or a value at its type's min/max edge such as `b <= 255` for a `byte`. -dotnet_diagnostic.SST2490.severity = error # Two adjacent `try` statements in the same block repeat the same catch/finally handling, so the pair can collapse into one `try` wrapping both bodies. -dotnet_diagnostic.SST2491.severity = error # A non-`async` method returns an awaitable from inside `using`/`try-finally`/`lock`, so the resource is torn down before the task completes. Code fix makes it `async`. -dotnet_diagnostic.SST2492.severity = error # A null-guard throws on a parameter the signature declares may be null. -dotnet_diagnostic.SST2493.severity = error # `== null`/`!= null` on an unconstrained generic `T`. Code fix uses `is null`/`is not null`. -dotnet_diagnostic.SST2494.severity = error # A `??` whose left operand is a constant null, so the right is always taken. Code fix folds it. -dotnet_diagnostic.SST2495.severity = error # A `[Flags]` combination includes an operand whose bits another already covers. Code fix removes it. -dotnet_diagnostic.SST2496.severity = error # An explicit `Dispose`/`Close` on a resource an enclosing `using` already disposes. Code fix removes it. Info. -dotnet_diagnostic.SST2500.severity = error # A test method carrying a test attribute contains no assertion and no expected-exception check, so it always passes without verifying anything. Reported only when every call in the body resolves to a non-verifying platform (BCL) API (or there are none); any user or third-party call keeps it silent. -dotnet_diagnostic.SST2501.severity = error # An equality or identity assertion compares an expression with itself, so a positive assertion always passes and a negated one always fails, verifying nothing. Covers xUnit, NUnit (classic and `Assert.That`), and MSTest. -dotnet_diagnostic.SST2502.severity = error # An equality assertion is passed a constant as its actual argument and a computed value as its expected, so a failure reports them the wrong way round. Code fix swaps the two arguments. -dotnet_diagnostic.SST2503.severity = error # An equality assertion compares a value against a boolean literal (`Assert.Equal(true, x)` / `Assert.AreEqual(true, x)`), obscuring intent and giving a worse failure message. Code fix rewrites it to the framework's boolean assertion. -dotnet_diagnostic.SST2504.severity = error # A concrete class marked as a test fixture (MSTest test-class or NUnit test-fixture) declares no test method of its own and inherits none, so the runner loads it but never runs anything. -dotnet_diagnostic.SST2505.severity = error # A test method declares parameters but no data source, so the runner cannot supply arguments and the test silently never runs. -dotnet_diagnostic.SST2506.severity = error # A test method calls `Thread.Sleep`, spending a fixed real-time delay on every run that slows the suite and races the wall clock, a classic flaky-test source. -dotnet_diagnostic.SST2507.severity = error # A test method declares its expected failure with an expected-exception attribute instead of asserting the specific operation, so any statement in the whole method throwing that type passes the test. -dotnet_diagnostic.SST2508.severity = error # A fluent assertion names its subject with a bare `Should()` statement but chains no check, so it compiles, runs, and passes while verifying nothing. Gated on FluentAssertions/AwesomeAssertions. -dotnet_diagnostic.SST2509.severity = error # A method carrying a test attribute has a signature the runner cannot execute — non-public, a parameterless generic, or a return type other than `void`/`Task`/`ValueTask` — so it is discovered and then silently skipped. -dotnet_diagnostic.SST2600.severity = error # Application output is written through `Trace.Write`/`WriteLine`/`WriteIf`/`WriteLineIf` when a structured logger (`ILogger`) is available, so the message loses its level, category, and named state. Reported only when `ILogger` resolves; `Debug.*` is excluded. -dotnet_diagnostic.SST2601.severity = error # An `ILogger`/`ILogger` field or property is named against the logger convention (`_logger`/`_log` for a private instance one, `Logger` otherwise). Configurable via `stylesharp.SST2601.fieldname`. -dotnet_diagnostic.SST2700.severity = error # An MVC route template contains a backslash; route segments are separated by `/`, so the route is unreachable. Code fix replaces `\` with `/`. -dotnet_diagnostic.SST2701.severity = error # A `[JSInvokable]` method is not public, so JavaScript interop cannot call it. Code fix makes it public. -dotnet_diagnostic.SST2702.severity = error # A `[SupplyParameterFromQuery]` property has a type the framework cannot bind from the query string, which throws at runtime. -dotnet_diagnostic.SST2703.severity = error # A routable component's route constraint (`{id:int}`) disagrees with the matching `[Parameter]` CLR type, so the route silently fails to match. -dotnet_diagnostic.SST2704.severity = error # A public action on an `[ApiController]` declares no HTTP-verb attribute, so it answers every verb and can make routing ambiguous. -dotnet_diagnostic.SST2705.severity = none # A bound model member is a non-nullable value type with no required marker, so a request that omits it binds the default with no error. Opt-in. -dotnet_diagnostic.SST2706.severity = error # A Windows Forms entry point carries neither `[STAThread]` nor `[MTAThread]`; without STA, clipboard, drag-and-drop, and common dialogs misbehave. Code fix adds `[STAThread]`. -dotnet_diagnostic.SST2707.severity = none # A fire-and-forget `Task.Run` in a controller captures the request's `HttpContext`, which is disposed when the request ends, so the background work throws `ObjectDisposedException`. Opt-in. -dotnet_diagnostic.SST2708.severity = error # A component subscribes to an event in a lifecycle method but never unsubscribes, so the event source keeps the component alive — a per-session leak on a Server circuit. -dotnet_diagnostic.SST2709.severity = error # `StateHasChanged` is called while the component is being disposed, which the renderer no longer supports and throws. -dotnet_diagnostic.SST2710.severity = error # `StateHasChanged` is called directly from a timer callback, off the renderer's dispatcher; marshal it with `InvokeAsync(StateHasChanged)`. -dotnet_diagnostic.SST2711.severity = error # A synchronous component lifecycle method is overridden as `async void`, which the framework never awaits; override the `…Async` twin returning `Task`. Code fix rewrites the signature. -dotnet_diagnostic.SST2712.severity = error # An `[Inject]`/`[CascadingParameter]` property has no setter, so the framework's reflection-based binding leaves it null. Code fix adds a setter. -dotnet_diagnostic.SST2713.severity = error # A `DotNetObjectReference.Create(this)` is passed inline and never stored, so nothing can dispose it and it leaks on the JavaScript side. - -# In-box IDE code-style rules disabled where a StyleSharp rule covers the same shape (avoids double-reporting under EnforceCodeStyleInBuild) -dotnet_diagnostic.IDE0001.severity = none # covered by SST1116 -dotnet_diagnostic.IDE0003.severity = none # covered by SST1117 -dotnet_diagnostic.IDE0005.severity = none # covered by SST1445 -dotnet_diagnostic.IDE0010.severity = none # covered by SST2205 -dotnet_diagnostic.IDE0011.severity = none # covered by SST1503 -dotnet_diagnostic.IDE0017.severity = none # covered by SST1193 -dotnet_diagnostic.IDE0018.severity = none # covered by SST2208 -dotnet_diagnostic.IDE0020.severity = none # covered by SST2007 -dotnet_diagnostic.IDE0027.severity = none # covered by SST2219 -dotnet_diagnostic.IDE0029.severity = none # covered by SST1195 -dotnet_diagnostic.IDE0030.severity = none # covered by SST1195 -dotnet_diagnostic.IDE0032.severity = none # covered by SST1420 -dotnet_diagnostic.IDE0033.severity = none # covered by SST1142 -dotnet_diagnostic.IDE0034.severity = none # covered by SST1188 -dotnet_diagnostic.IDE0036.severity = none # covered by SST1206 -dotnet_diagnostic.IDE0037.severity = none # covered by SST2216 -dotnet_diagnostic.IDE0039.severity = none # covered by SST2228 -dotnet_diagnostic.IDE0040.severity = none # covered by SST1400 -dotnet_diagnostic.IDE0045.severity = none # covered by SST1198 -dotnet_diagnostic.IDE0046.severity = none # covered by SST1197 -dotnet_diagnostic.IDE0051.severity = none # covered by SST1440 -dotnet_diagnostic.IDE0053.severity = none # covered by SST2257 -dotnet_diagnostic.IDE0054.severity = none # covered by SST1185 -dotnet_diagnostic.IDE0056.severity = none # covered by SST2203 -dotnet_diagnostic.IDE0062.severity = none # covered by SST2235 -dotnet_diagnostic.IDE0063.severity = none # covered by SST2236 -dotnet_diagnostic.IDE0065.severity = none # covered by SST1200 -dotnet_diagnostic.IDE0070.severity = none # covered by SST2217 -dotnet_diagnostic.IDE0071.severity = none # covered by SST2220 -dotnet_diagnostic.IDE0072.severity = none # covered by SST2206 -dotnet_diagnostic.IDE0073.severity = none # covered by SST1633 -dotnet_diagnostic.IDE0074.severity = none # covered by SST2223 -dotnet_diagnostic.IDE0076.severity = none # covered by SST1457 -dotnet_diagnostic.IDE0077.severity = none # covered by SST1458 -dotnet_diagnostic.IDE0080.severity = none # covered by SST2209 -dotnet_diagnostic.IDE0082.severity = none # covered by SST1199 -dotnet_diagnostic.IDE0083.severity = none # covered by SST2006 -dotnet_diagnostic.IDE0090.severity = none # covered by SST2202 -dotnet_diagnostic.IDE0100.severity = none # covered by SST1143 -dotnet_diagnostic.IDE0110.severity = none # covered by SST2213 -dotnet_diagnostic.IDE0150.severity = none # covered by SST2231 -dotnet_diagnostic.IDE0161.severity = none # covered by SST2237 -dotnet_diagnostic.IDE0170.severity = none # covered by SST2238 -dotnet_diagnostic.IDE0180.severity = none # covered by SST2215 -dotnet_diagnostic.IDE0200.severity = none # covered by SST2239 -dotnet_diagnostic.IDE0220.severity = none # covered by SST2225 -dotnet_diagnostic.IDE0230.severity = none # covered by SST2212 -dotnet_diagnostic.IDE0240.severity = none # covered by SST2210 -dotnet_diagnostic.IDE0241.severity = none # covered by SST2211 -dotnet_diagnostic.IDE0251.severity = none # covered by SST1460 -dotnet_diagnostic.IDE0270.severity = none # covered by SST1195 -dotnet_diagnostic.IDE0280.severity = none # covered by SST1463 -dotnet_diagnostic.IDE0290.severity = none # covered by SST2241 -dotnet_diagnostic.IDE0301.severity = none # covered by SST2100 -dotnet_diagnostic.IDE0302.severity = none # covered by SST2102 -dotnet_diagnostic.IDE0303.severity = none # covered by SST2103 -dotnet_diagnostic.IDE0304.severity = none # covered by SST2104 -dotnet_diagnostic.IDE0305.severity = none # covered by SST2105 -dotnet_diagnostic.IDE0340.severity = none # covered by SST2232 -dotnet_diagnostic.IDE0350.severity = none # covered by SST2218 -dotnet_diagnostic.IDE0380.severity = none # covered by SST1455 -dotnet_diagnostic.IDE1005.severity = none # covered by SST2240 -dotnet_diagnostic.S3059.severity = none # Types should not have members with visibility set higher than the type's visibility -dotnet_diagnostic.S3063.severity = none # "StringBuilder" data should be used — covered by SST2408 -dotnet_diagnostic.S3169.severity = none # Multiple "OrderBy" calls should not be used — covered by PSH1108 -dotnet_diagnostic.S3246.severity = none # Generic type parameters should be co/contravariant when possible -> off: low-precision variance suggestion; not enforced -dotnet_diagnostic.S3262.severity = none # "params" should be used on overrides — covered by SST2426 -dotnet_diagnostic.S3264.severity = none # Events should be invoked — covered by SST2407 -dotnet_diagnostic.S3358.severity = none # Ternary operators should not be nested — covered by SST1147 -dotnet_diagnostic.S3366.severity = none # "this" should not be exposed from constructors — covered by SST2403 -dotnet_diagnostic.S3415.severity = none # Assertion arguments should be passed in the correct order — covered by SST2502 -dotnet_diagnostic.S3431.severity = none # "[ExpectedException]" should not be used — covered by SST2507 -dotnet_diagnostic.S3442.severity = none # "abstract" classes should not have "public" constructors — covered by SST1428 -dotnet_diagnostic.S3445.severity = none # Exceptions should not be explicitly rethrown — covered by SST1430 -dotnet_diagnostic.S3457.severity = none # Composite format strings should be used correctly — covered by SST1454 -dotnet_diagnostic.S3597.severity = none # "ServiceContract" and "OperationContract" attributes should be used together -> replaced by obsolete (WCF) -dotnet_diagnostic.S3880.severity = none # Finalizers should not be empty — covered by PSH1002 -dotnet_diagnostic.S3881.severity = none # "IDisposable" should be implemented correctly — covered by SST2300 -dotnet_diagnostic.S3885.severity = none # "Assembly.Load" should be used -> replaced by SST2486 -dotnet_diagnostic.S3898.severity = none # Covered by PSH1005 (canonical) -dotnet_diagnostic.S3902.severity = none # Covered by PSH1404 (canonical) -dotnet_diagnostic.S3906.severity = none # Event Handlers should have the correct signature — covered by SST2304 -dotnet_diagnostic.S3908.severity = none # Generic event handlers should be used -> replaced by SST2304 -dotnet_diagnostic.S3909.severity = none # Collections should implement the generic interface -> replaced by CA1010 -dotnet_diagnostic.S3925.severity = none # "ISerializable" should be implemented correctly - BinaryFormatter / ISerializable serialization is obsoleted (SYSLIB0050/0051) in modern .NET; we do not opt into legacy serialization for any exception type -dotnet_diagnostic.S3928.severity = none # Parameter names used into ArgumentException constructors should match an existing one - DUPLICATE CA2208 -dotnet_diagnostic.S3956.severity = none # "Generic.List" instances should not be part of public APIs -dotnet_diagnostic.S3971.severity = none # "GC.SuppressFinalize" should not be called — conflicts with PSH1008, which owns the pointless-SuppressFinalize direction and exempts unsealed types -dotnet_diagnostic.S3990.severity = none # Assemblies should be marked as CLS compliant -> replaced by CA1014 -dotnet_diagnostic.S3992.severity = none # Assemblies should explicitly specify COM visibility -> replaced by CA1017 -dotnet_diagnostic.S3993.severity = none # Custom attributes should be marked with "System.AttributeUsageAttribute" -> replaced by CA1018 -dotnet_diagnostic.S3994.severity = none # URI Parameters should not be strings -dotnet_diagnostic.S3995.severity = none # URI return values should not be strings -dotnet_diagnostic.S3996.severity = none # URI properties should not be strings -dotnet_diagnostic.S3997.severity = none # String URI overloads should call "System.Uri" overloads -> replaced by CA1054/CA1056/CA1057 -dotnet_diagnostic.S4002.severity = none # Disposable types should declare finalizers — covered by SST2317 -dotnet_diagnostic.S4004.severity = none # Collection properties should be readonly — covered by SST2305 -dotnet_diagnostic.S4005.severity = none # "System.Uri" arguments should be used instead of strings -dotnet_diagnostic.S4016.severity = none # Enumeration members should not be named "Reserved" -> replaced by CA1700 -dotnet_diagnostic.S4017.severity = none # Method signatures should not contain nested generic types -dotnet_diagnostic.S4035.severity = none # Classes implementing "IEquatable" should be sealed — covered by SST2301 -dotnet_diagnostic.S4050.severity = none # Operators should be overloaded consistently — covered by SST2302 -dotnet_diagnostic.S4055.severity = none # Literals should not be passed as localized parameters -dotnet_diagnostic.S4057.severity = none # Locales should be set for data types -> replaced by obsolete -dotnet_diagnostic.S4059.severity = none # Property names should not match get methods - DUPLICATE CA1721 -dotnet_diagnostic.S4070.severity = none # Non-flags enums should not be marked with "FlagsAttribute" — covered by SST2303 -dotnet_diagnostic.S4144.severity = none # Methods should not have identical implementations — covered by SST2318 -dotnet_diagnostic.S4200.severity = none # Native methods should be wrapped -> replaced by CA1401 -dotnet_diagnostic.S4214.severity = none # "P/Invoke" methods should not be visible - DUPLICATE CA1401 -dotnet_diagnostic.S4220.severity = none # Events should have proper arguments — covered by SST2436 -dotnet_diagnostic.S4456.severity = none # Parameter validation in yielding methods should be wrapped — covered by SST2404 -dotnet_diagnostic.S4457.severity = none # Parameter validation in "async"/"await" methods should be wrapped — covered by SST2325 -dotnet_diagnostic.S4545.severity = none # "DebuggerDisplayAttribute" strings should reference existing members — covered by SST2405 -dotnet_diagnostic.S4581.severity = none # "new Guid()" should not be used — covered by SST2012 -dotnet_diagnostic.S6354.severity = none # Use a testable date/time provider — covered by SST2010 -dotnet_diagnostic.S6419.severity = none # Azure Functions should be stateless -> off: Azure Functions-specific; not used in this library -dotnet_diagnostic.S6420.severity = none # Client instances should not be recreated on each Azure Function invocation — covered by PSH1418 -dotnet_diagnostic.S6421.severity = none # Azure Functions should use Structured Error Handling -> off: Azure Functions-specific; not used in this library -dotnet_diagnostic.S6423.severity = none # Azure Functions should log all failures -> off: Azure Functions-specific; not used in this library -dotnet_diagnostic.S6561.severity = none # Avoid using "DateTime.Now" for benchmarking or timing operations — covered by PSH1408 -dotnet_diagnostic.S6562.severity = none # Covered by SST1451 (canonical) -dotnet_diagnostic.S6563.severity = none # Use UTC when recording DateTime instants — covered by SST2011 -dotnet_diagnostic.S6566.severity = none # Use "DateTimeOffset" instead of "DateTime" — covered by SST2016 -dotnet_diagnostic.S6575.severity = none # Use "TimeZoneInfo.FindSystemTimeZoneById" without converting the timezones with "TimezoneConverter" -> replaced by PSH1419 -dotnet_diagnostic.S6580.severity = none # Use a format provider when parsing date and time - DUPLICATE CA1305 -dotnet_diagnostic.S6673.severity = none # Log message template placeholders should be in the right order — covered by SST2440 -dotnet_diagnostic.S6802.severity = none # Using lambda expressions in loops should be avoided in Blazor markup section -> replaced by PSH1600 -dotnet_diagnostic.S6803.severity = none # Parameters with SupplyParameterFromQuery attribute should be used only in routable components -> off: Blazor-specific; no Blazor surface in this library -dotnet_diagnostic.S6931.severity = none # ASP.NET controller actions should not have a route template starting with "/" -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6932.severity = none # Use model binding instead of reading raw request data -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6934.severity = none # A Route attribute should be added to the controller when a route template is specified at the action level -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6960.severity = none # Controllers should not have mixed responsibilities -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6961.severity = none # API Controllers should derive from ControllerBase instead of Controller -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6962.severity = none # You should pool HTTP connections with HttpClientFactory — covered by PSH1418 -dotnet_diagnostic.S6964.severity = none # Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting. -> replaced by SST2705 (opt-in) -dotnet_diagnostic.S6965.severity = none # REST API actions should be annotated with an HTTP verb attribute -> replaced by SST2704 -dotnet_diagnostic.S6966.severity = none # Awaitable method should be used — covered by PSH1313 -dotnet_diagnostic.S6968.severity = none # Actions that return a value should be annotated with ProducesResponseTypeAttribute containing the return type -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S881.severity = none # Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression — covered by SST2015 -dotnet_diagnostic.S907.severity = none # "goto" statement should not be used — covered by SST2014 - -################### -# SonarAnalyzer (Sxxxx) - Minor Code Smell -################### -dotnet_diagnostic.S100.severity = none # Methods and properties should be named in PascalCase — covered by SST1300 -dotnet_diagnostic.S101.severity = none # Types should be named in PascalCase — covered by SST1300 -dotnet_diagnostic.S105.severity = none # Tabulation characters should not be used — covered by SST1027 -dotnet_diagnostic.S1104.severity = none # Fields should not have public accessibility - DUPLICATE CA1051 -dotnet_diagnostic.S1109.severity = none # A close curly brace should be located at the beginning of a line — covered by SST1500 -dotnet_diagnostic.S1116.severity = none # Empty statements should be removed - DUPLICATE SA1106 -dotnet_diagnostic.S1125.severity = none # Boolean literals should not be redundant — covered by SST1182 -dotnet_diagnostic.S1128.severity = none # Covered by SST1445 (canonical) -dotnet_diagnostic.S113.severity = none # Files should end with a newline -dotnet_diagnostic.S1155.severity = none # "Any()" should be used to test for emptiness — covered by PSH1119 -dotnet_diagnostic.S1185.severity = none # Overriding members should do more than simply call the same member in the base class - DUPLICATE RCS1132 -dotnet_diagnostic.S1192.severity = none # String literals should not be duplicated — covered by SST1486 -dotnet_diagnostic.S1199.severity = none # Nested code blocks should not be used — covered by SST1138 -dotnet_diagnostic.S1210.severity = none # "Equals" and the comparison operators should be overridden when implementing "IComparable" - DUPLICATE CA1036 -dotnet_diagnostic.S1227.severity = none # break statements should not be used except for switch cases -dotnet_diagnostic.S1264.severity = none # A "while" loop should be used instead of a "for" loop — covered by SST2245 -dotnet_diagnostic.S1301.severity = none # "switch" statements should have at least 3 "case" clauses -dotnet_diagnostic.S1312.severity = none # Logger fields should be "private static readonly" -dotnet_diagnostic.S1449.severity = none # Culture should be specified for "string" operations — covered by PSH1207 -dotnet_diagnostic.S1450.severity = none # Private fields only used as local variables in methods should become local variables — covered by SST1422 -dotnet_diagnostic.S1481.severity = none # Unused local variables should be removed — covered by SST1497 -dotnet_diagnostic.S1643.severity = none # Covered by PSH1206 (canonical) -dotnet_diagnostic.S1659.severity = none # Multiple variables should not be declared on the same line — covered by SST1132 -dotnet_diagnostic.S1694.severity = none # An abstract class should have both abstract and concrete methods — covered by SST2323 -dotnet_diagnostic.S1698.severity = none # "==" should not be used when "Equals" is overridden — covered by SST1495 -dotnet_diagnostic.S1858.severity = none # "ToString()" calls should not be redundant — covered by PSH1211 -dotnet_diagnostic.S1905.severity = none # Redundant casts should not be used - DUPLICATE IDE0004 — covered by SST1175 -dotnet_diagnostic.S1939.severity = none # Inheritance list should not be redundant — covered by SST1490 and SST1177 -dotnet_diagnostic.S1940.severity = none # Boolean checks should not be inverted — covered by SST1172 -dotnet_diagnostic.S2094.severity = none # Classes should not be empty — covered by SST1436 -dotnet_diagnostic.S2148.severity = none # Underscores should be used to make large numbers readable — covered by SST1191 -dotnet_diagnostic.S2156.severity = none # "sealed" classes should not have "protected" members — covered by SST1427 -dotnet_diagnostic.S2219.severity = none # Runtime type checking should be simplified — covered by SST2007 -dotnet_diagnostic.S2221.severity = none # "Exception" should not be caught -dotnet_diagnostic.S2292.severity = none # Trivial properties should be auto-implemented — covered by SST1420 -dotnet_diagnostic.S2325.severity = none # Methods and properties that don't access instance data should be static - DUPLICATE CA1822 -dotnet_diagnostic.S2333.severity = none # Redundant modifiers should not be used — covered by SST1419/SST1491 -dotnet_diagnostic.S2342.severity = none # Enumeration types should comply with a naming convention — covered by SST1319 -dotnet_diagnostic.S2344.severity = none # Enumeration type names should not have "Flags" or "Enum" suffixes - DUPLICATE CA1711 -dotnet_diagnostic.S2386.severity = none # Mutable fields should not be "public static" — covered by SST1499 -dotnet_diagnostic.S2486.severity = none # Generic exceptions should not be ignored — covered by SST1429 -dotnet_diagnostic.S2737.severity = none # "catch" clauses should do more than rethrow — covered by SST1470 -dotnet_diagnostic.S2760.severity = none # Sequential tests should not check the same condition — covered by SST1475 -dotnet_diagnostic.S3052.severity = none # Covered by PSH1403 (canonical) -dotnet_diagnostic.S3220.severity = none # Method calls should not resolve ambiguously to overloads with "params" — covered by SST2467 -dotnet_diagnostic.S3234.severity = none # Covered by PSH1008 (canonical) -dotnet_diagnostic.S3235.severity = none # Redundant parentheses should not be used — covered by SST1459 -dotnet_diagnostic.S3236.severity = none # Covered by SST1448 (canonical) -dotnet_diagnostic.S3240.severity = none # The simplest possible condition syntax should be used - duplicate of SST1198 -dotnet_diagnostic.S3241.severity = none # Methods should not return values that are never used -> off: needs whole-program analysis; not enforced here -dotnet_diagnostic.S3242.severity = none # Method parameters should be declared with base types -dotnet_diagnostic.S3247.severity = none # Duplicate casts should not be made — covered by SST1175 -dotnet_diagnostic.S3251.severity = none # Implementations should be provided for "partial" methods — covered by SST2468 -dotnet_diagnostic.S3253.severity = none # Constructor and destructor declarations should not be redundant — covered by SST1433 -dotnet_diagnostic.S3254.severity = none # Default parameter values should not be passed as arguments — covered by SST1494 -dotnet_diagnostic.S3256.severity = none # "string.IsNullOrEmpty" should be used — covered by PSH1204 (style configurable) -dotnet_diagnostic.S3257.severity = none # Declarations and initializations should be as concise as possible -> replaced by SST2202 -dotnet_diagnostic.S3260.severity = none # Non-derived "private" classes and records should be "sealed" — covered by PSH1411 -dotnet_diagnostic.S3261.severity = none # Namespaces should not be empty — covered by SST1435 -dotnet_diagnostic.S3267.severity = none # Loops should be simplified with "LINQ" expressions -dotnet_diagnostic.S3376.severity = none # Attribute, EventArgs, and Exception type names should end with the type being extended - DUPLICATE CA1710 -dotnet_diagnostic.S3398.severity = none # "private" methods called only by inner classes should be moved to those classes — covered by SST1498 -dotnet_diagnostic.S3400.severity = none # Methods should not return constants — covered by SST1493 -dotnet_diagnostic.S3416.severity = none # Loggers should be named for their enclosing types — covered by SST2443 -dotnet_diagnostic.S3440.severity = none # Variables should not be checked against the values they're about to be assigned — covered by SST1492 -dotnet_diagnostic.S3441.severity = none # Redundant property names should be omitted in anonymous classes — covered by SST1173 -dotnet_diagnostic.S3444.severity = none # Interfaces should not simply inherit from base interfaces with colliding members — covered by SST2320 -dotnet_diagnostic.S3450.severity = none # Parameters with "[DefaultParameterValue]" attributes should also be marked "[Optional]" -> replaced by obsolete (legacy DefaultParameterValue) -dotnet_diagnostic.S3458.severity = none # Empty "case" clauses that fall through to the "default" should be omitted — covered by SST1466 -dotnet_diagnostic.S3459.severity = none # Unassigned members should be removed - the compiler reports this as CS0649; the rule only ever fires on private never-assigned fields -dotnet_diagnostic.S3532.severity = none # Empty "default" clauses should be removed — covered by SST1179 -dotnet_diagnostic.S3604.severity = none # Member initializer values should not be redundant — covered by PSH1403 -dotnet_diagnostic.S3626.severity = none # Jump statements should not be redundant — covered by SST1174 -dotnet_diagnostic.S3717.severity = none # Track use of "NotImplementedException" -> replaced by SST2485 -dotnet_diagnostic.S3872.severity = none # Parameter names should not duplicate the names of their methods -> replaced by SST1320 -dotnet_diagnostic.S3876.severity = none # Strings or integral types should be used for indexers -> replaced by CA1043 -dotnet_diagnostic.S3878.severity = none # Arrays should not be created for params parameters — covered by PSH1018 -dotnet_diagnostic.S3897.severity = none # Classes that provide "Equals()" should implement "IEquatable" -> replaced by CA1067 -dotnet_diagnostic.S3962.severity = none # Covered by PSH1402 (canonical) -dotnet_diagnostic.S3963.severity = none # "static" fields should be initialized inline - DUPLICATE CA1810 -dotnet_diagnostic.S3967.severity = none # Multidimensional arrays should not be used - DUPLICATE CA1814 -dotnet_diagnostic.S4018.severity = none # All type parameters should be used in the parameter list to enable type inference — covered by SST2307 -dotnet_diagnostic.S4022.severity = none # Enumerations should have "Int32" storage — covered by SST2313 -dotnet_diagnostic.S4023.severity = none # Interfaces should not be empty — covered by SST1437 -dotnet_diagnostic.S4026.severity = none # Assemblies should be marked with "NeutralResourcesLanguageAttribute" -> replaced by CA1824 -dotnet_diagnostic.S4027.severity = none # Exceptions should provide standard constructors — covered by SST1488 -dotnet_diagnostic.S4040.severity = none # Strings should be normalized to uppercase - DUPLICATE CA1308 -dotnet_diagnostic.S4041.severity = none # Type names should not match namespaces - DUPLICATE CA1724 -dotnet_diagnostic.S4047.severity = none # Generics should be used when appropriate -> off: fuzzy prefer-generics suggestion; not enforced -dotnet_diagnostic.S4049.severity = none # Properties should be preferred - DUPLICATE CA1024 -dotnet_diagnostic.S4052.severity = none # Types should not extend outdated base types -> replaced by obsolete -dotnet_diagnostic.S4056.severity = none # Overloads with a "CultureInfo" or an "IFormatProvider" parameter should be used - DUPLICATE CA1305 -dotnet_diagnostic.S4058.severity = none # Covered by PSH1207 (canonical) -dotnet_diagnostic.S4060.severity = none # Non-abstract attributes should be sealed - DUPLICATE CA1813 -dotnet_diagnostic.S4061.severity = none # "params" should be used instead of "varargs" -> replaced by obsolete (__arglist varargs) -dotnet_diagnostic.S4069.severity = none # Operator overloads should have named alternatives - DUPLICATE CA2225 -dotnet_diagnostic.S4136.severity = none # Method overloads should be grouped together — covered by SST1218 -dotnet_diagnostic.S4201.severity = none # Null checks should not be combined with "is" operator checks — covered by SST2018 -dotnet_diagnostic.S4225.severity = none # Extension methods should not extend "object" — covered by SST1706 -dotnet_diagnostic.S4226.severity = none # Extensions should be in separate namespaces -dotnet_diagnostic.S4261.severity = none # Methods should be named according to their synchronicities - Async suffix not used -dotnet_diagnostic.S4663.severity = none # Covered by SST1120 (canonical) -dotnet_diagnostic.S6513.severity = none # "ExcludeFromCodeCoverage" attributes should include a justification - not available on net462 and older TFMs -dotnet_diagnostic.S6585.severity = none # Don't hardcode the format when turning dates and times to strings — covered by SST2445 -dotnet_diagnostic.S6588.severity = none # Use the "UnixEpoch" field instead of creating "DateTime" instances that point to the beginning of the Unix epoch — covered by PSH1413 -dotnet_diagnostic.S6602.severity = none # Covered by PSH1110 (canonical) -dotnet_diagnostic.S6603.severity = none # Covered by PSH1110 (canonical) -dotnet_diagnostic.S6605.severity = none # Covered by PSH1110 (canonical) -dotnet_diagnostic.S6607.severity = none # The collection should be filtered before sorting — covered by PSH1107 -dotnet_diagnostic.S6608.severity = none # Covered by PSH1106 (canonical) -dotnet_diagnostic.S6609.severity = none # "Min/Max" properties of "Set" types should be used instead of the "Enumerable" extension methods — covered by PSH1122 -dotnet_diagnostic.S6610.severity = none # Covered by PSH1201 (canonical) -dotnet_diagnostic.S6612.severity = none # The lambda parameter should be used instead of capturing arguments in "ConcurrentDictionary" methods — covered by PSH1006 -dotnet_diagnostic.S6613.severity = none # "First" and "Last" properties of "LinkedList" should be used instead of the "First()" and "Last()" extension methods — covered by PSH1124 -dotnet_diagnostic.S6617.severity = none # Covered by PSH1111 (canonical) -dotnet_diagnostic.S6618.severity = none # "string.Create" should be used instead of "FormattableString" — covered by PSH1209 -dotnet_diagnostic.S6664.severity = none # The code block contains too many logging calls -> off: fuzzy too-many-logging-calls metric; not enforced -dotnet_diagnostic.S6667.severity = none # Logging in a catch clause should pass the caught exception as a parameter. — covered by SST2438 -dotnet_diagnostic.S6668.severity = none # Logging arguments should be passed to the correct parameter — covered by SST2439 -dotnet_diagnostic.S6669.severity = none # Logger field or property name should comply with a naming convention -> replaced by SST2601 -dotnet_diagnostic.S6670.severity = none # "Trace.Write" and "Trace.WriteLine" should not be used — covered by SST2600 -dotnet_diagnostic.S6672.severity = none # Generic logger injection should match enclosing type — covered by SST2443 -dotnet_diagnostic.S6675.severity = none # "Trace.WriteLineIf" should not be used with "TraceSwitch" levels -> off: niche TraceSwitch misuse; not enforced here -dotnet_diagnostic.S6678.severity = none # Use PascalCase for named placeholders -> replaced by CA1727 -dotnet_diagnostic.S818.severity = none # Literal suffixes should be upper case — covered by SST2244 - -################### -# SonarAnalyzer (Sxxxx) - Info Code Smell -################### -dotnet_diagnostic.S1133.severity = none # Deprecated code should be removed — covered by SST2310 -dotnet_diagnostic.S1135.severity = none # Track uses of "TODO" tags -> off: FIXME comment tracker; not enforced here -dotnet_diagnostic.S1309.severity = none # Track uses of in-source issue suppressions - -################### -# SonarAnalyzer (Sxxxx) - Uncategorized -################### +# SonarAnalyzer.CSharp (S) +################### +# Repository suppressions +dotnet_diagnostic.S1075.severity = error # Hardcoded URI — canonical SourceLink hosts are the point +dotnet_diagnostic.S2436.severity = error # Too many generic parameters — needed for the projector overload +dotnet_diagnostic.S4036.severity = error # PATH-relative process spawn — benchmark only, trusted env +dotnet_diagnostic.S8969.severity = error # Nullability inference is inconsistent across the repository's target frameworks + +# Blocker bugs +dotnet_diagnostic.S1048.severity = error # Finalizers should not throw exceptions — covered by SST1485 +dotnet_diagnostic.S2190.severity = error # Loops and recursions should not be infinite +dotnet_diagnostic.S2275.severity = error # Composite format strings should not lead to unexpected behavior at runtime - DUPLICATE CA2241 +dotnet_diagnostic.S2857.severity = error # SQL keywords should be delimited by whitespace — covered by SST2470 +dotnet_diagnostic.S2930.severity = error # "IDisposables" should be disposed — covered by SST2410 +dotnet_diagnostic.S2931.severity = error # Classes with "IDisposable" members should implement "IDisposable" — covered by SST2315 +dotnet_diagnostic.S3464.severity = error # Type inheritance should not be recursive — covered by SST2437 +dotnet_diagnostic.S3869.severity = error # "SafeHandle.DangerousGetHandle" should not be called -> replaced by SST2484 +dotnet_diagnostic.S3889.severity = error # "Thread.Resume" and "Thread.Suspend" should not be used -> replaced by obsolete or compiler +dotnet_diagnostic.S4159.severity = error # Classes should implement their "ExportAttribute" interfaces — covered by SST2472 + +# Critical bugs +dotnet_diagnostic.S2551.severity = error # Shared resources should not be used for locking — covered by SST1902 +dotnet_diagnostic.S2952.severity = error # Classes should "Dispose" of members from the classes' own "Dispose" methods -> replaced by SST2315 +dotnet_diagnostic.S3449.severity = error # Right operands of shift operators should be integers -> replaced by SST1478 +dotnet_diagnostic.S4275.severity = error # Getters and setters should access the expected fields — covered by SST2422 +dotnet_diagnostic.S4277.severity = error # "Shared" parts should not be created with "new" — covered by SST2473 +dotnet_diagnostic.S4583.severity = error # Calls to delegate's method "BeginInvoke" should be paired with calls to "EndInvoke" -> replaced by obsolete (APM BeginInvoke/EndInvoke) +dotnet_diagnostic.S4586.severity = error # Non-async "Task/Task" methods should not return null — covered by PSH1312 +dotnet_diagnostic.S5856.severity = error # Regular expressions should be syntactically valid — covered by SST2444 +dotnet_diagnostic.S6674.severity = error # Log message template should be syntactically correct — covered by SST2441 + +# Major bugs +dotnet_diagnostic.S1244.severity = error # Floating point numbers should not be tested for equality — covered by SST1473 +dotnet_diagnostic.S1656.severity = error # Variables should not be self-assigned — covered by SST1189 +dotnet_diagnostic.S1751.severity = error # Loops with at most one iteration should be refactored - covered by SST1444 +dotnet_diagnostic.S1764.severity = error # Identical expressions should not be used on both sides of operators — covered by SST1474 +dotnet_diagnostic.S1848.severity = error # Objects should not be created to be dropped immediately without being used -> replaced by SST1480 +dotnet_diagnostic.S1862.severity = error # Related "if/else if" statements should not have the same condition — covered by SST1475 +dotnet_diagnostic.S2114.severity = error # Collections should not be passed as arguments to their own methods — covered by SST2419 +dotnet_diagnostic.S2123.severity = error # Values should not be uselessly incremented -> replaced by SST2222 +dotnet_diagnostic.S2201.severity = error # Methods without side effects should not have their return values ignored — covered by SST2418 +dotnet_diagnostic.S2225.severity = error # "ToString()" method should not return null — covered by SST2431 +dotnet_diagnostic.S2251.severity = error # A "for" loop update clause should move the counter in the right direction — covered by SST2412 +dotnet_diagnostic.S2252.severity = error # For-loop conditions should be true at least once — covered by SST2413 +dotnet_diagnostic.S2445.severity = error # Blocks should be synchronized on read-only fields — covered by SST1904 +dotnet_diagnostic.S2688.severity = error # "NaN" should not be used in comparisons — covered by SST1473 +dotnet_diagnostic.S2757.severity = error # Non-existent operators like "=+" should not be used — covered by SST2417 +dotnet_diagnostic.S2761.severity = error # Doubled prefix operators "!!" and "~~" should not be used — covered by SST1190 +dotnet_diagnostic.S2995.severity = error # "Object.ReferenceEquals" should not be used for value types -> replaced by CA2013 +dotnet_diagnostic.S2996.severity = error # "ThreadStatic" fields should not be initialized -> replaced by CA2019 +dotnet_diagnostic.S2997.severity = error # "IDisposables" created in a "using" statement should not be returned — covered by SST2423 +dotnet_diagnostic.S3005.severity = error # "ThreadStatic" should not be used on non-static fields -> replaced by CA2259 +dotnet_diagnostic.S3168.severity = error # "async" methods should not return "void" — covered by SST1905 +dotnet_diagnostic.S3172.severity = error # Delegates should not be subtracted — covered by SST2448 +dotnet_diagnostic.S3244.severity = error # Anonymous delegates should not be used to unsubscribe from Events — covered by SST2449 +dotnet_diagnostic.S3249.severity = error # Covered by SST1447 (canonical) +dotnet_diagnostic.S3263.severity = error # Static fields should appear in the order they must be initialized — covered by SST2428 +dotnet_diagnostic.S3343.severity = error # Caller information parameters should come at the end of the parameter list — covered by SST2433 +dotnet_diagnostic.S3346.severity = error # Expressions used in "Debug.Assert" should not produce side effects — covered by SST2450 +dotnet_diagnostic.S3453.severity = error # Classes should not have only "private" constructors — covered by SST2451 +dotnet_diagnostic.S3466.severity = error # Optional parameters should be passed to "base" calls — covered by SST2425 +dotnet_diagnostic.S3598.severity = error # One-way "OperationContract" methods should have "void" return type -> replaced by obsolete (WCF) +dotnet_diagnostic.S3603.severity = error # Methods with "Pure" attribute should return a value — covered by SST2452 +dotnet_diagnostic.S3610.severity = error # Nullable type comparison should not be redundant -> replaced by compiler CS0472 +dotnet_diagnostic.S3903.severity = error # Types should be defined in named namespaces — covered by SST2312 +dotnet_diagnostic.S3923.severity = error # All branches in a conditional structure should not have exactly the same implementation — covered by SST1476 +dotnet_diagnostic.S3926.severity = error # Deserialization methods should be provided for "OptionalField" members -> replaced by obsolete (legacy binary serialization) +dotnet_diagnostic.S3927.severity = error # Serialization event handlers should be implemented correctly — covered by SST2430 +dotnet_diagnostic.S3981.severity = error # Collection sizes and array length comparisons should make sense — covered by SST1479 +dotnet_diagnostic.S3984.severity = error # Exceptions should not be created without being thrown — covered by SST1480 +dotnet_diagnostic.S4143.severity = error # Collection elements should not be replaced unconditionally — covered by SST1487 +dotnet_diagnostic.S4210.severity = error # Windows Forms entry points should be marked with STAThread -> replaced by SST2706 +dotnet_diagnostic.S4260.severity = error # "ConstructorArgument" parameters should exist in constructors -> replaced by SST2487 +dotnet_diagnostic.S4428.severity = error # "PartCreationPolicyAttribute" should be used with "ExportAttribute" — covered by SST2474 +dotnet_diagnostic.S6507.severity = error # Blocks should not be synchronized on local variables — covered by SST1903 +dotnet_diagnostic.S6677.severity = error # Message template placeholders should be unique — covered by SST2442 +dotnet_diagnostic.S6797.severity = error # Blazor query parameter type should be supported -> replaced by SST2702 +dotnet_diagnostic.S6798.severity = error # [JSInvokable] attribute should only be used on public methods -> replaced by SST2701 +dotnet_diagnostic.S6800.severity = error # Component parameter type should match the route parameter type constraint -> replaced by SST2703 +dotnet_diagnostic.S6930.severity = error # Backslash should be avoided in route templates -> replaced by SST2700 + +# Minor bugs +dotnet_diagnostic.S1206.severity = error # "Equals(Object)" and "GetHashCode()" should be overridden in pairs - DUPLICATE CA2218 +dotnet_diagnostic.S1226.severity = error # Method parameters, caught exceptions and foreach variables' initial values should not be ignored +dotnet_diagnostic.S2183.severity = error # Integral numbers should not be shifted by zero or more than their number of bits-1 — covered by SST1478 +dotnet_diagnostic.S2184.severity = error # Results of integer division should not be assigned to floating point variables — covered by SST1477 +dotnet_diagnostic.S2328.severity = error # "GetHashCode" should not reference mutable fields — covered by SST1482 +dotnet_diagnostic.S2345.severity = error # Flags enumerations should explicitly initialize all their members — covered by SST2303 +dotnet_diagnostic.S2674.severity = error # The length returned from a stream read should be checked — covered by SST2446 +dotnet_diagnostic.S2934.severity = error # Property assignments should not be made for "readonly" fields not constrained to reference types — covered by SST2421 +dotnet_diagnostic.S2955.severity = error # Generic parameters not constrained to reference types should not be compared to "null" -> replaced by compiler CS0019/CS0037 +dotnet_diagnostic.S3363.severity = error # Date and time should not be used as a type for primary keys — covered by SST2475 +dotnet_diagnostic.S3397.severity = error # "base.Equals" should not be used to check for reference equality in "Equals" if "base" is not "object" — covered by SST2435 +dotnet_diagnostic.S3456.severity = error # "string.ToCharArray()" and "ReadOnlySpan.ToArray()" should not be called redundantly — covered by PSH1217 +dotnet_diagnostic.S3887.severity = error # Mutable, non-private fields should not be "readonly" — covered by SST2322 + +# Blocker vulnerabilities +dotnet_diagnostic.S2115.severity = error # A secure password should be used when connecting to a database -> replaced by SES1203 +dotnet_diagnostic.S2755.severity = error # XML parsers should not be vulnerable to XXE attacks -> replaced by CA3075 +dotnet_diagnostic.S3884.severity = error # "CoSetProxyBlanket" and "CoInitializeSecurity" should not be used -> replaced by obsolete (COM interop security) +dotnet_diagnostic.S6418.severity = error # Secrets should not be hard-coded — covered by SES1201 + +# Critical vulnerabilities +dotnet_diagnostic.S4423.severity = error # Weak SSL/TLS protocols should not be used -> replaced by CA5397/CA5398 +dotnet_diagnostic.S4426.severity = error # Cryptographic keys should be robust -> replaced by CA5385 (RSA) / CA5384 (DSA) +dotnet_diagnostic.S4433.severity = error # LDAP connections should be authenticated -> replaced by SES1310 +dotnet_diagnostic.S4830.severity = error # Server certificates should be verified during SSL/TLS connections -> replaced by SES1102 or SES1108 +dotnet_diagnostic.S5344.severity = error # Passwords should not be stored in plaintext or with a fast hashing algorithm -> replaced by SES1009 +dotnet_diagnostic.S5445.severity = error # Insecure temporary file creation methods should not be used -> replaced by SES1307 +dotnet_diagnostic.S5542.severity = error # Encryption algorithms should be used with secure mode and padding scheme -> replaced by CA5358 +dotnet_diagnostic.S5547.severity = error # Cipher algorithms should be robust -> replaced by CA5351 +dotnet_diagnostic.S5659.severity = error # JWT should be signed and verified with strong cipher algorithms -> replaced by SES1503 + +# Major vulnerabilities +dotnet_diagnostic.S2068.severity = error # Credentials should not be hard-coded -> replaced by SES1201 +dotnet_diagnostic.S2612.severity = error # File permissions should not be set to world-accessible values -> replaced by SES1308 +dotnet_diagnostic.S4211.severity = error # Members should not have conflicting transparency annotations -> replaced by obsolete (Code Access Security) +dotnet_diagnostic.S4212.severity = error # Serialization constructors should be secured -> replaced by obsolete (Code Access Security) +dotnet_diagnostic.S6377.severity = error # XML signatures should be validated securely -> replaced by SES1008 +dotnet_diagnostic.S7039.severity = error # Content Security Policies should be restrictive -> replaced by SES1515 + +# Blocker code smells +dotnet_diagnostic.S1147.severity = error # Exit methods should not be called — covered by SST2321 +dotnet_diagnostic.S1451.severity = error # Track lack of copyright and license headers +dotnet_diagnostic.S2178.severity = error # Short-circuit logic should be used in boolean contexts — covered by SST2415 +dotnet_diagnostic.S2187.severity = error # Test classes should contain at least one test case — covered by SST2504 +dotnet_diagnostic.S2306.severity = error # "async" and "await" should not be used as identifiers -> replaced by compiler (contextual keyword) +dotnet_diagnostic.S2368.severity = error # Public methods should not have multidimensional array parameters — jagged arrays are the chosen layout for hot-path lookup tables +dotnet_diagnostic.S2387.severity = error # Child class fields should not shadow parent class fields — covered by SST1484 +dotnet_diagnostic.S2437.severity = error # Unnecessary bit operations should not be performed — covered by SST1481 +dotnet_diagnostic.S2699.severity = error # Tests should include assertions -> replaced by SST2500 +dotnet_diagnostic.S2953.severity = error # Methods named "Dispose" should implement "IDisposable.Dispose" — covered by SST2316 +dotnet_diagnostic.S2970.severity = error # Assertions should be complete -> replaced by SST2508 +dotnet_diagnostic.S3060.severity = error # "is" should not be used with "this" -> replaced by SST2327 +dotnet_diagnostic.S3237.severity = error # "value" contextual keyword should be used — covered by SST2429 +dotnet_diagnostic.S3427.severity = error # Method overloads with default parameter values should not overlap — covered by SST2319 +dotnet_diagnostic.S3433.severity = error # Test method signatures should be correct -> replaced by SST2509 +dotnet_diagnostic.S3443.severity = error # Type should not be examined on "System.Type" instances — covered by SST2432 +dotnet_diagnostic.S3875.severity = error # "operator==" should not be overloaded on reference types -> replaced by SST2464 +dotnet_diagnostic.S3877.severity = error # Exceptions should not be thrown from unexpected methods — covered by SST1485 +dotnet_diagnostic.S4462.severity = error # Calls to "async" methods should not be blocking - covered by PSH1315 +dotnet_diagnostic.S6422.severity = error # Calls to "async" methods should not be blocking in Azure Functions — covered by PSH1315 +dotnet_diagnostic.S6424.severity = error # Interfaces for durable entities should satisfy the restrictions -> off: Durable Entity-specific; not used in this library + +# Critical code smells +dotnet_diagnostic.S1006.severity = error # Method overrides should not change parameter defaults — covered by SST2424 +dotnet_diagnostic.S1067.severity = error # Expressions should not be too complex +dotnet_diagnostic.S1163.severity = error # Exceptions should not be thrown in finally blocks -> replaced by CA2219 +dotnet_diagnostic.S1186.severity = error # Methods should not be empty — covered by SST1438 +dotnet_diagnostic.S121.severity = error # Control structures should use curly braces (kept over SA1503 — Sonar 20ms vs SA1503 50ms) -> replaced by SST1503 +dotnet_diagnostic.S1215.severity = error # "GC.Collect" should not be called — covered by PSH1021 +dotnet_diagnostic.S126.severity = error # "if ... else if" constructs should end with "else" clauses +dotnet_diagnostic.S131.severity = error # "switch/Select" statements should contain a "default/Case Else" clauses +dotnet_diagnostic.S134.severity = error # Control flow statements "if", "switch", "for", "foreach", "while", "do" and "try" should not be nested too deeply +dotnet_diagnostic.S1541.severity = error # Methods and properties should not be too complex - covered by SST1442 +dotnet_diagnostic.S1699.severity = error # Constructors should only call non-overridable methods — covered by SST1483 +dotnet_diagnostic.S1821.severity = error # "switch" statements should not be nested -> replaced by SST2252 +dotnet_diagnostic.S1944.severity = error # Invalid casts should be avoided -> replaced by compiler CS0030 +dotnet_diagnostic.S1994.severity = error # "for" loop increment clauses should modify the loops' counters — covered by SST2411 +dotnet_diagnostic.S2197.severity = error # Modulus results should not be checked for direct equality — covered by SST2416 +dotnet_diagnostic.S2198.severity = error # Unnecessary mathematical comparisons should not be made -> replaced by SST2489 +dotnet_diagnostic.S2223.severity = error # Non-constant static fields should not be visible - DUPLICATE CA2211 +dotnet_diagnostic.S2290.severity = error # Field-like events should not be virtual -> replaced by SST2456 +dotnet_diagnostic.S2291.severity = error # Overflow checking should not be disabled for "Enumerable.Sum" — covered by SST2457 +dotnet_diagnostic.S2302.severity = error # "nameof" should be used — covered by SST1415 +dotnet_diagnostic.S2330.severity = error # Array covariance should not be used — covered by SST2434 +dotnet_diagnostic.S2339.severity = error # Public constant members should not be used — covered by SST2311 +dotnet_diagnostic.S2346.severity = error # Flags enumerations zero-value members should be named "None" - DUPLICATE CA1008 +dotnet_diagnostic.S2360.severity = error # Optional parameters should not be used — conflicts with SST2433, which owns caller-info parameters requiring a default +dotnet_diagnostic.S2365.severity = error # Properties should not make collection or array copies — covered by PSH1017 +dotnet_diagnostic.S2479.severity = error # Whitespace and control characters in string literals should be explicit — covered by SST1192 +dotnet_diagnostic.S2692.severity = error # "IndexOf" checks should not be for positive numbers — covered by SST2420 +dotnet_diagnostic.S2696.severity = error # Instance members should not write to "static" fields -> replaced by SST2402 +dotnet_diagnostic.S2701.severity = error # Literal boolean values should not be used in assertions — covered by SST2503 +dotnet_diagnostic.S3215.severity = error # "interface" instances should not be cast to concrete types -> deliberately unenforced, same reason as SST2326 +dotnet_diagnostic.S3216.severity = error # "ConfigureAwait(false)" should be used -> replaced by CA2007 +dotnet_diagnostic.S3217.severity = error # "Explicit" conversions of "foreach" loops should not be used — covered by SST2225 +dotnet_diagnostic.S3218.severity = error # Inner class members should not shadow outer class "static" or type members — covered by SST1484 +dotnet_diagnostic.S3265.severity = error # Non-flags enums should not be used in bitwise operations — covered by SST2458 +dotnet_diagnostic.S3353.severity = error # Unchanged variables should be marked as "const" — covered by PSH1402 +dotnet_diagnostic.S3447.severity = error # "[Optional]" should not be used on "ref" or "out" parameters — covered by SST2459 +dotnet_diagnostic.S3451.severity = error # "[DefaultValue]" should not be used when "[DefaultParameterValue]" is meant — covered by SST2460 +dotnet_diagnostic.S3600.severity = error # "params" should not be introduced on overrides — covered by SST2426 +dotnet_diagnostic.S3776.severity = error # Cognitive Complexity of methods should not be too high - covered by SST1443 +dotnet_diagnostic.S3871.severity = error # Exception types should be "public" -> replaced by CA1064 +dotnet_diagnostic.S3874.severity = error # "out" and "ref" parameters — repo idiom is TryX(..., out T value) +dotnet_diagnostic.S3904.severity = error # Assemblies should have version information -> replaced by obsolete (SDK supplies assembly version) +dotnet_diagnostic.S3937.severity = error # Number patterns should be regular — covered by SST1119 +dotnet_diagnostic.S3972.severity = error # Conditionals should start on new lines — covered by SST1146 +dotnet_diagnostic.S3973.severity = error # A conditionally executed single line should be denoted by indentation -> replaced by SST1503 +dotnet_diagnostic.S3998.severity = error # Threads should not lock on objects with weak identity -> replaced by SST1902 +dotnet_diagnostic.S4000.severity = error # Pointers to unmanaged memory should not be visible -> replaced by SST2328 +dotnet_diagnostic.S4015.severity = error # Inherited member visibility should not be decreased — covered by SST2462 +dotnet_diagnostic.S4019.severity = error # Base class methods should not be hidden — covered by SST2427 +dotnet_diagnostic.S4025.severity = error # Child class fields should not differ from parent class fields only by capitalization — covered by SST2463 +dotnet_diagnostic.S4039.severity = error # Interface methods should be callable by derived types - DUPLICATE CA1033 +dotnet_diagnostic.S4487.severity = error # Unread "private" fields should be removed +dotnet_diagnostic.S4524.severity = error # "default" clauses should be first or last — covered by SST1219 +dotnet_diagnostic.S4635.severity = error # Start index should be used instead of calling Substring — covered by PSH1218 +dotnet_diagnostic.S5034.severity = error # "ValueTask" should be consumed correctly — covered by PSH1316 +dotnet_diagnostic.S6967.severity = error # ModelState.IsValid should be called in controller actions -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S8367.severity = error # Identifiers should not conflict with the C# 14 "field" contextual keyword - the C# 14 compiler reports this: CS9273 (error) for a local named field in an accessor, CS9258 (warning) for a rebinding read +dotnet_diagnostic.S8368.severity = error # Identifiers should not conflict with the C# 14 "extension" contextual keyword - the C# 14 compiler reports this as CS9306, and SST1300 already flags the lowercase type name +dotnet_diagnostic.S8380.severity = error # Return types named "partial" should be escaped with "@" - the compiler reports this as CS8981, and SST1300 already flags the lowercase type name +dotnet_diagnostic.S8381.severity = error # "scoped" should be escaped when used as an identifier or type name in parenthesized lambda parameter lists -> replaced by compiler +dotnet_diagnostic.S927.severity = error # Parameter names should match base declaration and other partial definitions - DUPLICATE CA1725 + +# Major code smells +dotnet_diagnostic.S103.severity = error # Lines should not be too long — covered by SST1521 +dotnet_diagnostic.S104.severity = error # Files should not have too many lines of code — covered by SST1522 +dotnet_diagnostic.S106.severity = error # Covered by SST1449 (canonical) +dotnet_diagnostic.S1066.severity = error # Mergeable "if" statements should be combined — covered by SST2013 +dotnet_diagnostic.S107.severity = error # Methods should not have too many parameters — covered by SST1472 +dotnet_diagnostic.S108.severity = error # Nested blocks of code should not be left empty — covered by SST1439 +dotnet_diagnostic.S109.severity = error # Magic numbers should not be used — covered by SST1471 +dotnet_diagnostic.S110.severity = error # Inheritance tree of classes should not be too deep — covered by SST1446 +dotnet_diagnostic.S1110.severity = error # Redundant pairs of parentheses should be removed — covered by SST1459 +dotnet_diagnostic.S1117.severity = error # Local variables should not shadow class fields or properties — covered by SST1484 +dotnet_diagnostic.S1118.severity = error # Utility classes should not have public constructors - DUPLICATE CA1052 +dotnet_diagnostic.S112.severity = error # General or reserved exceptions should never be thrown — covered by SST2409 +dotnet_diagnostic.S1121.severity = error # Assignments should not be made from within sub-expressions — covered by SST1187 +dotnet_diagnostic.S1123.severity = error # "Obsolete" attributes should include explanations — covered by SST2308 +dotnet_diagnostic.S1134.severity = error # Track uses of "FIXME" tags -> off: TODO comment tracker; not enforced here +dotnet_diagnostic.S1144.severity = error # Covered by SST1440 (canonical) +dotnet_diagnostic.S1151.severity = error # "switch case" clauses should not have too many lines of code — covered by SST1524 +dotnet_diagnostic.S1168.severity = error # Empty arrays and collections should be returned instead of null — covered by SST2306 +dotnet_diagnostic.S1172.severity = error # Unused method parameters should be removed — covered by SST1461 +dotnet_diagnostic.S1200.severity = error # Classes should not be coupled to too many other classes +dotnet_diagnostic.S122.severity = error # Statements should be on separate lines — covered by SST1107 +dotnet_diagnostic.S125.severity = error # Sections of code should not be commented out — covered by SST1148 +dotnet_diagnostic.S127.severity = error # "for" loop stop conditions should be invariant — covered by SST2465 +dotnet_diagnostic.S138.severity = error # Functions should not have too many lines of code — covered by SST1523 +dotnet_diagnostic.S1479.severity = error # "switch" statements with many "case" clauses — covered by SST1423 +dotnet_diagnostic.S1607.severity = error # Tests should not be ignored -> off: ignored-test tracker; not enforced here +dotnet_diagnostic.S1696.severity = error # NullReferenceException should not be caught — covered by SST2401 +dotnet_diagnostic.S1854.severity = error # Unused assignments should be removed - DUPLICATE IDE0059 +dotnet_diagnostic.S1871.severity = error # Two branches in a conditional structure should not have exactly the same implementation — covered by SST2414 +dotnet_diagnostic.S2139.severity = error # Exceptions should be either logged or rethrown but not both -> replaced by SST2488 +dotnet_diagnostic.S2166.severity = error # Classes named like "Exception" should extend "Exception" or a subclass - DUPLICATE CA1710 +dotnet_diagnostic.S2234.severity = error # Arguments should be passed in the same order as the method parameters -> replaced by SST2400 +dotnet_diagnostic.S2326.severity = error # Covered by SST1452 (canonical) +dotnet_diagnostic.S2327.severity = error # "try" statements with identical "catch" and/or "finally" blocks should be merged -> replaced by SST2490 +dotnet_diagnostic.S2357.severity = error # Fields should be private — duplicate of SST1401 (canonical); fields intentionally exposed (e.g. public test fields for reflection) already carry per-site SST1401 suppressions +dotnet_diagnostic.S2372.severity = error # Exceptions should not be thrown from property getters — covered by SST1485 +dotnet_diagnostic.S2376.severity = error # Write-only properties should not be used — covered by SST1421 +dotnet_diagnostic.S2629.severity = error # Logging templates should be constant -> replaced by CA2254 +dotnet_diagnostic.S2681.severity = error # Multiline blocks should be enclosed in curly braces — covered by SST1503 +dotnet_diagnostic.S2743.severity = error # Static fields should not be used in generic types - DUPLICATE CA1000 — covered by SST1431 +dotnet_diagnostic.S2925.severity = error # "Thread.Sleep" should not be used in tests — covered by SST2506 +dotnet_diagnostic.S2933.severity = error # Fields that are only assigned in the constructor should be "readonly" - DUPLICATE IDE0044 +dotnet_diagnostic.S2971.severity = error # LINQ expressions should be simplified — covered by PSH1101/PSH1102 +dotnet_diagnostic.S3010.severity = error # Static fields should not be updated in constructors — covered by SST2402 +dotnet_diagnostic.S3011.severity = error # Reflection should not be used to increase accessibility of classes, methods, or fields -> replaced by SES1406 +dotnet_diagnostic.S3059.severity = error # Types should not have members with visibility set higher than the type's visibility +dotnet_diagnostic.S3063.severity = error # "StringBuilder" data should be used — covered by SST2408 +dotnet_diagnostic.S3169.severity = error # Multiple "OrderBy" calls should not be used — covered by PSH1108 +dotnet_diagnostic.S3246.severity = error # Generic type parameters should be co/contravariant when possible -> off: low-precision variance suggestion; not enforced +dotnet_diagnostic.S3262.severity = error # "params" should be used on overrides — covered by SST2426 +dotnet_diagnostic.S3264.severity = error # Events should be invoked — covered by SST2407 +dotnet_diagnostic.S3358.severity = error # Ternary operators should not be nested — covered by SST1147 +dotnet_diagnostic.S3366.severity = error # "this" should not be exposed from constructors — covered by SST2403 +dotnet_diagnostic.S3415.severity = error # Assertion arguments should be passed in the correct order — covered by SST2502 +dotnet_diagnostic.S3431.severity = error # "[ExpectedException]" should not be used — covered by SST2507 +dotnet_diagnostic.S3442.severity = error # "abstract" classes should not have "public" constructors — covered by SST1428 +dotnet_diagnostic.S3445.severity = error # Exceptions should not be explicitly rethrown — covered by SST1430 +dotnet_diagnostic.S3457.severity = error # Composite format strings should be used correctly — covered by SST1454 +dotnet_diagnostic.S3597.severity = error # "ServiceContract" and "OperationContract" attributes should be used together -> replaced by obsolete (WCF) +dotnet_diagnostic.S3880.severity = error # Finalizers should not be empty — covered by PSH1002 +dotnet_diagnostic.S3881.severity = error # "IDisposable" should be implemented correctly — covered by SST2300 +dotnet_diagnostic.S3885.severity = error # "Assembly.Load" should be used -> replaced by SST2486 +dotnet_diagnostic.S3898.severity = error # Covered by PSH1005 (canonical) +dotnet_diagnostic.S3902.severity = error # Covered by PSH1404 (canonical) +dotnet_diagnostic.S3906.severity = error # Event Handlers should have the correct signature — covered by SST2304 +dotnet_diagnostic.S3908.severity = error # Generic event handlers should be used -> replaced by SST2304 +dotnet_diagnostic.S3909.severity = error # Collections should implement the generic interface -> replaced by CA1010 +dotnet_diagnostic.S3925.severity = error # "ISerializable" should be implemented correctly - BinaryFormatter / ISerializable serialization is obsoleted (SYSLIB0050/0051) in modern .NET; we do not opt into legacy serialization for any exception type +dotnet_diagnostic.S3928.severity = error # Parameter names used into ArgumentException constructors should match an existing one - DUPLICATE CA2208 +dotnet_diagnostic.S3956.severity = error # "Generic.List" instances should not be part of public APIs +dotnet_diagnostic.S3971.severity = error # "GC.SuppressFinalize" should not be called — conflicts with PSH1008, which owns the pointless-SuppressFinalize direction and exempts unsealed types +dotnet_diagnostic.S3990.severity = error # Assemblies should be marked as CLS compliant -> replaced by CA1014 +dotnet_diagnostic.S3992.severity = error # Assemblies should explicitly specify COM visibility -> replaced by CA1017 +dotnet_diagnostic.S3993.severity = error # Custom attributes should be marked with "System.AttributeUsageAttribute" -> replaced by CA1018 +dotnet_diagnostic.S3994.severity = error # URI Parameters should not be strings +dotnet_diagnostic.S3995.severity = error # URI return values should not be strings +dotnet_diagnostic.S3996.severity = error # URI properties should not be strings +dotnet_diagnostic.S3997.severity = error # String URI overloads should call "System.Uri" overloads -> replaced by CA1054/CA1056/CA1057 +dotnet_diagnostic.S4002.severity = error # Disposable types should declare finalizers — covered by SST2317 +dotnet_diagnostic.S4004.severity = error # Collection properties should be readonly — covered by SST2305 +dotnet_diagnostic.S4005.severity = error # "System.Uri" arguments should be used instead of strings +dotnet_diagnostic.S4016.severity = error # Enumeration members should not be named "Reserved" -> replaced by CA1700 +dotnet_diagnostic.S4017.severity = error # Method signatures should not contain nested generic types +dotnet_diagnostic.S4035.severity = error # Classes implementing "IEquatable" should be sealed — covered by SST2301 +dotnet_diagnostic.S4050.severity = error # Operators should be overloaded consistently — covered by SST2302 +dotnet_diagnostic.S4055.severity = error # Literals should not be passed as localized parameters +dotnet_diagnostic.S4057.severity = error # Locales should be set for data types -> replaced by obsolete +dotnet_diagnostic.S4059.severity = error # Property names should not match get methods - DUPLICATE CA1721 +dotnet_diagnostic.S4070.severity = error # Non-flags enums should not be marked with "FlagsAttribute" — covered by SST2303 +dotnet_diagnostic.S4144.severity = error # Methods should not have identical implementations — covered by SST2318 +dotnet_diagnostic.S4200.severity = error # Native methods should be wrapped -> replaced by CA1401 +dotnet_diagnostic.S4214.severity = error # "P/Invoke" methods should not be visible - DUPLICATE CA1401 +dotnet_diagnostic.S4220.severity = error # Events should have proper arguments — covered by SST2436 +dotnet_diagnostic.S4456.severity = error # Parameter validation in yielding methods should be wrapped — covered by SST2404 +dotnet_diagnostic.S4457.severity = error # Parameter validation in "async"/"await" methods should be wrapped — covered by SST2325 +dotnet_diagnostic.S4545.severity = error # "DebuggerDisplayAttribute" strings should reference existing members — covered by SST2405 +dotnet_diagnostic.S4581.severity = error # "new Guid()" should not be used — covered by SST2012 +dotnet_diagnostic.S6354.severity = error # Use a testable date/time provider — covered by SST2010 +dotnet_diagnostic.S6419.severity = error # Azure Functions should be stateless -> off: Azure Functions-specific; not used in this library +dotnet_diagnostic.S6420.severity = error # Client instances should not be recreated on each Azure Function invocation — covered by PSH1418 +dotnet_diagnostic.S6421.severity = error # Azure Functions should use Structured Error Handling -> off: Azure Functions-specific; not used in this library +dotnet_diagnostic.S6423.severity = error # Azure Functions should log all failures -> off: Azure Functions-specific; not used in this library +dotnet_diagnostic.S6561.severity = error # Avoid using "DateTime.Now" for benchmarking or timing operations — covered by PSH1408 +dotnet_diagnostic.S6562.severity = error # Covered by SST1451 (canonical) +dotnet_diagnostic.S6563.severity = error # Use UTC when recording DateTime instants — covered by SST2011 +dotnet_diagnostic.S6566.severity = error # Use "DateTimeOffset" instead of "DateTime" — covered by SST2016 +dotnet_diagnostic.S6575.severity = error # Use "TimeZoneInfo.FindSystemTimeZoneById" without converting the timezones with "TimezoneConverter" -> replaced by PSH1419 +dotnet_diagnostic.S6580.severity = error # Use a format provider when parsing date and time - DUPLICATE CA1305 +dotnet_diagnostic.S6673.severity = error # Log message template placeholders should be in the right order — covered by SST2440 +dotnet_diagnostic.S6802.severity = error # Using lambda expressions in loops should be avoided in Blazor markup section -> replaced by PSH1600 +dotnet_diagnostic.S6803.severity = error # Parameters with SupplyParameterFromQuery attribute should be used only in routable components -> off: Blazor-specific; no Blazor surface in this library +dotnet_diagnostic.S6931.severity = error # ASP.NET controller actions should not have a route template starting with "/" -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6932.severity = error # Use model binding instead of reading raw request data -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6934.severity = error # A Route attribute should be added to the controller when a route template is specified at the action level -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6960.severity = error # Controllers should not have mixed responsibilities -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6961.severity = error # API Controllers should derive from ControllerBase instead of Controller -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6962.severity = error # You should pool HTTP connections with HttpClientFactory — covered by PSH1418 +dotnet_diagnostic.S6964.severity = error # Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting. -> replaced by SST2705 (opt-in) +dotnet_diagnostic.S6965.severity = error # REST API actions should be annotated with an HTTP verb attribute -> replaced by SST2704 +dotnet_diagnostic.S6966.severity = error # Awaitable method should be used — covered by PSH1313 +dotnet_diagnostic.S6968.severity = error # Actions that return a value should be annotated with ProducesResponseTypeAttribute containing the return type -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S881.severity = error # Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression — covered by SST2015 +dotnet_diagnostic.S907.severity = error # "goto" statement should not be used — covered by SST2014 + +# Minor code smells +dotnet_diagnostic.S100.severity = error # Methods and properties should be named in PascalCase — covered by SST1300 +dotnet_diagnostic.S101.severity = error # Types should be named in PascalCase — covered by SST1300 +dotnet_diagnostic.S105.severity = error # Tabulation characters should not be used — covered by SST1027 +dotnet_diagnostic.S1104.severity = error # Fields should not have public accessibility - DUPLICATE CA1051 +dotnet_diagnostic.S1109.severity = error # A close curly brace should be located at the beginning of a line — covered by SST1500 +dotnet_diagnostic.S1116.severity = error # Empty statements should be removed - DUPLICATE SA1106 +dotnet_diagnostic.S1125.severity = error # Boolean literals should not be redundant — covered by SST1182 +dotnet_diagnostic.S1128.severity = error # Covered by SST1445 (canonical) +dotnet_diagnostic.S113.severity = error # Files should end with a newline +dotnet_diagnostic.S1155.severity = error # "Any()" should be used to test for emptiness — covered by PSH1119 +dotnet_diagnostic.S1185.severity = error # Overriding members should do more than simply call the same member in the base class - DUPLICATE RCS1132 +dotnet_diagnostic.S1192.severity = error # String literals should not be duplicated — covered by SST1486 +dotnet_diagnostic.S1199.severity = error # Nested code blocks should not be used — covered by SST1138 +dotnet_diagnostic.S1210.severity = error # "Equals" and the comparison operators should be overridden when implementing "IComparable" - DUPLICATE CA1036 +dotnet_diagnostic.S1227.severity = error # break statements should not be used except for switch cases +dotnet_diagnostic.S1264.severity = error # A "while" loop should be used instead of a "for" loop — covered by SST2245 +dotnet_diagnostic.S1301.severity = error # "switch" statements should have at least 3 "case" clauses +dotnet_diagnostic.S1312.severity = error # Logger fields should be "private static readonly" +dotnet_diagnostic.S1449.severity = error # Culture should be specified for "string" operations — covered by PSH1207 +dotnet_diagnostic.S1450.severity = error # Private fields only used as local variables in methods should become local variables — covered by SST1422 +dotnet_diagnostic.S1481.severity = error # Unused local variables should be removed — covered by SST1497 +dotnet_diagnostic.S1643.severity = error # Covered by PSH1206 (canonical) +dotnet_diagnostic.S1659.severity = error # Multiple variables should not be declared on the same line — covered by SST1132 +dotnet_diagnostic.S1694.severity = error # An abstract class should have both abstract and concrete methods — covered by SST2323 +dotnet_diagnostic.S1698.severity = error # "==" should not be used when "Equals" is overridden — covered by SST1495 +dotnet_diagnostic.S1858.severity = error # "ToString()" calls should not be redundant — covered by PSH1211 +dotnet_diagnostic.S1905.severity = error # Redundant casts should not be used - DUPLICATE IDE0004 — covered by SST1175 +dotnet_diagnostic.S1939.severity = error # Inheritance list should not be redundant — covered by SST1490 and SST1177 +dotnet_diagnostic.S1940.severity = error # Boolean checks should not be inverted — covered by SST1172 +dotnet_diagnostic.S2094.severity = error # Classes should not be empty — covered by SST1436 +dotnet_diagnostic.S2148.severity = error # Underscores should be used to make large numbers readable — covered by SST1191 +dotnet_diagnostic.S2156.severity = error # "sealed" classes should not have "protected" members — covered by SST1427 +dotnet_diagnostic.S2219.severity = error # Runtime type checking should be simplified — covered by SST2007 +dotnet_diagnostic.S2221.severity = error # "Exception" should not be caught +dotnet_diagnostic.S2292.severity = error # Trivial properties should be auto-implemented — covered by SST1420 +dotnet_diagnostic.S2325.severity = error # Methods and properties that don't access instance data should be static - DUPLICATE CA1822 +dotnet_diagnostic.S2333.severity = error # Redundant modifiers should not be used — covered by SST1419/SST1491 +dotnet_diagnostic.S2342.severity = error # Enumeration types should comply with a naming convention — covered by SST1319 +dotnet_diagnostic.S2344.severity = error # Enumeration type names should not have "Flags" or "Enum" suffixes - DUPLICATE CA1711 +dotnet_diagnostic.S2386.severity = error # Mutable fields should not be "public static" — covered by SST1499 +dotnet_diagnostic.S2486.severity = error # Generic exceptions should not be ignored — covered by SST1429 +dotnet_diagnostic.S2737.severity = error # "catch" clauses should do more than rethrow — covered by SST1470 +dotnet_diagnostic.S2760.severity = error # Sequential tests should not check the same condition — covered by SST1475 +dotnet_diagnostic.S3052.severity = error # Covered by PSH1403 (canonical) +dotnet_diagnostic.S3220.severity = error # Method calls should not resolve ambiguously to overloads with "params" — covered by SST2467 +dotnet_diagnostic.S3234.severity = error # Covered by PSH1008 (canonical) +dotnet_diagnostic.S3235.severity = error # Redundant parentheses should not be used — covered by SST1459 +dotnet_diagnostic.S3236.severity = error # Covered by SST1448 (canonical) +dotnet_diagnostic.S3240.severity = error # The simplest possible condition syntax should be used - duplicate of SST1198 +dotnet_diagnostic.S3241.severity = error # Methods should not return values that are never used -> off: needs whole-program analysis; not enforced here +dotnet_diagnostic.S3242.severity = error # Method parameters should be declared with base types +dotnet_diagnostic.S3247.severity = error # Duplicate casts should not be made — covered by SST1175 +dotnet_diagnostic.S3251.severity = error # Implementations should be provided for "partial" methods — covered by SST2468 +dotnet_diagnostic.S3253.severity = error # Constructor and destructor declarations should not be redundant — covered by SST1433 +dotnet_diagnostic.S3254.severity = error # Default parameter values should not be passed as arguments — covered by SST1494 +dotnet_diagnostic.S3256.severity = error # "string.IsNullOrEmpty" should be used — covered by PSH1204 (style configurable) +dotnet_diagnostic.S3257.severity = error # Declarations and initializations should be as concise as possible -> replaced by SST2202 +dotnet_diagnostic.S3260.severity = error # Non-derived "private" classes and records should be "sealed" — covered by PSH1411 +dotnet_diagnostic.S3261.severity = error # Namespaces should not be empty — covered by SST1435 +dotnet_diagnostic.S3267.severity = error # Loops should be simplified with "LINQ" expressions +dotnet_diagnostic.S3376.severity = error # Attribute, EventArgs, and Exception type names should end with the type being extended - DUPLICATE CA1710 +dotnet_diagnostic.S3398.severity = error # "private" methods called only by inner classes should be moved to those classes — covered by SST1498 +dotnet_diagnostic.S3400.severity = error # Methods should not return constants — covered by SST1493 +dotnet_diagnostic.S3416.severity = error # Loggers should be named for their enclosing types — covered by SST2443 +dotnet_diagnostic.S3440.severity = error # Variables should not be checked against the values they're about to be assigned — covered by SST1492 +dotnet_diagnostic.S3441.severity = error # Redundant property names should be omitted in anonymous classes — covered by SST1173 +dotnet_diagnostic.S3444.severity = error # Interfaces should not simply inherit from base interfaces with colliding members — covered by SST2320 +dotnet_diagnostic.S3450.severity = error # Parameters with "[DefaultParameterValue]" attributes should also be marked "[Optional]" -> replaced by obsolete (legacy DefaultParameterValue) +dotnet_diagnostic.S3458.severity = error # Empty "case" clauses that fall through to the "default" should be omitted — covered by SST1466 +dotnet_diagnostic.S3459.severity = error # Unassigned members should be removed - the compiler reports this as CS0649; the rule only ever fires on private never-assigned fields +dotnet_diagnostic.S3532.severity = error # Empty "default" clauses should be removed — covered by SST1179 +dotnet_diagnostic.S3604.severity = error # Member initializer values should not be redundant — covered by PSH1403 +dotnet_diagnostic.S3626.severity = error # Jump statements should not be redundant — covered by SST1174 +dotnet_diagnostic.S3717.severity = error # Track use of "NotImplementedException" -> replaced by SST2485 +dotnet_diagnostic.S3872.severity = error # Parameter names should not duplicate the names of their methods -> replaced by SST1320 +dotnet_diagnostic.S3876.severity = error # Strings or integral types should be used for indexers -> replaced by CA1043 +dotnet_diagnostic.S3878.severity = error # Arrays should not be created for params parameters — covered by PSH1018 +dotnet_diagnostic.S3897.severity = error # Classes that provide "Equals()" should implement "IEquatable" -> replaced by CA1067 +dotnet_diagnostic.S3962.severity = error # Covered by PSH1402 (canonical) +dotnet_diagnostic.S3963.severity = error # "static" fields should be initialized inline - DUPLICATE CA1810 +dotnet_diagnostic.S3967.severity = error # Multidimensional arrays should not be used - DUPLICATE CA1814 +dotnet_diagnostic.S4018.severity = error # All type parameters should be used in the parameter list to enable type inference — covered by SST2307 +dotnet_diagnostic.S4022.severity = error # Enumerations should have "Int32" storage — covered by SST2313 +dotnet_diagnostic.S4023.severity = error # Interfaces should not be empty — covered by SST1437 +dotnet_diagnostic.S4026.severity = error # Assemblies should be marked with "NeutralResourcesLanguageAttribute" -> replaced by CA1824 +dotnet_diagnostic.S4027.severity = error # Exceptions should provide standard constructors — covered by SST1488 +dotnet_diagnostic.S4040.severity = error # Strings should be normalized to uppercase - DUPLICATE CA1308 +dotnet_diagnostic.S4041.severity = error # Type names should not match namespaces - DUPLICATE CA1724 +dotnet_diagnostic.S4047.severity = error # Generics should be used when appropriate -> off: fuzzy prefer-generics suggestion; not enforced +dotnet_diagnostic.S4049.severity = error # Properties should be preferred - DUPLICATE CA1024 +dotnet_diagnostic.S4052.severity = error # Types should not extend outdated base types -> replaced by obsolete +dotnet_diagnostic.S4056.severity = error # Overloads with a "CultureInfo" or an "IFormatProvider" parameter should be used - DUPLICATE CA1305 +dotnet_diagnostic.S4058.severity = error # Covered by PSH1207 (canonical) +dotnet_diagnostic.S4060.severity = error # Non-abstract attributes should be sealed - DUPLICATE CA1813 +dotnet_diagnostic.S4061.severity = error # "params" should be used instead of "varargs" -> replaced by obsolete (__arglist varargs) +dotnet_diagnostic.S4069.severity = error # Operator overloads should have named alternatives - DUPLICATE CA2225 +dotnet_diagnostic.S4136.severity = error # Method overloads should be grouped together — covered by SST1218 +dotnet_diagnostic.S4201.severity = error # Null checks should not be combined with "is" operator checks — covered by SST2018 +dotnet_diagnostic.S4225.severity = error # Extension methods should not extend "object" — covered by SST1706 +dotnet_diagnostic.S4226.severity = error # Extensions should be in separate namespaces +dotnet_diagnostic.S4261.severity = error # Methods should be named according to their synchronicities - Async suffix not used +dotnet_diagnostic.S4663.severity = error # Covered by SST1120 (canonical) +dotnet_diagnostic.S6513.severity = error # "ExcludeFromCodeCoverage" attributes should include a justification - not available on net462 and older TFMs +dotnet_diagnostic.S6585.severity = error # Don't hardcode the format when turning dates and times to strings — covered by SST2445 +dotnet_diagnostic.S6588.severity = error # Use the "UnixEpoch" field instead of creating "DateTime" instances that point to the beginning of the Unix epoch — covered by PSH1413 +dotnet_diagnostic.S6594.severity = error # Covered by PSH1406 (canonical) +dotnet_diagnostic.S6602.severity = error # Covered by PSH1110 (canonical) +dotnet_diagnostic.S6603.severity = error # Covered by PSH1110 (canonical) +dotnet_diagnostic.S6605.severity = error # Covered by PSH1110 (canonical) +dotnet_diagnostic.S6607.severity = error # The collection should be filtered before sorting — covered by PSH1107 +dotnet_diagnostic.S6608.severity = error # Covered by PSH1106 (canonical) +dotnet_diagnostic.S6609.severity = error # "Min/Max" properties of "Set" types should be used instead of the "Enumerable" extension methods — covered by PSH1122 +dotnet_diagnostic.S6610.severity = error # Covered by PSH1201 (canonical) +dotnet_diagnostic.S6612.severity = error # The lambda parameter should be used instead of capturing arguments in "ConcurrentDictionary" methods — covered by PSH1006 +dotnet_diagnostic.S6613.severity = error # "First" and "Last" properties of "LinkedList" should be used instead of the "First()" and "Last()" extension methods — covered by PSH1124 +dotnet_diagnostic.S6617.severity = error # Covered by PSH1111 (canonical) +dotnet_diagnostic.S6618.severity = error # "string.Create" should be used instead of "FormattableString" — covered by PSH1209 +dotnet_diagnostic.S6664.severity = error # The code block contains too many logging calls -> off: fuzzy too-many-logging-calls metric; not enforced +dotnet_diagnostic.S6667.severity = error # Logging in a catch clause should pass the caught exception as a parameter. — covered by SST2438 +dotnet_diagnostic.S6668.severity = error # Logging arguments should be passed to the correct parameter — covered by SST2439 +dotnet_diagnostic.S6669.severity = error # Logger field or property name should comply with a naming convention -> replaced by SST2601 +dotnet_diagnostic.S6670.severity = error # "Trace.Write" and "Trace.WriteLine" should not be used — covered by SST2600 +dotnet_diagnostic.S6672.severity = error # Generic logger injection should match enclosing type — covered by SST2443 +dotnet_diagnostic.S6675.severity = error # "Trace.WriteLineIf" should not be used with "TraceSwitch" levels -> off: niche TraceSwitch misuse; not enforced here +dotnet_diagnostic.S6678.severity = error # Use PascalCase for named placeholders -> replaced by CA1727 +dotnet_diagnostic.S818.severity = error # Literal suffixes should be upper case — covered by SST2244 + +# Informational code smells +dotnet_diagnostic.S1133.severity = error # Deprecated code should be removed — covered by SST2310 +dotnet_diagnostic.S1135.severity = error # Track uses of "TODO" tags -> off: FIXME comment tracker; not enforced here +dotnet_diagnostic.S1309.severity = error # Track uses of in-source issue suppressions + +# Uncategorized dotnet_diagnostic.S9999-cpd.severity = error # Copy-paste token calculator dotnet_diagnostic.S9999-log.severity = error # Log generator dotnet_diagnostic.S9999-metadata.severity = error # File metadata generator @@ -2652,36 +2631,30 @@ dotnet_diagnostic.S9999-testMethodDeclaration.severity = error # Test method dec dotnet_diagnostic.S9999-token-type.severity = error # Token type calculator dotnet_diagnostic.S9999-warning.severity = error # Analysis Warning generator -################### -# SonarAnalyzer (Sxxxx) - Critical Security Hotspot -################### -dotnet_diagnostic.S2245.severity = none # Using pseudorandom number generators (PRNGs) is security-sensitive - DUPLICATE CA5394 -dotnet_diagnostic.S2257.severity = none # Using non-standard cryptographic algorithms is security-sensitive -> replaced by SES1007 -dotnet_diagnostic.S4502.severity = none # Disabling CSRF protections is security-sensitive -> replaced by in-box ASP.NET antiforgery analyzer -dotnet_diagnostic.S4790.severity = none # Using weak hashing algorithms is security-sensitive -> replaced by CA5350/CA5351 -dotnet_diagnostic.S4792.severity = none # Configuring loggers is security-sensitive -> off: logging-configuration audit hotspot; not enforced here -dotnet_diagnostic.S5042.severity = none # Expanding archive files without controlling resource consumption is security-sensitive -> off: unbounded decompression; needs taint analysis, out of scope -dotnet_diagnostic.S5332.severity = none # Using clear-text protocols is security-sensitive -> replaced by SES1106 -dotnet_diagnostic.S5443.severity = none # Using publicly writable directories is security-sensitive -> replaced by SES1308 - -################### -# SonarAnalyzer (Sxxxx) - Major Security Hotspot -################### -dotnet_diagnostic.S1313.severity = none # Using hardcoded IP addresses is security-sensitive -> off: hardcoded-IP heuristic; too noisy to enforce -dotnet_diagnostic.S2077.severity = none # Formatting SQL queries is security-sensitive -> replaced by CA2100 -dotnet_diagnostic.S5693.severity = none # Allowing requests with excessive content length is security-sensitive -> replaced by SES1505 -dotnet_diagnostic.S5753.severity = none # Disabling ASP.NET "Request Validation" feature is security-sensitive -> replaced by obsolete (legacy ASP.NET request validation) -dotnet_diagnostic.S5766.severity = none # Creating Serializable objects without data validation checks is security-sensitive -> off: legacy BinaryFormatter deserialization; obsolete path, not used here -dotnet_diagnostic.S6444.severity = none # Not specifying a timeout for regular expressions is security-sensitive -> replaced by SES1509 -dotnet_diagnostic.S6640.severity = none # Using unsafe code blocks is security-sensitive -> off: unsafe-code audit; not enforced here - -################### -# SonarAnalyzer (Sxxxx) - Minor Security Hotspot -################### -dotnet_diagnostic.S2092.severity = none # Creating cookies without the "secure" flag is security-sensitive -> replaced by CA5382 -dotnet_diagnostic.S3330.severity = none # Creating cookies without the "HttpOnly" flag is security-sensitive -> replaced by CA5383 -dotnet_diagnostic.S4507.severity = none # Delivering code in production with debug features activated is security-sensitive -> off: debug features in production; partly covered by SES1506, rest not enforced -dotnet_diagnostic.S5122.severity = none # Having a permissive Cross-Origin Resource Sharing policy is security-sensitive -> replaced by SES1501 +# Critical security hotspots +dotnet_diagnostic.S2245.severity = error # Using pseudorandom number generators (PRNGs) is security-sensitive - DUPLICATE CA5394 +dotnet_diagnostic.S2257.severity = error # Using non-standard cryptographic algorithms is security-sensitive -> replaced by SES1007 +dotnet_diagnostic.S4502.severity = error # Disabling CSRF protections is security-sensitive -> replaced by in-box ASP.NET antiforgery analyzer +dotnet_diagnostic.S4790.severity = error # Using weak hashing algorithms is security-sensitive -> replaced by CA5350/CA5351 +dotnet_diagnostic.S4792.severity = error # Configuring loggers is security-sensitive -> off: logging-configuration audit hotspot; not enforced here +dotnet_diagnostic.S5042.severity = error # Expanding archive files without controlling resource consumption is security-sensitive -> off: unbounded decompression; needs taint analysis, out of scope +dotnet_diagnostic.S5332.severity = error # Using clear-text protocols is security-sensitive -> replaced by SES1106 +dotnet_diagnostic.S5443.severity = error # Using publicly writable directories is security-sensitive -> replaced by SES1308 + +# Major security hotspots +dotnet_diagnostic.S1313.severity = error # Using hardcoded IP addresses is security-sensitive -> off: hardcoded-IP heuristic; too noisy to enforce +dotnet_diagnostic.S2077.severity = error # Formatting SQL queries is security-sensitive -> replaced by CA2100 +dotnet_diagnostic.S5693.severity = error # Allowing requests with excessive content length is security-sensitive -> replaced by SES1505 +dotnet_diagnostic.S5753.severity = error # Disabling ASP.NET "Request Validation" feature is security-sensitive -> replaced by obsolete (legacy ASP.NET request validation) +dotnet_diagnostic.S5766.severity = error # Creating Serializable objects without data validation checks is security-sensitive -> off: legacy BinaryFormatter deserialization; obsolete path, not used here +dotnet_diagnostic.S6444.severity = error # Not specifying a timeout for regular expressions is security-sensitive -> replaced by SES1509 +dotnet_diagnostic.S6640.severity = error # Using unsafe code blocks is security-sensitive -> off: unsafe-code audit; not enforced here + +# Minor security hotspots +dotnet_diagnostic.S2092.severity = error # Creating cookies without the "secure" flag is security-sensitive -> replaced by CA5382 +dotnet_diagnostic.S3330.severity = error # Creating cookies without the "HttpOnly" flag is security-sensitive -> replaced by CA5383 +dotnet_diagnostic.S4507.severity = error # Delivering code in production with debug features activated is security-sensitive -> off: debug features in production; partly covered by SES1506, rest not enforced +dotnet_diagnostic.S5122.severity = error # Having a permissive Cross-Origin Resource Sharing policy is security-sensitive -> replaced by SES1501 ############################################# # JetBrains ReSharper / Rider Inspections @@ -2864,4 +2837,11 @@ indent_size = 2 end_of_line = lf [*.{cmd, bat}] -end_of_line = crlf +end_of_line = lf + +############################################# +# Test projects (TUnit) +############################################# +# TUnit instantiates test classes per test, so they must remain instance classes and +# cannot be marked static — even when a partial declaration happens to hold only static +# members (the instance [Test] methods live in sibling partial files). From bfa2c3dbfd55527e71b3df60fe7c2d85a6e309f2 Mon Sep 17 00:00:00 2001 From: Glenn Watson <5834289+glennawatson@users.noreply.github.com> Date: Sat, 8 Aug 2026 13:52:57 +1000 Subject: [PATCH 2/2] build: raise the analyzer rules to error and fix the reported code - Enable every StyleSharp, PerformanceSharp, SecuritySharp and public API rule as an error, except those that conflict with an existing setting. - Record the conflict in a comment beside each rule left disabled. - Track the var-versus-explicit preference through stylesharp.use_var so the rule follows the csharp_style_var_* settings already in the file. - Fix the reported code across the runtime, generator, analyzer, test, benchmark and example trees. - Describe when each documented exception is thrown rather than naming the type alone. - Map RootObject to its JSON field names explicitly rather than relying on the property identifiers matching. - Update the analyzer packages and regenerate the public API baselines. --- .editorconfig | 1878 +++++++++-------- .gitattributes | 78 +- src/Directory.Packages.props | 4 +- .../Emitter.Constraints.cs | 4 +- .../Emitter.Inline.ParameterInfo.cs | 3 + .../Emitter.Inline.Query.Object.cs | 6 +- .../Emitter.Inline.Query.Values.cs | 4 +- .../Emitter.Inline.Query.cs | 2 + .../Emitter.Inline.RequestProperties.cs | 18 +- .../Emitter.Inline.cs | 19 +- .../Emitter.SharedCode.cs | 7 +- .../Emitter.Testing.cs | 7 + src/InterfaceStubGenerator.Shared/Emitter.cs | 20 +- .../ImmutableEquatableArray.Public.cs | 4 + .../ImmutableEquatableArray.cs | 8 +- .../ImmutableEquatableArrayFactory.cs | 2 + .../InterfaceStubGeneratorV2.cs | 56 +- .../Models/BodyBufferMode.cs | 8 +- .../Models/InlineFormatKind.cs | 10 +- .../Models/KnownTypeConstraint.cs | 4 +- .../Models/MultipartPartKind.cs | 16 +- .../Models/Nullability.cs | 6 +- .../Models/QueryParameterShape.cs | 16 +- .../Models/RequestParameterKind.cs | 20 +- .../Models/ReturnTypeInfo.cs | 14 +- .../Models/WellKnownTypes.cs | 2 + .../Parser.Adapters.cs | 12 +- .../Parser.Aliases.cs | 3 +- .../Parser.Helpers.cs | 4 +- .../Parser.InlineEligibility.cs | 2 + .../Parser.Members.cs | 34 +- .../Parser.Request.Body.cs | 27 +- .../Parser.Request.Helpers.cs | 6 +- .../Parser.Request.HttpMethod.cs | 12 +- .../Parser.Request.Multipart.cs | 5 +- .../Parser.Request.ParameterKinds.cs | 16 +- .../Parser.Request.Parameters.cs | 5 +- .../Parser.Request.Path.cs | 5 +- ...r.Request.PathParameterLocations.Public.cs | 4 + .../Parser.Request.Query.Objects.cs | 2 + .../Parser.Request.Query.cs | 11 +- .../Parser.Request.cs | 31 +- src/InterfaceStubGenerator.Shared/Parser.cs | 8 +- .../Polyfills/Index.cs | 1 + .../Polyfills/Range.cs | 1 + .../PooledStringBuilder.cs | 19 +- .../UniqueNameBuilder.cs | 5 + src/Polyfills/ArgumentExceptionHelper.cs | 1 + .../ArgumentOutOfRangeExceptionHelper.cs | 2 + .../CallerArgumentExpressionAttribute.cs | 3 +- .../CompilerFeatureRequiredAttribute.cs | 3 +- src/Polyfills/DoesNotReturnIfAttribute.cs | 3 +- src/Polyfills/DynamicDependencyAttribute.cs | 7 +- .../DynamicallyAccessedMemberTypes.cs | 26 +- .../DynamicallyAccessedMembersAttribute.cs | 21 +- src/Polyfills/Index.cs | 3 +- src/Polyfills/MaybeNullWhenAttribute.cs | 3 +- src/Polyfills/MemberNotNullWhenAttribute.cs | 3 +- src/Polyfills/NotNullWhenAttribute.cs | 3 +- .../OverloadResolutionPriorityAttribute.cs | 3 +- src/Polyfills/Range.cs | 1 + src/Polyfills/RequiresDynamicCodeAttribute.cs | 3 +- .../RequiresUnreferencedCodeAttribute.cs | 3 +- .../UnconditionalSuppressMessageAttribute.cs | 3 +- .../RefitInterfaceAnalyzer.cs | 20 +- .../RefitInterfaceCodeFixProvider.cs | 11 +- .../HttpClientFactoryCore.cs | 25 +- ...ientFactoryExtensions.HttpClientBuilder.cs | 36 +- ...ientFactoryExtensions.ServiceCollection.cs | 60 +- .../PublicAPI/net10.0/PublicAPI.txt | 1 + .../PublicAPI/net11.0/PublicAPI.txt | 1 + .../PublicAPI/net462/PublicAPI.txt | 1 + .../PublicAPI/net470/PublicAPI.txt | 1 + .../PublicAPI/net471/PublicAPI.txt | 1 + .../PublicAPI/net472/PublicAPI.txt | 1 + .../PublicAPI/net48/PublicAPI.txt | 1 + .../PublicAPI/net481/PublicAPI.txt | 1 + .../PublicAPI/net8.0/PublicAPI.txt | 1 + .../PublicAPI/net9.0/PublicAPI.txt | 1 + .../ScopedAuthorizationHeaderHandler.cs | 2 +- src/Refit.HttpClientFactory/SettingsFor{T}.cs | 1 + src/Refit.NativeAotSmoke/Program.cs | 5 +- src/Refit.NativeAotSmoke/ServiceStatus.cs | 1 + src/Refit.NativeAotSmoke/SmokeApiFactory.cs | 2 + src/Refit.NativeAotSmoke/SmokeForm.cs | 1 + src/Refit.NativeAotSmoke/SmokeSort.cs | 4 +- src/Refit.NativeAotSmoke/Todo.cs | 1 + .../NewtonsoftJsonContentSerializer.cs | 5 + .../PublicAPI/net10.0/PublicAPI.txt | 3 + .../PublicAPI/net11.0/PublicAPI.txt | 3 + .../PublicAPI/net462/PublicAPI.txt | 3 + .../PublicAPI/net470/PublicAPI.txt | 3 + .../PublicAPI/net471/PublicAPI.txt | 3 + .../PublicAPI/net472/PublicAPI.txt | 3 + .../PublicAPI/net48/PublicAPI.txt | 3 + .../PublicAPI/net481/PublicAPI.txt | 3 + .../PublicAPI/net8.0/PublicAPI.txt | 3 + .../PublicAPI/net9.0/PublicAPI.txt | 3 + .../CachedAttributeProvider.cs | 3 + .../CachedRequestBuilderImplementation.cs | 2 +- .../CachedRequestBuilderImplementation{T}.cs | 2 +- src/Refit.Reflection/MethodTableKey.cs | 2 +- src/Refit.Reflection/QueryMapEntrySink.cs | 3 + .../QueryParameterEntrySink.cs | 3 + src/Refit.Reflection/RequestBuilderFactory.cs | 15 +- .../RequestBuilderImplementation.Execution.cs | 2 + .../RequestBuilderImplementation.Payload.cs | 1 + ...rImplementation.QueryAndHeaders.Helpers.cs | 10 +- ...stBuilderImplementation.QueryAndHeaders.cs | 17 +- ...stBuilderImplementation.RequestBuilding.cs | 14 +- .../RequestBuilderImplementation.cs | 22 +- .../RequestBuilderImplementation{TApi}.cs | 2 +- ...RestMethodInfoInternal.AttributeReading.cs | 26 +- ...RestMethodInfoInternal.ParameterBinding.cs | 5 + .../RestMethodInfoInternal.cs | 30 +- .../ReturnTypeAdapterResolver.cs | 8 +- src/Refit.Testing/NetworkBehavior.cs | 8 +- .../PublicAPI/net10.0/PublicAPI.txt | 16 + .../PublicAPI/net11.0/PublicAPI.txt | 16 + .../PublicAPI/net462/PublicAPI.txt | 16 + .../PublicAPI/net470/PublicAPI.txt | 16 + .../PublicAPI/net471/PublicAPI.txt | 16 + .../PublicAPI/net472/PublicAPI.txt | 16 + .../PublicAPI/net48/PublicAPI.txt | 16 + .../PublicAPI/net481/PublicAPI.txt | 16 + .../PublicAPI/net8.0/PublicAPI.txt | 16 + .../PublicAPI/net9.0/PublicAPI.txt | 16 + src/Refit.Testing/RouteMatcher.cs | 1 + src/Refit.Testing/RouteTier.cs | 6 +- src/Refit.Testing/StubApiResponse.cs | 1 + src/Refit.Testing/StubHttp.Matching.cs | 6 +- src/Refit.Testing/StubHttp.cs | 26 +- src/Refit.Testing/StubResponse.cs | 1 + src/Refit.Xml/PublicAPI/net10.0/PublicAPI.txt | 3 + src/Refit.Xml/PublicAPI/net11.0/PublicAPI.txt | 3 + src/Refit.Xml/PublicAPI/net462/PublicAPI.txt | 3 + src/Refit.Xml/PublicAPI/net470/PublicAPI.txt | 3 + src/Refit.Xml/PublicAPI/net471/PublicAPI.txt | 3 + src/Refit.Xml/PublicAPI/net472/PublicAPI.txt | 3 + src/Refit.Xml/PublicAPI/net48/PublicAPI.txt | 3 + src/Refit.Xml/PublicAPI/net481/PublicAPI.txt | 3 + src/Refit.Xml/PublicAPI/net8.0/PublicAPI.txt | 3 + src/Refit.Xml/PublicAPI/net9.0/PublicAPI.txt | 3 + src/Refit.Xml/XmlContentSerializer.cs | 1 + src/Refit.Xml/XmlContentSerializerSettings.cs | 1 + src/Refit.Xml/XmlReaderWriterSettings.cs | 1 + src/Refit/AliasAsAttribute.cs | 1 + src/Refit/ApiException.cs | 10 +- src/Refit/ApiExceptionBase.cs | 1 + src/Refit/ApiRequestException.cs | 1 + src/Refit/ApiResponseExtensions.cs | 11 +- src/Refit/ApiResponse{T}.cs | 12 +- src/Refit/AttachmentNameAttribute.cs | 1 + src/Refit/AuthorizeAttribute.cs | 1 + src/Refit/BodyAttribute.cs | 1 + src/Refit/BodySerializationMethod.cs | 10 +- ...PooledBufferWriter.Stream.NETStandard21.cs | 7 +- src/Refit/Buffers/PooledBufferWriter.cs | 9 +- src/Refit/ByteArrayPart.cs | 1 + src/Refit/CamelCaseStringEnumConverter.cs | 3 +- .../CamelCaseUrlParameterKeyFormatter.cs | 7 +- src/Refit/CollectionFormat.cs | 14 +- src/Refit/DefaultApiExceptionFactory.cs | 5 +- ...DefaultFormUrlEncodedParameterFormatter.cs | 1 + src/Refit/DefaultUrlParameterFormatter.cs | 14 +- src/Refit/DefaultUrlParameterKeyFormatter.cs | 1 + src/Refit/DelegatingStream.cs | 1 + src/Refit/DeleteAttribute.cs | 1 + src/Refit/EmptyDictionary.cs | 3 + src/Refit/EncodedAttribute.cs | 1 + src/Refit/EnumHelpers.cs | 5 + src/Refit/EnumerablePeek.cs | 6 +- src/Refit/FileInfoPart.cs | 1 + src/Refit/FormField.cs | 1 + src/Refit/FormObjectAttribute.cs | 1 + src/Refit/FormValueMultimap.cs | 13 +- src/Refit/GeneratedOnlyRequestBuilder.cs | 2 +- .../GeneratedParameterAttributeProvider.cs | 3 + src/Refit/GeneratedQueryStringBuilder.cs | 1 + .../GeneratedRequestRunner.BodyContent.cs | 2 + src/Refit/GeneratedRequestRunner.Sending.cs | 2 + src/Refit/GeneratedRequestRunner.cs | 27 +- ...tedSingleTypeParameterAttributeProvider.cs | 3 + src/Refit/GetAttribute.cs | 1 + src/Refit/HeadAttribute.cs | 1 + src/Refit/HeaderAttribute.cs | 1 + src/Refit/HeaderCollectionAttribute.cs | 1 + src/Refit/HeadersAttribute.cs | 1 + src/Refit/HttpMethodAttribute.cs | 1 + src/Refit/IRequestBuilderFactory.cs | 12 +- src/Refit/JsonContentSerializer.cs | 1 + src/Refit/JsonLinesContent.cs | 2 + .../KebabCaseUrlParameterKeyFormatter.cs | 4 + src/Refit/MultipartAttribute.cs | 1 + src/Refit/MultipartItem.cs | 2 + src/Refit/NonDisposingStream.cs | 3 +- src/Refit/ObjectToInferredTypesConverter.cs | 1 + src/Refit/OptionsAttribute.cs | 1 + src/Refit/ParameterType.cs | 4 +- src/Refit/PatchAttribute.cs | 1 + src/Refit/PathPrefixAttribute.cs | 1 + src/Refit/PostAttribute.cs | 1 + src/Refit/ProblemDetails.cs | 1 + src/Refit/PropertyAttribute.cs | 1 + src/Refit/PublicAPI/net10.0/PublicAPI.txt | 99 +- src/Refit/PublicAPI/net11.0/PublicAPI.txt | 99 +- src/Refit/PublicAPI/net462/PublicAPI.txt | 95 +- src/Refit/PublicAPI/net470/PublicAPI.txt | 95 +- src/Refit/PublicAPI/net471/PublicAPI.txt | 95 +- src/Refit/PublicAPI/net472/PublicAPI.txt | 95 +- src/Refit/PublicAPI/net48/PublicAPI.txt | 95 +- src/Refit/PublicAPI/net481/PublicAPI.txt | 95 +- src/Refit/PublicAPI/net8.0/PublicAPI.txt | 99 +- src/Refit/PublicAPI/net9.0/PublicAPI.txt | 99 +- src/Refit/PushStreamContent.cs | 16 +- src/Refit/PutAttribute.cs | 1 + src/Refit/QueryAttribute.cs | 13 +- src/Refit/QueryConverterAttribute.cs | 1 + src/Refit/QueryNameAttribute.cs | 1 + src/Refit/QueryUriFormatAttribute.cs | 1 + src/Refit/RefitSettings.cs | 15 +- src/Refit/ReflectionPropertyHelpers.cs | 8 +- src/Refit/ReflectionRequestBuilderResolver.cs | 1 + src/Refit/RequestBodySerializationMode.cs | 6 +- src/Refit/RequestBuilder.cs | 29 +- src/Refit/RequestExecutionHelpers.cs | 1 + src/Refit/RequestExecutionOptions.cs | 3 + src/Refit/RestMethodInfo.cs | 1 + src/Refit/RestMethodParameterInfo.cs | 1 + src/Refit/RestMethodParameterProperty.cs | 1 + src/Refit/RestService.cs | 73 +- .../SnakeCaseUrlParameterKeyFormatter.cs | 4 + src/Refit/StreamPart.cs | 1 + src/Refit/StreamingContentFormat.cs | 6 +- src/Refit/SystemTextJsonContentSerializer.cs | 16 +- src/Refit/SystemTextJsonQueryConverter.cs | 1 + src/Refit/SystemTextJsonQueryFlattener.cs | 2 + .../SystemTextJsonStreamingDeserializer.cs | 6 +- src/Refit/TimeoutAttribute.cs | 1 + src/Refit/UrlAttribute.cs | 1 + src/Refit/UrlResolutionMode.cs | 4 +- src/Refit/ValidationApiException.cs | 6 +- src/Refit/ValueStringBuilder.cs | 16 +- src/Shared/AuthenticatedHttpClientHandler.cs | 4 +- src/Shared/UniqueName.cs | 3 + src/benchmarks/.editorconfig | 9 + .../ContentSerializerHelperBenchmarks.cs | 4 + .../Refit.Benchmarks/EndToEndBenchmark.cs | 39 +- .../EnumHandlingBenchmarks.cs | 9 + src/benchmarks/Refit.Benchmarks/FastItem.cs | 1 + .../FastPathSerializationBenchmark.cs | 5 + .../Refit.Benchmarks/FormBenchmarkModel.cs | 1 + .../FormBodySerializationBenchmark.cs | 15 +- .../FormValueMappingBenchmarks.cs | 17 +- .../HeaderApplicationBenchmarks.cs | 1 + .../NestedQueryKeyCompositionBenchmarks.cs | 6 +- .../ParameterAttributeProviderBenchmarks.cs | 25 +- .../PartiallyReadableModel.cs | 3 + .../Refit.Benchmarks/PathBoundObject.cs | 1 + .../PathHeaderRequestBuildingBenchmarks.cs | 10 +- .../Refit.Benchmarks/PerformanceBenchmark.cs | 15 +- .../PooledBufferWriterBenchmarks.cs | 1 + .../Refit.Benchmarks/QueryAddressModel.cs | 1 + .../Refit.Benchmarks/QueryFlattenModel.cs | 1 + .../QueryFlatteningBenchmarks.cs | 10 +- .../QueryRequestBuildingBenchmark.cs | 17 +- src/benchmarks/Refit.Benchmarks/QuerySort.cs | 4 +- .../QueryStringBuildingBenchmarks.cs | 1 + .../Refit.Benchmarks/QueryVerbAttribute.cs | 1 + .../ReflectionMetadataBenchmarks.cs | 8 + .../RequestBodyContentBenchmarks.cs | 1 + .../RequestBodySerializationBenchmark.cs | 5 + .../RequestExecutionBenchmarks.cs | 1 + .../RequestPathBuildingBenchmarks.cs | 19 +- .../SourceGeneratorBenchmark.cs | 8 + .../SourceGeneratorProfiledAllocBenchmarks.cs | 4 + .../SourceGeneratorProfiledCpuBenchmarks.cs | 3 + .../Refit.Benchmarks/StartupBenchmark.cs | 13 +- .../StaticFileHttpResponseHandler.cs | 7 +- .../StaticValueHttpResponseHandler.cs | 1 + .../Refit.Benchmarks/StreamingBenchmark.cs | 6 +- .../StreamingProfiledBenchmarks.cs | 6 +- .../StringSanitizationBenchmarks.cs | 6 + .../UrlParameterFormattingBenchmarks.cs | 12 + src/benchmarks/Refit.Benchmarks/User.cs | 1 + .../ValueStringBuilderBenchmarks.cs | 1 + .../Refit.Generator.Benchmarks/CorpusSize.cs | 6 +- .../GeneratorCorpus.cs | 12 +- .../GeneratorDriverBenchmarks.cs | 4 + .../GeneratorHarness.cs | 5 +- .../IdentifierEmissionBenchmarks.cs | 6 + .../InlineEligibilityBenchmarks.cs | 1 + .../InterfaceEmissionBenchmarks.cs | 1 + .../LayoutEmissionBenchmarks.cs | 4 + .../LiteralEmissionBenchmarks.cs | 7 + .../ModelEqualityBenchmarks.cs | 4 + .../NamespaceNormalizationBenchmarks.cs | 6 + .../ParserTransformBenchmarks.cs | 3 + .../PathHeaderBindingGenerationBenchmarks.cs | 6 + .../PooledBufferBenchmarks.cs | 1 + .../UniqueNameBuilderBenchmarks.cs | 1 + .../CachedRequestBuilderBenchmarks.cs | 5 + .../MethodKeyEqualityBenchmarks.cs | 12 + .../ReflectionBenchmarkFixtures.cs | 3 + .../ReflectionClosedResultAdapter.cs | 1 + .../ReflectionHeaderAssemblyBenchmarks.cs | 1 + .../ReflectionInnerModel.cs | 1 + .../ReflectionPayloadBenchmarks.cs | 3 + .../ReflectionQueryBuildingBenchmarks.cs | 10 + .../ReflectionQueryModel.cs | 1 + ...ionRequestBuilderConstructionBenchmarks.cs | 8 + .../ReflectionRequestBuildingBenchmarks.cs | 27 +- .../ReflectionResult.cs | 1 + .../ReflectionResultAdapter.cs | 1 + .../ReflectionUserModel.cs | 1 + .../RestMethodInfoParseBenchmarks.cs | 9 + .../RestMethodMetadataParsingBenchmarks.cs | 18 + .../ReturnTypeAdapterResolverBenchmarks.cs | 8 + .../RouteTemplateBindingBenchmarks.cs | 6 + .../BlazorWasmIssue2065/Issue2067Response.cs | 1 + .../BlazorWasmIssue2065/Issue2067Status.cs | 4 +- .../HttpClientDiagnosticsHandler.cs | 1 + src/examples/Meow.Common/Responses/Breed.cs | 1 + .../Meow.Common/Responses/SearchResult.cs | 1 + src/examples/Meow.Common/Responses/Weight.cs | 1 + .../Services/AsyncOnlyJsonHttpContent.cs | 1 + .../Services/AsyncOnlyReadStream.cs | 1 + .../Meow.Common/Services/CatsService.cs | 4 + .../Services/CustomerEchoResponse.cs | 1 + .../Services/CustomerIdHeaderHandler.cs | 1 + .../Services/DemoBackendHandler.cs | 11 +- .../Services/Issue2056And2058Demo.cs | 5 +- .../Services/LargePayloadResponse.cs | 1 + .../ModelForTest.cs | 1 + .../Controllers/ValuesController.cs | 7 + .../RestApiforTest/Program.cs | 4 + .../RestApiforTest/Startup.cs | 4 + src/tests/.editorconfig | 3 + .../RefitInterfaceAnalyzerTests.cs | 1 + .../Refit.Analyzers.Tests/AnalyzerFixture.cs | 3 + .../RefitInterfaceAnalyzerTests.cs | 1 + .../Refit.CodeFixes.Tests/CodeFixFixture.cs | 6 + .../RefitInterfaceCodeFixProviderTests.cs | 1 + .../Scenarios/GeneratedQueryParameter.cs | 17 +- .../Scenarios/GeneratedUserSort.cs | 4 +- .../AnalyzerEmbeddedParserComponentTests.cs | 14 +- .../EscapedIdentifierBindingTests.cs | 21 +- .../EscapedIdentifierGenerationTests.cs | 14 +- src/tests/Refit.GeneratorTests/Fixture.cs | 5 +- .../GeneratedCodeComplianceTests.cs | 5 +- .../Refit.GeneratorTests/GeneratedTest.cs | 1 - .../GeneratorComponentTests.EmitterHelpers.cs | 8 +- .../GeneratorComponentTests.cs | 1 + .../LiveCompilationTests.cs | 5 +- .../Refit.GeneratorTests/LiveQueryApi.cs | 4 +- .../MultipartRequestBuildingLiveTests.cs | 29 +- ...bservableReturnRequestBuildingLiveTests.cs | 21 +- .../ParserCoverageTests.cs | 9 +- .../QueryRequestBuildingLiveTests.Helpers.cs | 21 +- .../RelativePathResolutionLiveTests.cs | 6 +- .../AuthenticatedHttpClientHandlerTests.cs | 5 +- .../ApiResponseMockInteropTests.cs | 23 +- .../MultipartNewtonsoftTests.cs | 18 +- .../NewtonsoftJsonSecurityTests.cs | 5 +- .../ResponseNewtonsoftTests.cs | 36 +- ...estServiceIntegrationTests.Cancellation.cs | 71 +- .../RestServiceIntegrationTests.GitHub.cs | 207 +- ...RestServiceIntegrationTests.RequestBody.cs | 31 +- .../SerializedContentNewtonsoftTests.cs | 17 +- .../SnakeCasePropertyNamesContractResolver.cs | 3 +- .../AotSafeAssertionExtensions.cs | 2 + .../Refit.Reflection.Tests/BodyPayload.cs | 1 + .../Refit.Reflection.Tests/IndexedItem.cs | 1 + .../MultipartAddress.cs | 1 + .../ReflectionCachedAttributeProviderTests.cs | 1 + .../ReflectionCachingInnerModel.cs | 1 + .../ReflectionCachingQueryModel.cs | 1 + .../ReflectionConstructorParseShapeTests.cs | 2 + .../ReflectionDeclaredMethodLookupTests.cs | 1 + .../ReflectionExistingQueryMergeTests.cs | 10 + .../ReflectionIndexedNullQueryTests.cs | 3 +- .../ReflectionMultipartFormObjectTests.cs | 1 + .../ReflectionObjectPathBindingTests.cs | 1 + .../ReflectionParseShapeModel.cs | 1 + .../ReflectionParseShapeRequestTests.cs | 1 + .../ReflectionPropertyQueryParameterTests.cs | 1 + .../ReflectionQueryMapCachingTests.cs | 11 +- .../ReflectionRequestBuildingTests.cs | 1 + .../ReflectionStaticHeaderTests.cs | 1 + .../TestHttpMessageHandler.cs | 1 + .../NetworkBehaviorTests.cs | 32 +- .../RetryAndTimeoutTests.cs | 48 +- .../RouteTableFeatureTests.cs | 32 +- .../StubHttpCoverageTests.cs | 6 +- .../Refit.Testing.Tests/StubHttpTests.cs | 191 +- src/tests/Refit.Tests/AnEnum.cs | 4 +- .../Refit.Tests/ApiExceptionTests.Content.cs | 6 +- src/tests/Refit.Tests/ApiExceptionTests.cs | 20 +- .../ApiResponseEnsureSuccessTests.cs | 12 +- src/tests/Refit.Tests/ApiResponseTests.cs | 10 +- .../AuthenticatedClientHandlerTests.cs | 103 +- .../Refit.Tests/CachedRequestBuilderTests.cs | 6 +- .../CamelCaseStringEnumConverterTests.cs | 6 +- .../CamelCaseUrlParameterKeyFormatterTests.cs | 11 +- ...ltFormUrlEncodedParameterFormatterTests.cs | 2 +- .../DefaultInterfaceMethodTests.cs | 24 +- .../DefaultUrlParameterFormatterTests.cs | 60 +- .../DeserializationExceptionFactoryTests.cs | 68 +- src/tests/Refit.Tests/EnumHelpersTests.cs | 18 +- .../Refit.Tests/ExceptionFactoryTests.cs | 52 +- .../ExplicitInterfaceRefitTests.cs | 88 +- src/tests/Refit.Tests/FooWithEnumMember.cs | 4 +- .../FormValueMultimapTests.KeyFormatting.cs | 5 +- .../Refit.Tests/FormValueMultimapTests.cs | 66 +- .../Refit.Tests/GeneratedFactoryApiClient.cs | 3 +- src/tests/Refit.Tests/GeneratedFormColor.cs | 4 +- ...ributeProvider.GetCustomAttributesTests.cs | 16 +- ...atedRequestRunnerTests.BuildRequestPath.cs | 25 +- ...GeneratedRequestRunnerTests.Collections.cs | 20 +- ...ratedRequestRunnerTests.RequestDispatch.cs | 99 +- ...equestRunnerTests.ResponseErrorHandling.cs | 75 +- .../GeneratedRequestRunnerTests.cs | 41 +- .../Refit.Tests/HeaderCollectionMergeTests.cs | 11 +- .../Refit.Tests/HeaderValidationScenarios.cs | 5 +- ...oryExtensionsTests.KeyedGeneratedClient.cs | 6 +- ...actoryExtensionsTests.ServiceCollection.cs | 17 +- .../HttpClientFactoryExtensionsTests.cs | 29 +- ...tpClientFactoryScopedAuthorizationTests.cs | 10 +- .../Refit.Tests/IGlobalNamespaceRefitApi.cs | 4 - .../Refit.Tests/IServiceWithoutNamespace.cs | 4 - .../KebabCaseUrlParameterKeyFormatterTests.cs | 11 +- src/tests/Refit.Tests/MethodOverladTests.cs | 32 +- ...ultipartFormattableValueFormattingTests.cs | 5 +- .../MultipartTests.FormObjectFlattening.cs | 55 +- .../Refit.Tests/MultipartTests.PartUploads.cs | 80 +- src/tests/Refit.Tests/MultipartTests.cs | 37 +- .../ProblemDetailsErrorValueReadingTests.cs | 6 +- src/tests/Refit.Tests/QueryConverterTests.cs | 12 +- .../Refit.Tests/QueryObjectFlatteningTests.cs | 44 +- ...ryObjectPropertyTypeClassificationTests.cs | 11 +- src/tests/Refit.Tests/QuerySort.cs | 4 +- src/tests/Refit.Tests/ReflectionTests.cs | 116 +- .../RequestBuilderTests.Dictionaries.cs | 66 +- .../RequestBuilderTests.Headers.cs | 17 +- .../RequestBuilderTests.Helpers.cs | 5 +- .../Refit.Tests/RequestBuilderTests.Lookup.cs | 8 +- .../RequestBuilderTests.Queries.cs | 39 +- src/tests/Refit.Tests/RequestBuilderTests.cs | 53 +- .../ResponseTests.ErrorHandling.cs | 123 +- src/tests/Refit.Tests/ResponseTests.cs | 164 +- .../RestMethodInfoTests.HeaderCollection.cs | 14 +- ...tMethodInfoTests.QueryAndBodyParameters.cs | 32 +- ...RestServiceIntegrationTests.Inheritance.cs | 116 +- ...erviceIntegrationTests.QueryAndFragment.cs | 128 +- ...RestServiceIntegrationTests.RequestBody.cs | 112 +- ...IntegrationTests.RequestUrlConstruction.cs | 234 +- .../RestServiceIntegrationTests.cs | 113 +- .../Refit.Tests/ReturnTypeAdapterTests.cs | 15 +- src/tests/Refit.Tests/RootObject.cs | 20 +- .../SerializedContentTests.ValueConversion.cs | 63 +- .../Refit.Tests/SerializedContentTests.cs | 104 +- .../SnakeCaseUrlParameterKeyFormatterTests.cs | 11 +- .../Refit.Tests/StreamingResponseTests.cs | 45 +- .../SynchronousBodySerializationTests.cs | 6 +- .../SystemTextJsonQueryConverterTests.cs | 6 +- src/tests/Refit.Tests/TestEnum.cs | 6 +- .../TestEnumUrlParameterFormatter.cs | 3 +- src/tests/Refit.Tests/TestUrlFormatter.cs | 1 + .../Refit.Tests/UrlResolutionModeTests.cs | 17 +- .../Refit.Tests/ValueStringBuilderTests.cs | 4 +- .../Refit.Tests/XmlContentSerializerTests.cs | 37 +- 471 files changed, 4221 insertions(+), 4766 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9a5218763..260613982 100644 --- a/.editorconfig +++ b/.editorconfig @@ -181,58 +181,58 @@ csharp_space_between_square_brackets = false ################### # Custom Analyzers ################### -dotnet_diagnostic.AvoidAsyncVoid.severity = error +dotnet_diagnostic.AvoidAsyncVoid.severity = suggestion ################### # Microsoft.CodeAnalysis.NetAnalyzers (CA) ################### # Design -dotnet_diagnostic.CA1000.severity = error # Do not declare static members on generic types — common factory pattern +dotnet_diagnostic.CA1000.severity = none # Do not declare static members on generic types — common factory pattern dotnet_diagnostic.CA1001.severity = error # Types that own disposable fields should be disposable -dotnet_diagnostic.CA1002.severity = error # Do not expose generic lists — we deliberately expose List; interface-based collections are an older convention we don't follow -dotnet_diagnostic.CA1003.severity = error # Use generic event handler instances — covered by SST2304 -dotnet_diagnostic.CA1005.severity = error # Avoid excessive parameters on generic types — we deliberately expose 3+ type-parameter types (tuple-style handles, raw engine signals); the ergonomic guidance conflicts with that design +dotnet_diagnostic.CA1002.severity = none # Do not expose generic lists — we deliberately expose List; interface-based collections are an older convention we don't follow +dotnet_diagnostic.CA1003.severity = none # Use generic event handler instances — covered by SST2304 +dotnet_diagnostic.CA1005.severity = none # Avoid excessive parameters on generic types — we deliberately expose 3+ type-parameter types (tuple-style handles, raw engine signals); the ergonomic guidance conflicts with that design dotnet_diagnostic.CA1008.severity = error # Enums should have zero value -dotnet_diagnostic.CA1010.severity = error # Collections should implement generic interface — we deliberately expose concrete collection types; interface-based collections are an older convention we don't follow -dotnet_diagnostic.CA1012.severity = error # Abstract types should not have public constructors — covered by SST1428 -dotnet_diagnostic.CA1014.severity = error # Mark assemblies with CLSCompliantAttribute — we don't ship CLS-compliant assemblies +dotnet_diagnostic.CA1010.severity = none # Collections should implement generic interface — we deliberately expose concrete collection types; interface-based collections are an older convention we don't follow +dotnet_diagnostic.CA1012.severity = none # Abstract types should not have public constructors — covered by SST1428 +dotnet_diagnostic.CA1014.severity = none # Mark assemblies with CLSCompliantAttribute — we don't ship CLS-compliant assemblies dotnet_diagnostic.CA1016.severity = error # Mark assemblies with AssemblyVersionAttribute -dotnet_diagnostic.CA1017.severity = error # Mark assemblies with ComVisibleAttribute — we don't ship COM-visible assemblies +dotnet_diagnostic.CA1017.severity = none # Mark assemblies with ComVisibleAttribute — we don't ship COM-visible assemblies dotnet_diagnostic.CA1018.severity = error # Mark attributes with AttributeUsageAttribute -dotnet_diagnostic.CA1019.severity = error # Define accessors for attribute arguments — conflicts with SST2324, which caps an internal attribute's accessor at internal -dotnet_diagnostic.CA1021.severity = error # Avoid out parameters - disabled - needed for the zero-allocation idiom in Try/Find APIs and other performance-critical paths +dotnet_diagnostic.CA1019.severity = none # Define accessors for attribute arguments — conflicts with SST2324, which caps an internal attribute's accessor at internal +dotnet_diagnostic.CA1021.severity = none # Avoid out parameters - disabled - needed for the zero-allocation idiom in Try/Find APIs and other performance-critical paths dotnet_diagnostic.CA1024.severity = error # Use properties where appropriate dotnet_diagnostic.CA1027.severity = error # Mark enums with FlagsAttribute -dotnet_diagnostic.CA1028.severity = error # Enum storage should be Int32 — covered by SST2313 -dotnet_diagnostic.CA1030.severity = error # Use events where appropriate — we use Rx observables instead of CLR events -dotnet_diagnostic.CA1031.severity = error # Do not catch general exception types — required at logging/dispose/IO boundaries -dotnet_diagnostic.CA1032.severity = error # Implement standard exception constructors — covered by SST1488 -dotnet_diagnostic.CA1033.severity = error # Interface methods should be callable by child types — explicit interface implementations are a deliberate design choice -dotnet_diagnostic.CA1034.severity = error # Nested types should not be visible — public nested types are sometimes the cleanest API (e.g. interface-scoped exception helpers) -dotnet_diagnostic.CA1036.severity = error # Override methods on comparable types — relational operators rarely meaningful for our types -dotnet_diagnostic.CA1040.severity = error # Avoid empty interfaces — duplicate of SST1437 (canonical); marker interfaces (IActivatableView etc.) are deliberate public API -dotnet_diagnostic.CA1041.severity = error # Provide ObsoleteAttribute message — covered by SST2308 +dotnet_diagnostic.CA1028.severity = none # Enum storage should be Int32 — covered by SST2313 +dotnet_diagnostic.CA1030.severity = none # Use events where appropriate — we use Rx observables instead of CLR events +dotnet_diagnostic.CA1031.severity = none # Do not catch general exception types — required at logging/dispose/IO boundaries +dotnet_diagnostic.CA1032.severity = none # Implement standard exception constructors — covered by SST1488 +dotnet_diagnostic.CA1033.severity = none # Interface methods should be callable by child types — explicit interface implementations are a deliberate design choice +dotnet_diagnostic.CA1034.severity = none # Nested types should not be visible — public nested types are sometimes the cleanest API (e.g. interface-scoped exception helpers) +dotnet_diagnostic.CA1036.severity = none # Override methods on comparable types — relational operators rarely meaningful for our types +dotnet_diagnostic.CA1040.severity = none # Avoid empty interfaces — duplicate of SST1437 (canonical); marker interfaces (IActivatableView etc.) are deliberate public API +dotnet_diagnostic.CA1041.severity = none # Provide ObsoleteAttribute message — covered by SST2308 dotnet_diagnostic.CA1043.severity = error # Use integral or string argument for indexers -dotnet_diagnostic.CA1044.severity = error # Properties should not be write only — covered by SST1421 -dotnet_diagnostic.CA1045.severity = error # Do not pass types by reference — we deliberately use ref-passing static helpers so they carry only the data they touch; data-oriented layout is the default here +dotnet_diagnostic.CA1044.severity = none # Properties should not be write only — covered by SST1421 +dotnet_diagnostic.CA1045.severity = none # Do not pass types by reference — we deliberately use ref-passing static helpers so they carry only the data they touch; data-oriented layout is the default here dotnet_diagnostic.CA1046.severity = error # Do not overload operator equals on reference types -dotnet_diagnostic.CA1047.severity = error # Do not declare protected member in sealed type — covered by SST1427 -dotnet_diagnostic.CA1048.severity = error # Do not declare virtual members in sealed types — covered by SST1491 -dotnet_diagnostic.CA1050.severity = error # Declare types in namespaces — covered by SST2312 -dotnet_diagnostic.CA1051.severity = error # Duplicate of SST1401 (canonical) — do not declare visible instance fields -dotnet_diagnostic.CA1052.severity = error # Static holder types should be sealed — covered by SST1432 -dotnet_diagnostic.CA1053.severity = error # Static holder types should not have constructors — covered by SST1432 -dotnet_diagnostic.CA1054.severity = error # URI parameters should not be strings -dotnet_diagnostic.CA1055.severity = error # URI return values should not be strings -dotnet_diagnostic.CA1056.severity = error # URI properties should not be strings +dotnet_diagnostic.CA1047.severity = none # Do not declare protected member in sealed type — covered by SST1427 +dotnet_diagnostic.CA1048.severity = none # Do not declare virtual members in sealed types — covered by SST1491 +dotnet_diagnostic.CA1050.severity = none # Declare types in namespaces — covered by SST2312 +dotnet_diagnostic.CA1051.severity = none # Duplicate of SST1401 (canonical) — do not declare visible instance fields +dotnet_diagnostic.CA1052.severity = none # Static holder types should be sealed — covered by SST1432 +dotnet_diagnostic.CA1053.severity = none # Static holder types should not have constructors — covered by SST1432 +dotnet_diagnostic.CA1054.severity = suggestion # URI parameters should not be strings +dotnet_diagnostic.CA1055.severity = suggestion # URI return values should not be strings +dotnet_diagnostic.CA1056.severity = suggestion # URI properties should not be strings dotnet_diagnostic.CA1058.severity = error # Types should not extend certain base types dotnet_diagnostic.CA1059.severity = error # Members should not expose certain concrete types dotnet_diagnostic.CA1060.severity = error # Move P/Invokes to NativeMethods class -dotnet_diagnostic.CA1061.severity = error # Do not hide base class methods — covered by SST2427 -dotnet_diagnostic.CA1062.severity = error # Validate arguments of public methods - Nullable=enable + we own every consumer, so the compiler already guarantees non-null params -dotnet_diagnostic.CA1063.severity = error # Implement IDisposable correctly — covered by SST2300 +dotnet_diagnostic.CA1061.severity = none # Do not hide base class methods — covered by SST2427 +dotnet_diagnostic.CA1062.severity = none # Validate arguments of public methods - Nullable=enable + we own every consumer, so the compiler already guarantees non-null params +dotnet_diagnostic.CA1063.severity = none # Implement IDisposable correctly — covered by SST2300 dotnet_diagnostic.CA1064.severity = error # Exceptions should be public -dotnet_diagnostic.CA1065.severity = error # Do not raise exceptions in unexpected locations — covered by SST1485 +dotnet_diagnostic.CA1065.severity = none # Do not raise exceptions in unexpected locations — covered by SST1485 dotnet_diagnostic.CA1066.severity = error # Implement IEquatable when overriding Equals dotnet_diagnostic.CA1067.severity = error # Override Equals when implementing IEquatable dotnet_diagnostic.CA1068.severity = error # CancellationToken parameters must come last @@ -240,108 +240,108 @@ dotnet_diagnostic.CA1069.severity = error # Enums should not have duplicate valu dotnet_diagnostic.CA1070.severity = error # Do not declare event fields as virtual # Globalization -dotnet_diagnostic.CA1303.severity = error # Do not pass literals as localized parameters — we don't ship localized resources -dotnet_diagnostic.CA1307.severity = error # Covered by PSH1207 (canonical) -dotnet_diagnostic.CA1308.severity = error # Normalize strings to uppercase — ToLowerInvariant is correct for filesystem path / cache key normalization -dotnet_diagnostic.CA1310.severity = error # Covered by PSH1207 (canonical) +dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters — we don't ship localized resources +dotnet_diagnostic.CA1307.severity = none # Covered by PSH1207 (canonical) +dotnet_diagnostic.CA1308.severity = none # Normalize strings to uppercase — ToLowerInvariant is correct for filesystem path / cache key normalization +dotnet_diagnostic.CA1310.severity = none # Covered by PSH1207 (canonical) # Interoperability dotnet_diagnostic.CA1401.severity = error # P/Invokes should not be visible # Maintainability -dotnet_diagnostic.CA1500.severity = error # Variable names should not match field names — covered by SST1484 -dotnet_diagnostic.CA1501.severity = error # Covered by SST1446 (canonical) -dotnet_diagnostic.CA1502.severity = error # Covered by SST1442 (canonical) +dotnet_diagnostic.CA1500.severity = none # Variable names should not match field names — covered by SST1484 +dotnet_diagnostic.CA1501.severity = none # Covered by SST1446 (canonical) +dotnet_diagnostic.CA1502.severity = none # Covered by SST1442 (canonical) dotnet_diagnostic.CA1505.severity = error # Avoid unmaintainable code -dotnet_diagnostic.CA1506.severity = error # Avoid excessive class coupling — adds little signal here, mostly trips on legitimate orchestration code -dotnet_diagnostic.CA1507.severity = error # Use nameof in place of string — covered by SST1463 +dotnet_diagnostic.CA1506.severity = none # Avoid excessive class coupling — adds little signal here, mostly trips on legitimate orchestration code +dotnet_diagnostic.CA1507.severity = none # Use nameof in place of string — covered by SST1463 dotnet_diagnostic.CA1508.severity = error # Avoid dead conditional code dotnet_diagnostic.CA1509.severity = error # Invalid entry in code metrics configuration file -dotnet_diagnostic.CA1510.severity = error # Covered by PSH1409 (canonical) -dotnet_diagnostic.CA1511.severity = error # Covered by PSH1409 (canonical) -dotnet_diagnostic.CA1512.severity = error # Covered by PSH1409 (canonical) -dotnet_diagnostic.CA1513.severity = error # Covered by PSH1409 (canonical) -dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument — covered by PSH1220 -dotnet_diagnostic.CA1515.severity = error # Consider making public types internal — interferes with tests and reflection-discovered types (BenchmarkDotNet, TUnit, etc.) +dotnet_diagnostic.CA1510.severity = none # Covered by PSH1409 (canonical) +dotnet_diagnostic.CA1511.severity = none # Covered by PSH1409 (canonical) +dotnet_diagnostic.CA1512.severity = none # Covered by PSH1409 (canonical) +dotnet_diagnostic.CA1513.severity = none # Covered by PSH1409 (canonical) +dotnet_diagnostic.CA1514.severity = none # Avoid redundant length argument — covered by PSH1220 +dotnet_diagnostic.CA1515.severity = none # Consider making public types internal — interferes with tests and reflection-discovered types (BenchmarkDotNet, TUnit, etc.) dotnet_diagnostic.CA1516.severity = error # Use cross-platform intrinsics # Naming -dotnet_diagnostic.CA1710.severity = error # Identifiers should have correct suffix -dotnet_diagnostic.CA1724.severity = error # Type Names Should Not Match Namespaces — namespace/type name overlap is intentional API surface +dotnet_diagnostic.CA1710.severity = suggestion # Identifiers should have correct suffix +dotnet_diagnostic.CA1724.severity = none # Type Names Should Not Match Namespaces — namespace/type name overlap is intentional API surface # Performance -dotnet_diagnostic.CA1802.severity = error # Use literals where appropriate — covered by PSH1402 -dotnet_diagnostic.CA1805.severity = error # Do not initialize unnecessarily — covered by PSH1403 +dotnet_diagnostic.CA1802.severity = none # Use literals where appropriate — covered by PSH1402 +dotnet_diagnostic.CA1805.severity = none # Do not initialize unnecessarily — covered by PSH1403 dotnet_diagnostic.CA1806.severity = error # Do not ignore method results -dotnet_diagnostic.CA1810.severity = error # Initialize reference type static fields inline — explicit static constructors are deliberate in some types +dotnet_diagnostic.CA1810.severity = none # Initialize reference type static fields inline — explicit static constructors are deliberate in some types dotnet_diagnostic.CA1812.severity = error # Avoid uninstantiated internal classes -dotnet_diagnostic.CA1813.severity = error # Avoid unsealed attributes — covered by PSH1401 -dotnet_diagnostic.CA1814.severity = error # Prefer jagged arrays over multidimensional — covered by PSH1020 -dotnet_diagnostic.CA1815.severity = error # Override equals and operator equals on value types — covered by PSH1005 -dotnet_diagnostic.CA1819.severity = error # Properties should not return arrays — incompatible with the RxUI/sqlite-net mapping style we use throughout the codebase -dotnet_diagnostic.CA1820.severity = error # Test for empty strings using string length — covered by PSH1204 -dotnet_diagnostic.CA1821.severity = error # Remove empty finalizers — covered by PSH1002 -dotnet_diagnostic.CA1822.severity = error # Mark members as static — covered by PSH1414 -dotnet_diagnostic.CA1823.severity = error # Avoid unused private fields — covered by SST1441 +dotnet_diagnostic.CA1813.severity = none # Avoid unsealed attributes — covered by PSH1401 +dotnet_diagnostic.CA1814.severity = none # Prefer jagged arrays over multidimensional — covered by PSH1020 +dotnet_diagnostic.CA1815.severity = none # Override equals and operator equals on value types — covered by PSH1005 +dotnet_diagnostic.CA1819.severity = none # Properties should not return arrays — incompatible with the RxUI/sqlite-net mapping style we use throughout the codebase +dotnet_diagnostic.CA1820.severity = none # Test for empty strings using string length — covered by PSH1204 +dotnet_diagnostic.CA1821.severity = none # Remove empty finalizers — covered by PSH1002 +dotnet_diagnostic.CA1822.severity = none # Mark members as static — covered by PSH1414 +dotnet_diagnostic.CA1823.severity = none # Avoid unused private fields — covered by SST1441 dotnet_diagnostic.CA1824.severity = error # Mark assemblies with NeutralResourcesLanguageAttribute -dotnet_diagnostic.CA1825.severity = error # Avoid zero-length array allocations — covered by PSH1001 -dotnet_diagnostic.CA1826.severity = error # Use property instead of Linq Enumerable method — covered by PSH1103 -dotnet_diagnostic.CA1827.severity = error # Do not use Count/LongCount when Any can be used — covered by PSH1119 -dotnet_diagnostic.CA1828.severity = error # Do not use CountAsync/LongCountAsync when AnyAsync can be used — covered by PSH1126 -dotnet_diagnostic.CA1829.severity = error # Use Length/Count property instead of Enumerable.Count — covered by PSH1103 -dotnet_diagnostic.CA1830.severity = error # Prefer strongly-typed Append/Insert overloads on StringBuilder — covered by PSH1202 -dotnet_diagnostic.CA1831.severity = error # Use AsSpan instead of Range-based indexers for string — covered by PSH1212 -dotnet_diagnostic.CA1832.severity = error # Use AsSpan or AsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory portion of an array — covered by PSH1019 -dotnet_diagnostic.CA1833.severity = error # Use AsSpan or AsMemory instead of Range-based indexers for getting Span or Memory portion of an array — conflicts with PSH1019, which owns the array range-indexer rewrite and refuses it for mutable Span/Memory targets -dotnet_diagnostic.CA1834.severity = error # Use StringBuilder.Append(char) for single character strings — covered by PSH1202 -dotnet_diagnostic.CA1835.severity = error # Prefer the memory-based overloads of ReadAsync/WriteAsync methods in stream-based classes — covered by PSH1314 -dotnet_diagnostic.CA1836.severity = error # Prefer IsEmpty over Count when available — covered by PSH1117 -dotnet_diagnostic.CA1837.severity = error # Use Environment.ProcessId — covered by PSH1405 +dotnet_diagnostic.CA1825.severity = none # Avoid zero-length array allocations — covered by PSH1001 +dotnet_diagnostic.CA1826.severity = none # Use property instead of Linq Enumerable method — covered by PSH1103 +dotnet_diagnostic.CA1827.severity = none # Do not use Count/LongCount when Any can be used — covered by PSH1119 +dotnet_diagnostic.CA1828.severity = none # Do not use CountAsync/LongCountAsync when AnyAsync can be used — covered by PSH1126 +dotnet_diagnostic.CA1829.severity = none # Use Length/Count property instead of Enumerable.Count — covered by PSH1103 +dotnet_diagnostic.CA1830.severity = none # Prefer strongly-typed Append/Insert overloads on StringBuilder — covered by PSH1202 +dotnet_diagnostic.CA1831.severity = none # Use AsSpan instead of Range-based indexers for string — covered by PSH1212 +dotnet_diagnostic.CA1832.severity = none # Use AsSpan or AsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory portion of an array — covered by PSH1019 +dotnet_diagnostic.CA1833.severity = none # Use AsSpan or AsMemory instead of Range-based indexers for getting Span or Memory portion of an array — conflicts with PSH1019, which owns the array range-indexer rewrite and refuses it for mutable Span/Memory targets +dotnet_diagnostic.CA1834.severity = none # Use StringBuilder.Append(char) for single character strings — covered by PSH1202 +dotnet_diagnostic.CA1835.severity = none # Prefer the memory-based overloads of ReadAsync/WriteAsync methods in stream-based classes — covered by PSH1314 +dotnet_diagnostic.CA1836.severity = none # Prefer IsEmpty over Count when available — covered by PSH1117 +dotnet_diagnostic.CA1837.severity = none # Use Environment.ProcessId — covered by PSH1405 dotnet_diagnostic.CA1838.severity = error # Avoid StringBuilder parameters for P/Invokes -dotnet_diagnostic.CA1839.severity = error # Use Environment.ProcessPath — covered by PSH1405 -dotnet_diagnostic.CA1840.severity = error # Use Environment.CurrentManagedThreadId — covered by PSH1405 -dotnet_diagnostic.CA1841.severity = error # Prefer Dictionary.Contains methods — covered by PSH1407 -dotnet_diagnostic.CA1842.severity = error # Do not use 'WhenAll' with a single task — covered by PSH1301 -dotnet_diagnostic.CA1843.severity = error # Do not use 'WaitAll' with a single task — covered by PSH1301 +dotnet_diagnostic.CA1839.severity = none # Use Environment.ProcessPath — covered by PSH1405 +dotnet_diagnostic.CA1840.severity = none # Use Environment.CurrentManagedThreadId — covered by PSH1405 +dotnet_diagnostic.CA1841.severity = none # Prefer Dictionary.Contains methods — covered by PSH1407 +dotnet_diagnostic.CA1842.severity = none # Do not use 'WhenAll' with a single task — covered by PSH1301 +dotnet_diagnostic.CA1843.severity = none # Do not use 'WaitAll' with a single task — covered by PSH1301 dotnet_diagnostic.CA1844.severity = error # Provide memory-based overrides of async methods when subclassing 'Stream' -dotnet_diagnostic.CA1845.severity = error # Use span-based 'string.Concat' — covered by PSH1222 -dotnet_diagnostic.CA1846.severity = error # Prefer AsSpan over Substring — covered by PSH1212 -dotnet_diagnostic.CA1847.severity = error # Covered by PSH1201 (canonical) +dotnet_diagnostic.CA1845.severity = none # Use span-based 'string.Concat' — covered by PSH1222 +dotnet_diagnostic.CA1846.severity = none # Prefer AsSpan over Substring — covered by PSH1212 +dotnet_diagnostic.CA1847.severity = none # Covered by PSH1201 (canonical) dotnet_diagnostic.CA1848.severity = error # Use the LoggerMessage delegates -dotnet_diagnostic.CA1849.severity = error # Call async methods when in an async method — covered by PSH1313 -dotnet_diagnostic.CA1850.severity = error # Prefer static HashData method over ComputeHash — covered by PSH1400 +dotnet_diagnostic.CA1849.severity = none # Call async methods when in an async method — covered by PSH1313 +dotnet_diagnostic.CA1850.severity = none # Prefer static HashData method over ComputeHash — covered by PSH1400 dotnet_diagnostic.CA1851.severity = error # Possible multiple enumerations of IEnumerable collection -dotnet_diagnostic.CA1852.severity = error # Seal internal types — covered by PSH1411 +dotnet_diagnostic.CA1852.severity = none # Seal internal types — covered by PSH1411 dotnet_code_quality.CA1852.api_surface = private, internal # only flag non-public classes; public classes stay open for inheritance -dotnet_diagnostic.CA1853.severity = error # Unnecessary call to 'Dictionary.ContainsKey(key)' — covered by PSH1105 -dotnet_diagnostic.CA1854.severity = error # Prefer the IDictionary.TryGetValue method — covered by PSH1104 +dotnet_diagnostic.CA1853.severity = none # Unnecessary call to 'Dictionary.ContainsKey(key)' — covered by PSH1105 +dotnet_diagnostic.CA1854.severity = none # Prefer the IDictionary.TryGetValue method — covered by PSH1104 dotnet_diagnostic.CA1855.severity = error # Prefer 'Clear' over 'Fill' dotnet_diagnostic.CA1856.severity = error # Incorrect usage of ConstantExpected attribute dotnet_diagnostic.CA1857.severity = error # A constant is expected for the parameter -dotnet_diagnostic.CA1858.severity = error # Use 'StartsWith' instead of 'IndexOf' — covered by PSH1221 +dotnet_diagnostic.CA1858.severity = none # Use 'StartsWith' instead of 'IndexOf' — covered by PSH1221 dotnet_diagnostic.CA1859.severity = error # Use concrete types when possible for improved performance -dotnet_diagnostic.CA1860.severity = error # Avoid using 'Enumerable.Any()' extension method — covered by PSH1103 -dotnet_diagnostic.CA1861.severity = error # Avoid constant arrays as arguments — covered by PSH1004 -dotnet_diagnostic.CA1862.severity = error # Use the 'StringComparison' overloads for case-insensitive comparisons — covered by PSH1200 -dotnet_diagnostic.CA1863.severity = error # Use 'CompositeFormat' — covered by PSH1223 -dotnet_diagnostic.CA1864.severity = error # Prefer the 'IDictionary.TryAdd' method — covered by PSH1115 -dotnet_diagnostic.CA1865.severity = error # Covered by PSH1201 (canonical) -dotnet_diagnostic.CA1866.severity = error # Covered by PSH1201 (canonical) -dotnet_diagnostic.CA1867.severity = error # Covered by PSH1201 (canonical) -dotnet_diagnostic.CA1868.severity = error # Unnecessary call to 'Contains' for sets — covered by PSH1105 -dotnet_diagnostic.CA1869.severity = error # Cache and reuse 'JsonSerializerOptions' instances — covered by PSH1416 -dotnet_diagnostic.CA1870.severity = error # Use a cached 'SearchValues' instance — covered by PSH1213 +dotnet_diagnostic.CA1860.severity = none # Avoid using 'Enumerable.Any()' extension method — covered by PSH1103 +dotnet_diagnostic.CA1861.severity = none # Avoid constant arrays as arguments — covered by PSH1004 +dotnet_diagnostic.CA1862.severity = none # Use the 'StringComparison' overloads for case-insensitive comparisons — covered by PSH1200 +dotnet_diagnostic.CA1863.severity = none # Use 'CompositeFormat' — covered by PSH1223 +dotnet_diagnostic.CA1864.severity = none # Prefer the 'IDictionary.TryAdd' method — covered by PSH1115 +dotnet_diagnostic.CA1865.severity = none # Covered by PSH1201 (canonical) +dotnet_diagnostic.CA1866.severity = none # Covered by PSH1201 (canonical) +dotnet_diagnostic.CA1867.severity = none # Covered by PSH1201 (canonical) +dotnet_diagnostic.CA1868.severity = none # Unnecessary call to 'Contains' for sets — covered by PSH1105 +dotnet_diagnostic.CA1869.severity = none # Cache and reuse 'JsonSerializerOptions' instances — covered by PSH1416 +dotnet_diagnostic.CA1870.severity = none # Use a cached 'SearchValues' instance — covered by PSH1213 dotnet_diagnostic.CA1871.severity = error # Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull' -dotnet_diagnostic.CA1872.severity = error # Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString' — covered by PSH1224 -dotnet_diagnostic.CA1873.severity = error # Avoid potentially expensive evaluation of arguments to 'Debug.Assert' — covered by PSH1417 -dotnet_diagnostic.CA1874.severity = error # Use 'Regex.IsMatch' — covered by PSH1406 -dotnet_diagnostic.CA1875.severity = error # Use 'Regex.Count' — covered by PSH1406 -dotnet_diagnostic.CA1877.severity = error # Use 'Encoding.GetString' instead of 'Encoding.GetChars' — covered by PSH1225 +dotnet_diagnostic.CA1872.severity = none # Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString' — covered by PSH1224 +dotnet_diagnostic.CA1873.severity = none # Avoid potentially expensive evaluation of arguments to 'Debug.Assert' — covered by PSH1417 +dotnet_diagnostic.CA1874.severity = none # Use 'Regex.IsMatch' — covered by PSH1406 +dotnet_diagnostic.CA1875.severity = none # Use 'Regex.Count' — covered by PSH1406 +dotnet_diagnostic.CA1877.severity = none # Use 'Encoding.GetString' instead of 'Encoding.GetChars' — covered by PSH1225 # Reliability -dotnet_diagnostic.CA2000.severity = error # Dispose objects before losing scope +dotnet_diagnostic.CA2000.severity = suggestion # Dispose objects before losing scope dotnet_diagnostic.CA2002.severity = error # Do not lock on objects with weak identity -dotnet_diagnostic.CA2007.severity = error # Do not directly await a Task — Rx and library callers drive synchronization context themselves +dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task — Rx and library callers drive synchronization context themselves dotnet_diagnostic.CA2008.severity = error # Do not create tasks without passing a TaskScheduler dotnet_diagnostic.CA2009.severity = error # Do not call ToImmutableCollection on an ImmutableCollection value dotnet_diagnostic.CA2011.severity = error # Do not assign property within its setter @@ -365,35 +365,35 @@ dotnet_diagnostic.CA2026.severity = error # Do not use methods or types annotate dotnet_diagnostic.CA1801.severity = error # Review unused parameters dotnet_code_quality.CA1801.api_surface = private, internal # only flag non-public APIs so we don't break public signatures dotnet_diagnostic.CA1816.severity = error # Call GC.SuppressFinalize correctly -dotnet_diagnostic.CA2200.severity = error # Rethrow to preserve stack details — covered by SST1430 +dotnet_diagnostic.CA2200.severity = none # Rethrow to preserve stack details — covered by SST1430 dotnet_diagnostic.CA2201.severity = error # Do not raise reserved exception types dotnet_diagnostic.CA2207.severity = error # Initialize value type static fields inline -dotnet_diagnostic.CA2208.severity = error # Instantiate argument exceptions correctly — too sensitive: flags valid context-forwarding nameof(arg.Property) patterns -dotnet_diagnostic.CA2211.severity = error # Non-constant fields should not be visible — covered by SST1499 +dotnet_diagnostic.CA2208.severity = none # Instantiate argument exceptions correctly — too sensitive: flags valid context-forwarding nameof(arg.Property) patterns +dotnet_diagnostic.CA2211.severity = none # Non-constant fields should not be visible — covered by SST1499 dotnet_diagnostic.CA2213.severity = error # Disposable fields should be disposed -dotnet_diagnostic.CA2214.severity = error # Do not call overridable methods in constructors — covered by SST1483 +dotnet_diagnostic.CA2214.severity = none # Do not call overridable methods in constructors — covered by SST1483 dotnet_diagnostic.CA2215.severity = error # Dispose methods should call base class dispose -dotnet_diagnostic.CA2216.severity = error # Disposable types should declare finalizer — conflicts with SST2317, which owns the owned-native-handle shape and prescribes a SafeHandle instead of a finalizer -dotnet_diagnostic.CA2217.severity = error # Do not mark enums with FlagsAttribute — covered by SST2303 +dotnet_diagnostic.CA2216.severity = none # Disposable types should declare finalizer — conflicts with SST2317, which owns the owned-native-handle shape and prescribes a SafeHandle instead of a finalizer +dotnet_diagnostic.CA2217.severity = none # Do not mark enums with FlagsAttribute — covered by SST2303 dotnet_diagnostic.CA2218.severity = error # Override GetHashCode on overriding Equals dotnet_diagnostic.CA2219.severity = error # Do not raise exceptions in finally clauses -dotnet_diagnostic.CA2224.severity = error # Override Equals on overloading operator equals — covered by SST2302 +dotnet_diagnostic.CA2224.severity = none # Override Equals on overloading operator equals — covered by SST2302 dotnet_diagnostic.CA2225.severity = error # Operator overloads have named alternates dotnet_diagnostic.CA2226.severity = error # Operators should have symmetrical overloads -dotnet_diagnostic.CA2227.severity = error # Collection properties should be read only — settable collection properties are common in our DTOs and config types +dotnet_diagnostic.CA2227.severity = none # Collection properties should be read only — settable collection properties are common in our DTOs and config types dotnet_diagnostic.CA2231.severity = error # Overload operator equals on overriding ValueType.Equals dotnet_diagnostic.CA2234.severity = error # Pass System.Uri objects instead of strings dotnet_diagnostic.CA2241.severity = error # Provide correct arguments to formatting methods -dotnet_diagnostic.CA2242.severity = error # Test for NaN correctly — covered by SST1473 +dotnet_diagnostic.CA2242.severity = none # Test for NaN correctly — covered by SST1473 dotnet_diagnostic.CA2243.severity = error # Attribute string literals should parse correctly dotnet_diagnostic.CA2244.severity = error # Do not duplicate indexed element initializations -dotnet_diagnostic.CA2245.severity = error # Do not assign a property to itself — covered by SST1189 +dotnet_diagnostic.CA2245.severity = none # Do not assign a property to itself — covered by SST1189 dotnet_diagnostic.CA2246.severity = error # Do not assign a symbol and its member in the same statement dotnet_diagnostic.CA2247.severity = error # Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum dotnet_diagnostic.CA2248.severity = error # Provide correct enum argument to Enum.HasFlag dotnet_diagnostic.CA2249.severity = error # Use String.Contains instead of String.IndexOf for substring checks dotnet_diagnostic.CA2250.severity = error # Use ThrowIfCancellationRequested -dotnet_diagnostic.CA2251.severity = error # Covered by PSH1216 (canonical) +dotnet_diagnostic.CA2251.severity = none # Covered by PSH1216 (canonical) dotnet_diagnostic.CA2252.severity = error # Opt in to preview features before using them dotnet_diagnostic.CA2253.severity = error # Named placeholders should not be numeric values dotnet_diagnostic.CA2254.severity = error # Template should be a static expression @@ -700,126 +700,126 @@ dotnet_diagnostic.SYSLIB1104.severity = error # Configuration binding source gen # etc.) so we don't double-report. # Bug catchers — always error. -dotnet_diagnostic.IDE0035.severity = error # Remove unreachable code — covered by SST1453 -dotnet_diagnostic.IDE0043.severity = error # Format string contains invalid placeholder — covered by SST1454 -dotnet_diagnostic.IDE0052.severity = error # Remove unread private member — covered by SST1441 +dotnet_diagnostic.IDE0035.severity = none # Remove unreachable code — covered by SST1453 +dotnet_diagnostic.IDE0043.severity = none # Format string contains invalid placeholder — covered by SST1454 +dotnet_diagnostic.IDE0052.severity = none # Remove unread private member — covered by SST1441 # Simplification / cleanup. -dotnet_diagnostic.IDE0002.severity = error # Simplify member access — covered by SST1117 -dotnet_diagnostic.IDE0004.severity = error # Remove unnecessary cast — covered by SST1175 -dotnet_diagnostic.IDE0016.severity = error # Use throw expression — covered by SST2207 -dotnet_diagnostic.IDE0019.severity = error # Use pattern matching to avoid 'as' followed by a 'null' check — covered by SST2005/SST2274 -dotnet_diagnostic.IDE0028.severity = error # Use collection initializers — covered by SST1194 -dotnet_diagnostic.IDE0031.severity = error # Use null propagation — covered by SST1196 -dotnet_diagnostic.IDE0038.severity = error # Use pattern matching ('is' check without a cast) — covered by SST2007 -dotnet_diagnostic.IDE0041.severity = error # Use 'is null' check — covered by SST1149/SST2231/SST2282 -dotnet_diagnostic.IDE0042.severity = error # Deconstruct variable declaration — covered by SST2214 -dotnet_diagnostic.IDE0044.severity = error # Add readonly modifier — covered by SST1424 -dotnet_diagnostic.IDE0047.severity = error # Remove unnecessary parentheses — covered by SST1459 -dotnet_diagnostic.IDE0049.severity = error # Use language keywords instead of framework type names for type references — covered by SST1121 -dotnet_diagnostic.IDE0057.severity = error # Use range operator — covered by SST2204 -dotnet_diagnostic.IDE0059.severity = error # Remove unnecessary value assignment — covered by SST2222 -dotnet_diagnostic.IDE0064.severity = error # Make struct fields writable — flag readonly-but-mutable struct fields where intent diverges from declaration -dotnet_diagnostic.IDE0066.severity = error # Use switch expression — covered by SST2201 -dotnet_diagnostic.IDE0075.severity = error # Simplify conditional expression — covered by SST1182 -dotnet_diagnostic.IDE0078.severity = error # Use pattern matching — covered by SST2006/SST2231 -dotnet_diagnostic.IDE0084.severity = error # Use pattern matching ('IsNot' operator) -dotnet_diagnostic.IDE0120.severity = error # Simplify LINQ expression — covered by PSH1100/PSH1101 -dotnet_diagnostic.IDE0221.severity = error # Add explicit cast — covered by SST2226 -dotnet_diagnostic.IDE0250.severity = error # Make struct 'readonly' — covered by PSH1014 -dotnet_diagnostic.IDE0260.severity = error # Use pattern matching — covered by SST2006/SST2231 +dotnet_diagnostic.IDE0002.severity = none # Simplify member access — covered by SST1117 +dotnet_diagnostic.IDE0004.severity = none # Remove unnecessary cast — covered by SST1175 +dotnet_diagnostic.IDE0016.severity = none # Use throw expression — covered by SST2207 +dotnet_diagnostic.IDE0019.severity = none # Use pattern matching to avoid 'as' followed by a 'null' check — covered by SST2005/SST2274 +dotnet_diagnostic.IDE0028.severity = none # Use collection initializers — covered by SST1194 +dotnet_diagnostic.IDE0031.severity = none # Use null propagation — covered by SST1196 +dotnet_diagnostic.IDE0038.severity = none # Use pattern matching ('is' check without a cast) — covered by SST2007 +dotnet_diagnostic.IDE0041.severity = none # Use 'is null' check — covered by SST1149/SST2231/SST2282 +dotnet_diagnostic.IDE0042.severity = none # Deconstruct variable declaration — covered by SST2214 +dotnet_diagnostic.IDE0044.severity = none # Add readonly modifier — covered by SST1424 +dotnet_diagnostic.IDE0047.severity = none # Remove unnecessary parentheses — covered by SST1459 +dotnet_diagnostic.IDE0049.severity = none # Use language keywords instead of framework type names for type references — covered by SST1121 +dotnet_diagnostic.IDE0057.severity = none # Use range operator — covered by SST2204 +dotnet_diagnostic.IDE0059.severity = none # Remove unnecessary value assignment — covered by SST2222 +dotnet_diagnostic.IDE0064.severity = none # Make struct fields writable — flag readonly-but-mutable struct fields where intent diverges from declaration +dotnet_diagnostic.IDE0066.severity = none # Use switch expression — covered by SST2201 +dotnet_diagnostic.IDE0075.severity = none # Simplify conditional expression — covered by SST1182 +dotnet_diagnostic.IDE0078.severity = none # Use pattern matching — covered by SST2006/SST2231 +dotnet_diagnostic.IDE0084.severity = none # Use pattern matching ('IsNot' operator) +dotnet_diagnostic.IDE0120.severity = none # Simplify LINQ expression — covered by PSH1100/PSH1101 +dotnet_diagnostic.IDE0221.severity = none # Add explicit cast — covered by SST2226 +dotnet_diagnostic.IDE0250.severity = none # Make struct 'readonly' — covered by PSH1014 +dotnet_diagnostic.IDE0260.severity = none # Use pattern matching — covered by SST2006/SST2231 # Disabled — conflict with an existing SA/CA rule or project convention. -dotnet_diagnostic.IDE0007.severity = error # Use var — we don't force var in either direction -dotnet_diagnostic.IDE0008.severity = error # Use explicit type — we don't force var in either direction -dotnet_diagnostic.IDE0009.severity = error # Member access should be qualified — SA1101 = none -dotnet_diagnostic.IDE0021.severity = error # Use expression body for constructors — covered by SST2276 (opt-in) -dotnet_diagnostic.IDE0022.severity = error # Use expression body for methods — covered by SST2275 -dotnet_diagnostic.IDE0023.severity = error # Use expression body for conversion operators — covered by SST2278 (opt-in) -dotnet_diagnostic.IDE0024.severity = error # Use expression body for operators — covered by SST2277 (opt-in) -dotnet_diagnostic.IDE0025.severity = error # Use expression body for properties — covered by SST2279 -dotnet_diagnostic.IDE0026.severity = error # Use expression body for indexers — covered by SST2280 -dotnet_diagnostic.IDE0048.severity = error # Add parentheses for clarity — preference not enforced -dotnet_diagnostic.IDE0055.severity = error # Formatting — StyleCop SA rules own formatting -dotnet_diagnostic.IDE0058.severity = error # Remove unnecessary expression value — covered by SST2221 -dotnet_diagnostic.IDE0060.severity = error # Remove unused parameter — CA1801 handles (with api_surface config) -dotnet_diagnostic.IDE0061.severity = error # Use expression body for local function — covered by SST2281 -dotnet_diagnostic.IDE0079.severity = error # Remove unnecessary suppression — can misfire on multi-TFM suppressions -dotnet_diagnostic.IDE0130.severity = error # Namespace does not match folder structure — we don't enforce strict mirror -dotnet_diagnostic.IDE0160.severity = error # Use block-scoped namespace — we use file-scoped (IDE0161) -dotnet_diagnostic.IDE0210.severity = error # Convert to top-level statements — we use Main style -dotnet_diagnostic.IDE0211.severity = error # Convert to 'Program.Main' style — we use Main style -dotnet_diagnostic.IDE0300.severity = error # Use collection expression for array — covered by SST2101 -dotnet_diagnostic.IDE0306.severity = error # Use collection expression for new — covered by SST2101 -dotnet_diagnostic.IDE0320.severity = error # Make anonymous function static — covered by PSH1000 -dotnet_diagnostic.IDE0050.severity = error # Convert anonymous type to tuple — covered by SST2224 -dotnet_diagnostic.IDE0310.severity = error # Convert lambda expression to method group — handled by RCS1207 -dotnet_diagnostic.IDE0360.severity = error # Simplify property accessor — covered by SST2219 -dotnet_diagnostic.IDE0370.severity = error # Remove unnecessary suppression (null-forgiving operator) — disabled for the same reason as RCS1249: multi-TFM nullability annotations can differ per platform +dotnet_diagnostic.IDE0007.severity = none # Use var — we don't force var in either direction +dotnet_diagnostic.IDE0008.severity = none # Use explicit type — we don't force var in either direction +dotnet_diagnostic.IDE0009.severity = none # Member access should be qualified — SA1101 = none +dotnet_diagnostic.IDE0021.severity = none # Use expression body for constructors — covered by SST2276 (opt-in) +dotnet_diagnostic.IDE0022.severity = none # Use expression body for methods — covered by SST2275 +dotnet_diagnostic.IDE0023.severity = none # Use expression body for conversion operators — covered by SST2278 (opt-in) +dotnet_diagnostic.IDE0024.severity = none # Use expression body for operators — covered by SST2277 (opt-in) +dotnet_diagnostic.IDE0025.severity = none # Use expression body for properties — covered by SST2279 +dotnet_diagnostic.IDE0026.severity = none # Use expression body for indexers — covered by SST2280 +dotnet_diagnostic.IDE0048.severity = none # Add parentheses for clarity — preference not enforced +dotnet_diagnostic.IDE0055.severity = none # Formatting — StyleCop SA rules own formatting +dotnet_diagnostic.IDE0058.severity = none # Remove unnecessary expression value — covered by SST2221 +dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter — CA1801 handles (with api_surface config) +dotnet_diagnostic.IDE0061.severity = none # Use expression body for local function — covered by SST2281 +dotnet_diagnostic.IDE0079.severity = none # Remove unnecessary suppression — can misfire on multi-TFM suppressions +dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure — we don't enforce strict mirror +dotnet_diagnostic.IDE0160.severity = none # Use block-scoped namespace — we use file-scoped (IDE0161) +dotnet_diagnostic.IDE0210.severity = none # Convert to top-level statements — we use Main style +dotnet_diagnostic.IDE0211.severity = none # Convert to 'Program.Main' style — we use Main style +dotnet_diagnostic.IDE0300.severity = none # Use collection expression for array — covered by SST2101 +dotnet_diagnostic.IDE0306.severity = none # Use collection expression for new — covered by SST2101 +dotnet_diagnostic.IDE0320.severity = none # Make anonymous function static — covered by PSH1000 +dotnet_diagnostic.IDE0050.severity = none # Convert anonymous type to tuple — covered by SST2224 +dotnet_diagnostic.IDE0310.severity = none # Convert lambda expression to method group — handled by RCS1207 +dotnet_diagnostic.IDE0360.severity = none # Simplify property accessor — covered by SST2219 +dotnet_diagnostic.IDE0370.severity = none # Remove unnecessary suppression (null-forgiving operator) — disabled for the same reason as RCS1249: multi-TFM nullability annotations can differ per platform # Language and unnecessary code rules. -dotnet_diagnostic.IDE0001.severity = error # Simplify name -dotnet_diagnostic.IDE0003.severity = error # Name can be simplified -dotnet_diagnostic.IDE0005.severity = error # Remove unnecessary import -dotnet_diagnostic.IDE0010.severity = error # Add missing cases to switch statement -dotnet_diagnostic.IDE0011.severity = error # Add braces -dotnet_diagnostic.IDE0017.severity = error # Use object initializers -dotnet_diagnostic.IDE0018.severity = error # Inline variable declaration -dotnet_diagnostic.IDE0020.severity = error # Use pattern matching to avoid is check followed by a cast (with variable) -dotnet_diagnostic.IDE0027.severity = error # Use expression body for accessors -dotnet_diagnostic.IDE0029.severity = error # Null check can be simplified -dotnet_diagnostic.IDE0030.severity = error # Null check can be simplified -dotnet_diagnostic.IDE0032.severity = error # Use auto property -dotnet_diagnostic.IDE0033.severity = error # Use explicitly provided tuple name -dotnet_diagnostic.IDE0034.severity = error # Simplify default expression -dotnet_diagnostic.IDE0036.severity = error # Order modifiers -dotnet_diagnostic.IDE0037.severity = error # Use inferred member name -dotnet_diagnostic.IDE0039.severity = error # Use local function instead of lambda -dotnet_diagnostic.IDE0040.severity = error # Add accessibility modifiers -dotnet_diagnostic.IDE0045.severity = error # Use conditional expression for assignment -dotnet_diagnostic.IDE0046.severity = error # Use conditional expression for return -dotnet_diagnostic.IDE0051.severity = error # Remove unused private member -dotnet_diagnostic.IDE0053.severity = error # Use expression body for lambdas -dotnet_diagnostic.IDE0054.severity = error # Use compound assignment -dotnet_diagnostic.IDE0056.severity = error # Use index operator -dotnet_diagnostic.IDE0062.severity = error # Make local function static -dotnet_diagnostic.IDE0063.severity = error # Use simple using statement -dotnet_diagnostic.IDE0065.severity = error # Using directive placement -dotnet_diagnostic.IDE0070.severity = error # Use System.HashCode.Combine -dotnet_diagnostic.IDE0071.severity = error # Simplify interpolation -dotnet_diagnostic.IDE0072.severity = error # Add missing cases to switch expression -dotnet_diagnostic.IDE0073.severity = error # Use file header -dotnet_diagnostic.IDE0074.severity = error # Use coalesce compound assignment -dotnet_diagnostic.IDE0076.severity = error # Remove invalid global SuppressMessageAttribute -dotnet_diagnostic.IDE0077.severity = error # Avoid legacy format target in global SuppressMessageAttribute -dotnet_diagnostic.IDE0080.severity = error # Remove unnecessary suppression operator -dotnet_diagnostic.IDE0082.severity = error # Convert typeof to nameof -dotnet_diagnostic.IDE0083.severity = error # Use pattern matching (not operator) -dotnet_diagnostic.IDE0090.severity = error # Simplify new expression -dotnet_diagnostic.IDE0100.severity = error # Remove unnecessary equality operator -dotnet_diagnostic.IDE0110.severity = error # Remove unnecessary discard -dotnet_diagnostic.IDE0150.severity = error # Prefer null check over type check -dotnet_diagnostic.IDE0161.severity = error # Use file-scoped namespace -dotnet_diagnostic.IDE0170.severity = error # Simplify property pattern -dotnet_diagnostic.IDE0180.severity = error # Use tuple to swap values -dotnet_diagnostic.IDE0200.severity = error # Remove unnecessary lambda expression -dotnet_diagnostic.IDE0220.severity = error # Add explicit cast in foreach loop -dotnet_diagnostic.IDE0230.severity = error # Use UTF-8 string literal -dotnet_diagnostic.IDE0240.severity = error # Nullable directive is redundant -dotnet_diagnostic.IDE0241.severity = error # Nullable directive is unnecessary -dotnet_diagnostic.IDE0251.severity = error # Member can be made readonly -dotnet_diagnostic.IDE0270.severity = error # Null check can be simplified -dotnet_diagnostic.IDE0280.severity = error # Use nameof -dotnet_diagnostic.IDE0290.severity = error # Use primary constructor -dotnet_diagnostic.IDE0301.severity = error # Use collection expression for empty -dotnet_diagnostic.IDE0302.severity = error # Use collection expression for stackalloc -dotnet_diagnostic.IDE0303.severity = error # Use collection expression for Create() -dotnet_diagnostic.IDE0304.severity = error # Use collection expression for builder -dotnet_diagnostic.IDE0305.severity = error # Use collection expression for fluent -dotnet_diagnostic.IDE0340.severity = error # Use unbound generic type -dotnet_diagnostic.IDE0350.severity = error # Use implicitly typed lambda -dotnet_diagnostic.IDE0380.severity = error # Remove unnecessary unsafe modifier -dotnet_diagnostic.IDE1005.severity = error # Use conditional delegate call +dotnet_diagnostic.IDE0001.severity = none # Simplify name +dotnet_diagnostic.IDE0003.severity = none # Name can be simplified +dotnet_diagnostic.IDE0005.severity = none # Remove unnecessary import +dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement +dotnet_diagnostic.IDE0011.severity = none # Add braces +dotnet_diagnostic.IDE0017.severity = none # Use object initializers +dotnet_diagnostic.IDE0018.severity = none # Inline variable declaration +dotnet_diagnostic.IDE0020.severity = none # Use pattern matching to avoid is check followed by a cast (with variable) +dotnet_diagnostic.IDE0027.severity = none # Use expression body for accessors +dotnet_diagnostic.IDE0029.severity = none # Null check can be simplified +dotnet_diagnostic.IDE0030.severity = none # Null check can be simplified +dotnet_diagnostic.IDE0032.severity = none # Use auto property +dotnet_diagnostic.IDE0033.severity = none # Use explicitly provided tuple name +dotnet_diagnostic.IDE0034.severity = none # Simplify default expression +dotnet_diagnostic.IDE0036.severity = none # Order modifiers +dotnet_diagnostic.IDE0037.severity = none # Use inferred member name +dotnet_diagnostic.IDE0039.severity = none # Use local function instead of lambda +dotnet_diagnostic.IDE0040.severity = none # Add accessibility modifiers +dotnet_diagnostic.IDE0045.severity = none # Use conditional expression for assignment +dotnet_diagnostic.IDE0046.severity = none # Use conditional expression for return +dotnet_diagnostic.IDE0051.severity = none # Remove unused private member +dotnet_diagnostic.IDE0053.severity = none # Use expression body for lambdas +dotnet_diagnostic.IDE0054.severity = none # Use compound assignment +dotnet_diagnostic.IDE0056.severity = none # Use index operator +dotnet_diagnostic.IDE0062.severity = none # Make local function static +dotnet_diagnostic.IDE0063.severity = none # Use simple using statement +dotnet_diagnostic.IDE0065.severity = none # Using directive placement +dotnet_diagnostic.IDE0070.severity = none # Use System.HashCode.Combine +dotnet_diagnostic.IDE0071.severity = none # Simplify interpolation +dotnet_diagnostic.IDE0072.severity = none # Add missing cases to switch expression +dotnet_diagnostic.IDE0073.severity = none # Use file header +dotnet_diagnostic.IDE0074.severity = none # Use coalesce compound assignment +dotnet_diagnostic.IDE0076.severity = none # Remove invalid global SuppressMessageAttribute +dotnet_diagnostic.IDE0077.severity = none # Avoid legacy format target in global SuppressMessageAttribute +dotnet_diagnostic.IDE0080.severity = none # Remove unnecessary suppression operator +dotnet_diagnostic.IDE0082.severity = none # Convert typeof to nameof +dotnet_diagnostic.IDE0083.severity = none # Use pattern matching (not operator) +dotnet_diagnostic.IDE0090.severity = none # Simplify new expression +dotnet_diagnostic.IDE0100.severity = none # Remove unnecessary equality operator +dotnet_diagnostic.IDE0110.severity = none # Remove unnecessary discard +dotnet_diagnostic.IDE0150.severity = none # Prefer null check over type check +dotnet_diagnostic.IDE0161.severity = none # Use file-scoped namespace +dotnet_diagnostic.IDE0170.severity = none # Simplify property pattern +dotnet_diagnostic.IDE0180.severity = none # Use tuple to swap values +dotnet_diagnostic.IDE0200.severity = none # Remove unnecessary lambda expression +dotnet_diagnostic.IDE0220.severity = none # Add explicit cast in foreach loop +dotnet_diagnostic.IDE0230.severity = none # Use UTF-8 string literal +dotnet_diagnostic.IDE0240.severity = none # Nullable directive is redundant +dotnet_diagnostic.IDE0241.severity = none # Nullable directive is unnecessary +dotnet_diagnostic.IDE0251.severity = none # Member can be made readonly +dotnet_diagnostic.IDE0270.severity = none # Null check can be simplified +dotnet_diagnostic.IDE0280.severity = none # Use nameof +dotnet_diagnostic.IDE0290.severity = none # Use primary constructor +dotnet_diagnostic.IDE0301.severity = none # Use collection expression for empty +dotnet_diagnostic.IDE0302.severity = none # Use collection expression for stackalloc +dotnet_diagnostic.IDE0303.severity = none # Use collection expression for Create() +dotnet_diagnostic.IDE0304.severity = none # Use collection expression for builder +dotnet_diagnostic.IDE0305.severity = none # Use collection expression for fluent +dotnet_diagnostic.IDE0340.severity = none # Use unbound generic type +dotnet_diagnostic.IDE0350.severity = none # Use implicitly typed lambda +dotnet_diagnostic.IDE0380.severity = none # Remove unnecessary unsafe modifier +dotnet_diagnostic.IDE1005.severity = none # Use conditional delegate call # Naming and miscellaneous # Naming conventions — SA1300 family already enforces PascalCase / interface @@ -827,271 +827,271 @@ dotnet_diagnostic.IDE1005.severity = error # Use conditional delegate call # deliberately disabled). Leaving IDE1006 off because configuring # `dotnet_naming_rule.*` would duplicate what SA already enforces and could # conflict with the _underscore convention. -dotnet_diagnostic.IDE1006.severity = error # Naming rule violation — SA1300 family handles naming -dotnet_diagnostic.IDE3000.severity = error # Disabled per project convention — not enforced +dotnet_diagnostic.IDE1006.severity = none # Naming rule violation — SA1300 family handles naming +dotnet_diagnostic.IDE3000.severity = none # Disabled per project convention — not enforced ################### # Roslynator.CSharp.Analyzers (RCS) ################### # Code simplification -dotnet_diagnostic.RCS1001.severity = error # Add braces (when expression spans over multiple lines) — covered by SST1519 -dotnet_diagnostic.RCS1003.severity = error # Add braces to if-else (when expression spans over multiple lines) — covered by SST1519 -dotnet_diagnostic.RCS1005.severity = error # Simplify nested using statement -dotnet_diagnostic.RCS1006.severity = error # Merge 'else' with nested 'if' — covered by SST1465 +dotnet_diagnostic.RCS1001.severity = none # Add braces (when expression spans over multiple lines) — covered by SST1519 +dotnet_diagnostic.RCS1003.severity = none # Add braces to if-else (when expression spans over multiple lines) — covered by SST1519 +dotnet_diagnostic.RCS1005.severity = none # Simplify nested using statement — stacks the usings so the outer statement's child is a bare using, which SST1503 then reports for omitting braces; SST2236 covers the using-declaration direction +dotnet_diagnostic.RCS1006.severity = none # Merge 'else' with nested 'if' — covered by SST1465 dotnet_diagnostic.RCS1007.severity = error # Add braces -dotnet_diagnostic.RCS1031.severity = error # Remove unnecessary braces in switch section -- we don't mind braces in switch statements +dotnet_diagnostic.RCS1031.severity = none # Remove unnecessary braces in switch section -- we don't mind braces in switch statements dotnet_diagnostic.RCS1032.severity = error # Remove redundant parentheses -dotnet_diagnostic.RCS1033.severity = error # Remove redundant boolean literal — covered by SST1143 -dotnet_diagnostic.RCS1039.severity = error # Remove argument list from attribute — covered by SST1411 -dotnet_diagnostic.RCS1040.severity = error # Remove empty statement — covered by SST1180 -dotnet_diagnostic.RCS1042.severity = error # Remove enum default underlying type — covered by SST1177 +dotnet_diagnostic.RCS1033.severity = none # Remove redundant boolean literal — covered by SST1143 +dotnet_diagnostic.RCS1039.severity = none # Remove argument list from attribute — covered by SST1411 +dotnet_diagnostic.RCS1040.severity = none # Remove empty statement — covered by SST1180 +dotnet_diagnostic.RCS1042.severity = none # Remove enum default underlying type — covered by SST1177 dotnet_diagnostic.RCS1043.severity = error # Remove 'partial' modifier from type with a single part -dotnet_diagnostic.RCS1049.severity = error # Simplify boolean comparison — covered by SST1143 -dotnet_diagnostic.RCS1058.severity = error # Use compound assignment — covered by SST1185 -dotnet_diagnostic.RCS1061.severity = error # Merge 'if' with nested 'if' — covered by SST2013 -dotnet_diagnostic.RCS1068.severity = error # Simplify logical negation — covered by SST1172/SST2006 -dotnet_diagnostic.RCS1069.severity = error # Remove unnecessary case label — covered by SST1466 -dotnet_diagnostic.RCS1070.severity = error # Remove redundant default switch section — covered by SST1179 -dotnet_diagnostic.RCS1071.severity = error # Remove redundant base constructor call — covered by SST1178 -dotnet_diagnostic.RCS1072.severity = error # Remove empty namespace declaration — covered by SST1435 -dotnet_diagnostic.RCS1073.severity = error # Convert 'if' to 'return' statement — covered by SST1197 -dotnet_diagnostic.RCS1074.severity = error # Remove redundant constructor — covered by SST1433 -dotnet_diagnostic.RCS1078.severity = error # Use "" or 'string.Empty' — conflicts with SST1122, which owns the string.Empty direction -dotnet_diagnostic.RCS1084.severity = error # Use coalesce expression instead of conditional expression — covered by SST1195 -dotnet_diagnostic.RCS1085.severity = error # Use auto-implemented property — covered by SST1420 +dotnet_diagnostic.RCS1049.severity = none # Simplify boolean comparison — covered by SST1143 +dotnet_diagnostic.RCS1058.severity = none # Use compound assignment — covered by SST1185 +dotnet_diagnostic.RCS1061.severity = none # Merge 'if' with nested 'if' — covered by SST2013 +dotnet_diagnostic.RCS1068.severity = none # Simplify logical negation — covered by SST1172/SST2006 +dotnet_diagnostic.RCS1069.severity = none # Remove unnecessary case label — covered by SST1466 +dotnet_diagnostic.RCS1070.severity = none # Remove redundant default switch section — covered by SST1179 +dotnet_diagnostic.RCS1071.severity = none # Remove redundant base constructor call — covered by SST1178 +dotnet_diagnostic.RCS1072.severity = none # Remove empty namespace declaration — covered by SST1435 +dotnet_diagnostic.RCS1073.severity = none # Convert 'if' to 'return' statement — covered by SST1197 +dotnet_diagnostic.RCS1074.severity = none # Remove redundant constructor — covered by SST1433 +dotnet_diagnostic.RCS1078.severity = none # Use "" or 'string.Empty' — conflicts with SST1122, which owns the string.Empty direction +dotnet_diagnostic.RCS1084.severity = none # Use coalesce expression instead of conditional expression — covered by SST1195 +dotnet_diagnostic.RCS1085.severity = none # Use auto-implemented property — covered by SST1420 dotnet_diagnostic.RCS1089.severity = error # Use --/++ operator instead of assignment dotnet_diagnostic.RCS1097.severity = error # Remove redundant 'ToString' call dotnet_diagnostic.RCS1103.severity = error # Convert 'if' to assignment -dotnet_diagnostic.RCS1104.severity = error # Simplify conditional expression — covered by SST1182 +dotnet_diagnostic.RCS1104.severity = none # Simplify conditional expression — covered by SST1182 dotnet_diagnostic.RCS1105.severity = error # Unnecessary interpolation -dotnet_diagnostic.RCS1106.severity = error # Remove empty destructor — covered by PSH1002 -dotnet_diagnostic.RCS1107.severity = error # Remove redundant 'ToCharArray' call — covered by PSH1217 +dotnet_diagnostic.RCS1106.severity = none # Remove empty destructor — covered by PSH1002 +dotnet_diagnostic.RCS1107.severity = none # Remove redundant 'ToCharArray' call — covered by PSH1217 dotnet_diagnostic.RCS1114.severity = error # Remove redundant delegate creation -dotnet_diagnostic.RCS1124.severity = error # Inline local variable +dotnet_diagnostic.RCS1124.severity = none # Inline local variable — duplicates SST2266, and inlining the last local leaves a single-statement body that SST2275 then reports, so the two rules cannot both be satisfied dotnet_diagnostic.RCS1126.severity = error # Add braces to if-else dotnet_diagnostic.RCS1128.severity = error # Use coalesce expression -dotnet_diagnostic.RCS1129.severity = error # Remove redundant field initialization — covered by SST1176 -dotnet_diagnostic.RCS1132.severity = error # Remove redundant overriding member — covered by SST1181 +dotnet_diagnostic.RCS1129.severity = none # Remove redundant field initialization — covered by SST1176 +dotnet_diagnostic.RCS1132.severity = none # Remove redundant overriding member — covered by SST1181 dotnet_diagnostic.RCS1133.severity = error # Remove redundant Dispose/Close call -dotnet_diagnostic.RCS1134.severity = error # Remove redundant statement — covered by SST1174 +dotnet_diagnostic.RCS1134.severity = none # Remove redundant statement — covered by SST1174 dotnet_diagnostic.RCS1143.severity = error # Simplify coalesce expression dotnet_diagnostic.RCS1145.severity = error # Remove redundant 'as' operator dotnet_diagnostic.RCS1146.severity = error # Use conditional access -dotnet_diagnostic.RCS1151.severity = error # Remove redundant cast — covered by SST1175 +dotnet_diagnostic.RCS1151.severity = none # Remove redundant cast — covered by SST1175 dotnet_diagnostic.RCS1171.severity = error # Simplify lazy initialization dotnet_diagnostic.RCS1173.severity = error # Use coalesce expression instead of 'if' -dotnet_diagnostic.RCS1174.severity = error # Remove redundant async/await — covered by PSH1311 +dotnet_diagnostic.RCS1174.severity = none # Remove redundant async/await — covered by PSH1311 dotnet_diagnostic.RCS1179.severity = error # Unnecessary assignment dotnet_diagnostic.RCS1180.severity = error # Inline lazy initialization -dotnet_diagnostic.RCS1188.severity = error # Remove redundant auto-property initialization — covered by SST1176 -dotnet_diagnostic.RCS1192.severity = error # Unnecessary usage of verbatim string literal — covered by SST1184 +dotnet_diagnostic.RCS1188.severity = none # Remove redundant auto-property initialization — covered by SST1176 +dotnet_diagnostic.RCS1192.severity = none # Unnecessary usage of verbatim string literal — covered by SST1184 dotnet_diagnostic.RCS1199.severity = error # Unnecessary null check dotnet_diagnostic.RCS1206.severity = error # Use conditional access instead of conditional expression -dotnet_diagnostic.RCS1207.severity = error # Use anonymous function or method group — conflicts with SST2239, which owns the method-group direction -dotnet_diagnostic.RCS1211.severity = error # Remove unnecessary 'else' — covered by SST1464 +dotnet_diagnostic.RCS1207.severity = none # Use anonymous function or method group — conflicts with SST2239, which owns the method-group direction +dotnet_diagnostic.RCS1211.severity = none # Remove unnecessary 'else' — covered by SST1464 dotnet_diagnostic.RCS1212.severity = error # Remove redundant assignment -dotnet_diagnostic.RCS1214.severity = error # Unnecessary interpolated string — covered by SST1183 +dotnet_diagnostic.RCS1214.severity = none # Unnecessary interpolated string — covered by SST1183 dotnet_diagnostic.RCS1216.severity = error # Unnecessary unsafe context -dotnet_diagnostic.RCS1217.severity = error # Convert interpolated string to concatenation — reverses SST2249, which owns the concatenation-to-interpolation direction +dotnet_diagnostic.RCS1217.severity = none # Convert interpolated string to concatenation — reverses SST2249, which owns the concatenation-to-interpolation direction dotnet_diagnostic.RCS1218.severity = error # Simplify code branching -dotnet_diagnostic.RCS1220.severity = error # Use pattern matching instead of combination of 'is' and cast — covered by SST2007 +dotnet_diagnostic.RCS1220.severity = none # Use pattern matching instead of combination of 'is' and cast — covered by SST2007 dotnet_diagnostic.RCS1221.severity = error # Use pattern matching instead of combination of 'as' and null check -dotnet_diagnostic.RCS1238.severity = error # Avoid nested ?: operators — covered by SST1147 -dotnet_diagnostic.RCS1244.severity = error # Simplify 'default' expression — covered by SST1188 -dotnet_diagnostic.RCS1249.severity = error # Unnecessary null-forgiving operator — disabled because multi-TFM nullability annotations can differ per platform, leading to false positives +dotnet_diagnostic.RCS1238.severity = none # Avoid nested ?: operators — covered by SST1147 +dotnet_diagnostic.RCS1244.severity = none # Simplify 'default' expression — covered by SST1188 +dotnet_diagnostic.RCS1249.severity = none # Unnecessary null-forgiving operator — disabled because multi-TFM nullability annotations can differ per platform, leading to false positives dotnet_diagnostic.RCS1251.severity = error # Remove unnecessary braces from record declaration dotnet_diagnostic.RCS1259.severity = error # Remove empty syntax (replaces RCS1066) dotnet_diagnostic.RCS1262.severity = error # Unnecessary raw string literal -dotnet_diagnostic.RCS1265.severity = error # Remove redundant catch block — covered by SST1470 +dotnet_diagnostic.RCS1265.severity = none # Remove redundant catch block — covered by SST1470 dotnet_diagnostic.RCS1268.severity = error # Simplify numeric comparison # Code quality -dotnet_diagnostic.RCS1013.severity = error # Use predefined type — covered by SST1121 +dotnet_diagnostic.RCS1013.severity = none # Use predefined type — covered by SST1121 dotnet_diagnostic.RCS1014.severity = error # Use explicitly/implicitly typed array dotnet_diagnostic.RCS1015.severity = error # Use nameof operator -dotnet_diagnostic.RCS1016.severity = error # Use block body or expression body — conflicts with SST2219, which owns the expression-bodied accessor direction -dotnet_diagnostic.RCS1020.severity = error # Covered by SST2234 (canonical) +dotnet_diagnostic.RCS1016.severity = none # Use block body or expression body — conflicts with SST2219, which owns the expression-bodied accessor direction +dotnet_diagnostic.RCS1020.severity = none # Covered by SST2234 (canonical) dotnet_diagnostic.RCS1021.severity = error # Convert lambda expression body to expression body -dotnet_diagnostic.RCS1044.severity = error # Remove original exception from throw statement — covered by SST1430 -dotnet_diagnostic.RCS1046.severity = error # Asynchronous method name should end with 'Async' — TUnit test method naming convention doesn't follow the Async suffix — covered by SST1317 +dotnet_diagnostic.RCS1044.severity = none # Remove original exception from throw statement — covered by SST1430 +dotnet_diagnostic.RCS1046.severity = none # Asynchronous method name should end with 'Async' — TUnit test method naming convention doesn't follow the Async suffix — covered by SST1317 dotnet_diagnostic.RCS1047.severity = error # Non-asynchronous method name should not end with 'Async' -dotnet_diagnostic.RCS1048.severity = error # Use lambda expression instead of anonymous method — covered by SST1130 +dotnet_diagnostic.RCS1048.severity = none # Use lambda expression instead of anonymous method — covered by SST1130 dotnet_diagnostic.RCS1050.severity = error # Include/omit parentheses when creating new object -dotnet_diagnostic.RCS1051.severity = error # Add/remove parentheses from condition in conditional operator — conflicts with SST1459, which owns the non-grouping-parenthesis removal direction -dotnet_diagnostic.RCS1056.severity = error # Avoid usage of using alias directive - used to avoid conflicts -dotnet_diagnostic.RCS1059.severity = error # Avoid locking on publicly accessible instance — covered by SST1901 -dotnet_diagnostic.RCS1075.severity = error # Avoid empty catch clause that catches System.Exception — covered by SST1429 +dotnet_diagnostic.RCS1051.severity = none # Add/remove parentheses from condition in conditional operator — conflicts with SST1459, which owns the non-grouping-parenthesis removal direction +dotnet_diagnostic.RCS1056.severity = none # Avoid usage of using alias directive - used to avoid conflicts +dotnet_diagnostic.RCS1059.severity = none # Avoid locking on publicly accessible instance — covered by SST1901 +dotnet_diagnostic.RCS1075.severity = none # Avoid empty catch clause that catches System.Exception — covered by SST1429 dotnet_diagnostic.RCS1079.severity = error # Throwing of new NotImplementedException dotnet_diagnostic.RCS1081.severity = error # Split variable declaration dotnet_diagnostic.RCS1093.severity = error # File contains no code -dotnet_diagnostic.RCS1094.severity = error # Declare using directive on top level — covered by SST1200 -dotnet_diagnostic.RCS1096.severity = error # Use 'HasFlag' method or bitwise operator — covered by PSH1016 -dotnet_diagnostic.RCS1098.severity = error # Constant values should be placed on right side of comparisons — covered by SST1186 -dotnet_diagnostic.RCS1099.severity = error # Default label should be the last label in a switch section — covered by SST1466 -dotnet_diagnostic.RCS1102.severity = error # Make class static — covered by SST1432 +dotnet_diagnostic.RCS1094.severity = none # Declare using directive on top level — covered by SST1200 +dotnet_diagnostic.RCS1096.severity = none # Use 'HasFlag' method or bitwise operator — covered by PSH1016 +dotnet_diagnostic.RCS1098.severity = none # Constant values should be placed on right side of comparisons — covered by SST1186 +dotnet_diagnostic.RCS1099.severity = none # Default label should be the last label in a switch section — covered by SST1466 +dotnet_diagnostic.RCS1102.severity = none # Make class static — covered by SST1432 dotnet_diagnostic.RCS1108.severity = error # Add 'static' modifier to all partial class declarations dotnet_diagnostic.RCS1111.severity = error # Add braces to switch section with multiple statements dotnet_diagnostic.RCS1113.severity = error # Use 'string.IsNullOrEmpty' method -dotnet_diagnostic.RCS1118.severity = error # Mark local variable as const — covered by PSH1402 -dotnet_diagnostic.RCS1123.severity = error # Add parentheses when necessary — covered by SST1407 -dotnet_diagnostic.RCS1130.severity = error # Bitwise operation on enum without Flags attribute — covered by SST2458 +dotnet_diagnostic.RCS1118.severity = none # Mark local variable as const — covered by PSH1402 +dotnet_diagnostic.RCS1123.severity = none # Add parentheses when necessary — covered by SST1407 +dotnet_diagnostic.RCS1130.severity = none # Bitwise operation on enum without Flags attribute — covered by SST2458 dotnet_diagnostic.RCS1135.severity = error # Declare enum member with zero value (when enum has FlagsAttribute) -dotnet_diagnostic.RCS1136.severity = error # Merge switch sections with equivalent content — covered by SST2414 +dotnet_diagnostic.RCS1136.severity = none # Merge switch sections with equivalent content — covered by SST2414 dotnet_diagnostic.RCS1154.severity = error # Sort enum members -dotnet_diagnostic.RCS1155.severity = error # Use StringComparison when comparing strings — covered by PSH1207 -dotnet_diagnostic.RCS1156.severity = error # Use string.Length instead of comparison with empty string — covered by PSH1204 -dotnet_diagnostic.RCS1157.severity = error # Composite enum value contains undefined flag — covered by SST2303 +dotnet_diagnostic.RCS1155.severity = none # Use StringComparison when comparing strings — covered by PSH1207 +dotnet_diagnostic.RCS1156.severity = none # Use string.Length instead of comparison with empty string — covered by PSH1204 +dotnet_diagnostic.RCS1157.severity = none # Composite enum value contains undefined flag — covered by SST2303 dotnet_diagnostic.RCS1159.severity = error # Use EventHandler -dotnet_diagnostic.RCS1160.severity = error # Abstract type should not have public constructors — covered by SST1428 -dotnet_diagnostic.RCS1161.severity = error # Enum should declare explicit values - do not need explicit values -dotnet_diagnostic.RCS1162.severity = error # Avoid chain of assignments — covered by SST1187 -dotnet_diagnostic.RCS1166.severity = error # Value type object is never equal to null — covered by SST1469 -dotnet_diagnostic.RCS1168.severity = error # Parameter name differs from base name — covered by SST1318 +dotnet_diagnostic.RCS1160.severity = none # Abstract type should not have public constructors — covered by SST1428 +dotnet_diagnostic.RCS1161.severity = none # Enum should declare explicit values - do not need explicit values +dotnet_diagnostic.RCS1162.severity = none # Avoid chain of assignments — covered by SST1187 +dotnet_diagnostic.RCS1166.severity = none # Value type object is never equal to null — covered by SST1469 +dotnet_diagnostic.RCS1168.severity = none # Parameter name differs from base name — covered by SST1318 dotnet_diagnostic.RCS1169.severity = error # Make field read-only -dotnet_diagnostic.RCS1170.severity = error # Use read-only auto-implemented property — covered by SST2332 -dotnet_diagnostic.RCS1172.severity = error # Use 'is' operator instead of 'as' operator — covered by SST2005 -dotnet_diagnostic.RCS1187.severity = error # Use constant instead of field — covered by PSH1402 +dotnet_diagnostic.RCS1170.severity = none # Use read-only auto-implemented property — covered by SST2332 +dotnet_diagnostic.RCS1172.severity = none # Use 'is' operator instead of 'as' operator — covered by SST2005 +dotnet_diagnostic.RCS1187.severity = none # Use constant instead of field — covered by PSH1402 dotnet_diagnostic.RCS1191.severity = error # Declare enum value as combination of names -dotnet_diagnostic.RCS1193.severity = error # Overriding member should not change 'params' modifier — covered by SST2426 +dotnet_diagnostic.RCS1193.severity = none # Overriding member should not change 'params' modifier — covered by SST2426 dotnet_diagnostic.RCS1196.severity = error # Call extension method as instance method -dotnet_diagnostic.RCS1200.severity = error # Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy' — covered by PSH1108 +dotnet_diagnostic.RCS1200.severity = none # Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy' — covered by PSH1108 dotnet_diagnostic.RCS1201.severity = error # Use method chaining dotnet_diagnostic.RCS1202.severity = error # Avoid NullReferenceException dotnet_diagnostic.RCS1204.severity = error # Use EventArgs.Empty dotnet_diagnostic.RCS1205.severity = error # Order named arguments according to the order of parameters dotnet_diagnostic.RCS1208.severity = error # Reduce 'if' nesting dotnet_diagnostic.RCS1209.severity = error # Order type parameter constraints -dotnet_diagnostic.RCS1210.severity = error # Return completed task instead of returning null — covered by PSH1312 +dotnet_diagnostic.RCS1210.severity = none # Return completed task instead of returning null — covered by PSH1312 dotnet_diagnostic.RCS1215.severity = error # Expression is always equal to true/false dotnet_diagnostic.RCS1222.severity = error # Merge preprocessor directives -dotnet_diagnostic.RCS1223.severity = error # Mark publicly visible type with DebuggerDisplay attribute — only data types benefit; the rule is too broad to be an error +dotnet_diagnostic.RCS1223.severity = suggestion # Mark publicly visible type with DebuggerDisplay attribute — only data types benefit; the rule is too broad to be an error dotnet_diagnostic.RCS1224.severity = error # Make method an extension method dotnet_diagnostic.RCS1225.severity = error # Make class sealed -dotnet_diagnostic.RCS1227.severity = error # Validate arguments correctly — covered by SST2404 +dotnet_diagnostic.RCS1227.severity = none # Validate arguments correctly — covered by SST2404 dotnet_diagnostic.RCS1229.severity = error # Use async/await when necessary -dotnet_diagnostic.RCS1231.severity = error # Make parameter ref read-only — covered by PSH1007 -dotnet_diagnostic.RCS1233.severity = error # Use short-circuiting operator — covered by SST1468 +dotnet_diagnostic.RCS1231.severity = none # Make parameter ref read-only — covered by PSH1007 +dotnet_diagnostic.RCS1233.severity = none # Use short-circuiting operator — covered by SST1468 dotnet_diagnostic.RCS1234.severity = error # Duplicate enum value dotnet_diagnostic.RCS1239.severity = error # Use 'for' statement instead of 'while' statement dotnet_diagnostic.RCS1240.severity = error # Operator is unnecessary -dotnet_diagnostic.RCS1242.severity = error # Do not pass non-read-only struct by read-only reference — covered by PSH1003 -dotnet_diagnostic.RCS1243.severity = error # Duplicate word in a comment — covered by SST1658 (documentation comments) +dotnet_diagnostic.RCS1242.severity = none # Do not pass non-read-only struct by read-only reference — covered by PSH1003 +dotnet_diagnostic.RCS1243.severity = none # Duplicate word in a comment — covered by SST1658 (documentation comments) dotnet_diagnostic.RCS1247.severity = error # Fix documentation comment tag -dotnet_diagnostic.RCS1248.severity = error # Normalize null check — conflicts with SST1149, which owns the 'is null' pattern direction -dotnet_diagnostic.RCS1250.severity = error # Use implicit/explicit object creation — conflicts with SST2202, which owns the implicit-target-type direction +dotnet_diagnostic.RCS1248.severity = none # Normalize null check — conflicts with SST1149, which owns the 'is null' pattern direction +dotnet_diagnostic.RCS1250.severity = none # Use implicit/explicit object creation — conflicts with SST2202, which owns the implicit-target-type direction dotnet_diagnostic.RCS1252.severity = error # Normalize usage of infinite loop dotnet_diagnostic.RCS1254.severity = error # Normalize format of enum flag value -dotnet_diagnostic.RCS1255.severity = error # Simplify argument null check — conflicts with our ArgumentExceptionHelper helper pattern +dotnet_diagnostic.RCS1255.severity = none # Simplify argument null check — conflicts with our ArgumentExceptionHelper helper pattern dotnet_diagnostic.RCS1257.severity = error # Use enum field explicitly dotnet_diagnostic.RCS1258.severity = error # Unnecessary enum flag -dotnet_diagnostic.RCS1260.severity = error # Add/remove trailing comma — conflicts with SST1413, which owns the trailing-comma direction -dotnet_diagnostic.RCS1261.severity = error # Resource can be disposed asynchronously — covered by PSH1310 +dotnet_diagnostic.RCS1260.severity = none # Add/remove trailing comma — conflicts with SST1413, which owns the trailing-comma direction +dotnet_diagnostic.RCS1261.severity = none # Resource can be disposed asynchronously — covered by PSH1310 dotnet_diagnostic.RCS1264.severity = error # Use 'var' or explicit type (replaces RCS1010, RCS1176, RCS1177) -dotnet_diagnostic.RCS1266.severity = error # Use raw string literal — covered by SST2243 +dotnet_diagnostic.RCS1266.severity = none # Use raw string literal — covered by SST2243 dotnet_diagnostic.RCS1267.severity = error # Use string interpolation instead of 'string.Concat' # Performance -dotnet_diagnostic.RCS1077.severity = error # Covered by the PSH1101-PSH1111 family (canonical) -dotnet_diagnostic.RCS1080.severity = error # Covered by PSH1106 (canonical) -dotnet_diagnostic.RCS1112.severity = error # Combine 'Enumerable.Where' method chain — covered by PSH1109 +dotnet_diagnostic.RCS1077.severity = none # Covered by the PSH1101-PSH1111 family (canonical) +dotnet_diagnostic.RCS1080.severity = none # Covered by PSH1106 (canonical) +dotnet_diagnostic.RCS1112.severity = none # Combine 'Enumerable.Where' method chain — covered by PSH1109 dotnet_diagnostic.RCS1186.severity = error # Use Regex instance instead of static method -dotnet_diagnostic.RCS1190.severity = error # Join string expressions — conflicts with SST2470, which reports the fused-literal seam this would create +dotnet_diagnostic.RCS1190.severity = none # Join string expressions — conflicts with SST2470, which reports the fused-literal seam this would create dotnet_diagnostic.RCS1195.severity = error # Use ^ operator -dotnet_diagnostic.RCS1197.severity = error # Optimize StringBuilder.Append/AppendLine call — covered by PSH1203/PSH1214 -dotnet_diagnostic.RCS1198.severity = error # Avoid unnecessary boxing of value type — boxing is unavoidable bridging Rx and IEnumerable -dotnet_diagnostic.RCS1230.severity = error # Unnecessary explicit use of enumerator — covered by SST1467 +dotnet_diagnostic.RCS1197.severity = none # Optimize StringBuilder.Append/AppendLine call — covered by PSH1203/PSH1214 +dotnet_diagnostic.RCS1198.severity = none # Avoid unnecessary boxing of value type — boxing is unavoidable bridging Rx and IEnumerable +dotnet_diagnostic.RCS1230.severity = none # Unnecessary explicit use of enumerator — covered by SST1467 dotnet_diagnostic.RCS1235.severity = error # Optimize method call -dotnet_diagnostic.RCS1236.severity = error # Use exception filter — covered by SST2009 -dotnet_diagnostic.RCS1246.severity = error # Use element access — covered by PSH1106 +dotnet_diagnostic.RCS1236.severity = none # Use exception filter — covered by SST2009 +dotnet_diagnostic.RCS1246.severity = none # Use element access — covered by PSH1106 # Maintainability -dotnet_diagnostic.RCS1158.severity = error # Static member in generic type should use a type parameter — common factory pattern — covered by SST1431 -dotnet_diagnostic.RCS1163.severity = error # Unused parameter — interface implementations and Rx selectors often have unused parameters -dotnet_diagnostic.RCS1164.severity = error # Unused type parameter - DUPLICATE IDE0060 (UnusedParameter analyzer 210ms; IDE0060 bundled at lower cost) -dotnet_diagnostic.RCS1165.severity = error # Unconstrained type parameter checked for null - we validate all parameters for non-nullable enabled platforms -dotnet_diagnostic.RCS1182.severity = error # Remove redundant base interface — covered by SST1177 -dotnet_diagnostic.RCS1213.severity = error # Remove unused member declaration - DUPLICATE IDE0051 (slower: 230ms vs 75ms) +dotnet_diagnostic.RCS1158.severity = none # Static member in generic type should use a type parameter — common factory pattern — covered by SST1431 +dotnet_diagnostic.RCS1163.severity = none # Unused parameter — interface implementations and Rx selectors often have unused parameters +dotnet_diagnostic.RCS1164.severity = none # Unused type parameter - DUPLICATE IDE0060 (UnusedParameter analyzer 210ms; IDE0060 bundled at lower cost) +dotnet_diagnostic.RCS1165.severity = none # Unconstrained type parameter checked for null - we validate all parameters for non-nullable enabled platforms +dotnet_diagnostic.RCS1182.severity = none # Remove redundant base interface — covered by SST1177 +dotnet_diagnostic.RCS1213.severity = none # Remove unused member declaration - DUPLICATE IDE0051 (slower: 230ms vs 75ms) dotnet_diagnostic.RCS1241.severity = error # Implement non-generic counterpart -dotnet_diagnostic.RCS1256.severity = error # Invalid argument null check — conflicts with our ArgumentExceptionHelper helper pattern +dotnet_diagnostic.RCS1256.severity = none # Invalid argument null check — conflicts with our ArgumentExceptionHelper helper pattern # Documentation dotnet_diagnostic.RCS1181.severity = error # Convert comment to documentation comment dotnet_diagnostic.RCS1189.severity = error # Add or remove region name -dotnet_diagnostic.RCS1226.severity = error # Add paragraph to documentation comment — <para> wrapping is subjective and adds noise +dotnet_diagnostic.RCS1226.severity = none # Add paragraph to documentation comment — <para> wrapping is subjective and adds noise dotnet_diagnostic.RCS1228.severity = error # Unused element in a documentation comment dotnet_diagnostic.RCS1232.severity = error # Order elements in documentation comment dotnet_diagnostic.RCS1253.severity = error # Format documentation comment summary -dotnet_diagnostic.RCS1263.severity = error # Invalid reference in a documentation comment +dotnet_diagnostic.RCS1263.severity = none # Invalid reference in a documentation comment # Disabled -dotnet_diagnostic.RCS1018.severity = error # Add/remove accessibility modifiers — covered by SA1400 -dotnet_diagnostic.RCS1019.severity = error # Order modifiers — covered by SA1206 / SA1208 -dotnet_diagnostic.RCS1037.severity = error # Remove trailing white-space — covered by SA1028 -dotnet_diagnostic.RCS1052.severity = error # Declare each attribute separately — covered by SA1133 -dotnet_diagnostic.RCS1055.severity = error # Unnecessary semicolon at the end of declaration — covered by SA1106 -dotnet_diagnostic.RCS1060.severity = error # Declare each type in separate file — covered by SA1402 -dotnet_diagnostic.RCS1090.severity = error # Add/remove 'ConfigureAwait(false)' call — covered by CA2007 (also disabled) -dotnet_diagnostic.RCS1110.severity = error # Declare type inside namespace — covered by CA1050 -dotnet_diagnostic.RCS1138.severity = error # Add summary to documentation comment — covered by SA1600 -dotnet_diagnostic.RCS1139.severity = error # Add summary element to documentation comment — covered by SA1604 -dotnet_diagnostic.RCS1140.severity = error # Add exception to documentation comment — covered by SA1614 -dotnet_diagnostic.RCS1141.severity = error # Add 'param' element to documentation comment — covered by SA1611 -dotnet_diagnostic.RCS1142.severity = error # Add 'typeparam' element to documentation comment — covered by SA1618 -dotnet_diagnostic.RCS1175.severity = error # Unused 'this' parameter — covered by CA1822 -dotnet_diagnostic.RCS1194.severity = error # Implement exception constructors — covered by CA1032 -dotnet_diagnostic.RCS1203.severity = error # Use AttributeUsageAttribute — covered by CA1018 +dotnet_diagnostic.RCS1018.severity = none # Add/remove accessibility modifiers — covered by SA1400 +dotnet_diagnostic.RCS1019.severity = none # Order modifiers — covered by SA1206 / SA1208 +dotnet_diagnostic.RCS1037.severity = none # Remove trailing white-space — covered by SA1028 +dotnet_diagnostic.RCS1052.severity = none # Declare each attribute separately — covered by SA1133 +dotnet_diagnostic.RCS1055.severity = none # Unnecessary semicolon at the end of declaration — covered by SA1106 +dotnet_diagnostic.RCS1060.severity = none # Declare each type in separate file — covered by SA1402 +dotnet_diagnostic.RCS1090.severity = none # Add/remove 'ConfigureAwait(false)' call — covered by CA2007 (also disabled) +dotnet_diagnostic.RCS1110.severity = none # Declare type inside namespace — covered by CA1050 +dotnet_diagnostic.RCS1138.severity = none # Add summary to documentation comment — covered by SA1600 +dotnet_diagnostic.RCS1139.severity = none # Add summary element to documentation comment — covered by SA1604 +dotnet_diagnostic.RCS1140.severity = none # Add exception to documentation comment — covered by SA1614 +dotnet_diagnostic.RCS1141.severity = none # Add 'param' element to documentation comment — covered by SA1611 +dotnet_diagnostic.RCS1142.severity = none # Add 'typeparam' element to documentation comment — covered by SA1618 +dotnet_diagnostic.RCS1175.severity = none # Unused 'this' parameter — covered by CA1822 +dotnet_diagnostic.RCS1194.severity = none # Implement exception constructors — covered by CA1032 +dotnet_diagnostic.RCS1203.severity = none # Use AttributeUsageAttribute — covered by CA1018 # Formatting -dotnet_diagnostic.RCS0001.severity = error # Add blank line after embedded statement — covered by StyleCop layout rules -dotnet_diagnostic.RCS0002.severity = error # Add blank line after #region — covered by StyleCop SA1517 family -dotnet_diagnostic.RCS0003.severity = error # Add blank line after using directive list — covered by SA1516 -dotnet_diagnostic.RCS0005.severity = error # Add blank line before #endregion — covered by StyleCop layout rules -dotnet_diagnostic.RCS0006.severity = error # Add blank line before using directive list — covered by SA1517 -dotnet_diagnostic.RCS0007.severity = error # Add blank line between accessors — covered by SA1513 -dotnet_diagnostic.RCS0008.severity = error # Add blank line between closing brace and next statement — covered by SA1513 -dotnet_diagnostic.RCS0009.severity = error # Add blank line between declaration and documentation comment — covered by SA1514 -dotnet_diagnostic.RCS0010.severity = error # Add blank line between declarations — covered by SA1516 -dotnet_diagnostic.RCS0011.severity = error # Add/remove blank line between single-line accessors — StyleCop already governs this -dotnet_diagnostic.RCS0012.severity = error # Add blank line between single-line declarations — covered by SA1516 -dotnet_diagnostic.RCS0013.severity = error # Add blank line between single-line declarations of different kind — covered by SA1516 -dotnet_diagnostic.RCS0015.severity = error # Add/remove blank line between using directives — covered by SA1209 / SA1210 -dotnet_diagnostic.RCS0016.severity = error # Put attribute list on its own line — StyleCop SA1133 governs attribute lists -dotnet_diagnostic.RCS0020.severity = error # Format accessor's braces — covered by SA1500 -dotnet_diagnostic.RCS0021.severity = error # Format block's braces — covered by SA1500 -dotnet_diagnostic.RCS0023.severity = error # Format type declaration's braces — covered by SA1500 -dotnet_diagnostic.RCS0024.severity = error # Add new line after switch label — covered by SA1003 -dotnet_diagnostic.RCS0025.severity = error # Put full accessor on its own line — covered by SA1502 -dotnet_diagnostic.RCS0027.severity = error # Place new line after/before binary operator — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0028.severity = error # Place new line after/before '?:' operator — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0029.severity = error # Put constructor initializer on its own line — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0030.severity = error # Put embedded statement on its own line — covered by SA1503 -dotnet_diagnostic.RCS0031.severity = error # Put enum member on its own line — covered by SA1136 -dotnet_diagnostic.RCS0032.severity = error # Place new line after/before arrow token — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0033.severity = error # Put statement on its own line — covered by SA1505 family -dotnet_diagnostic.RCS0034.severity = error # Put type parameter constraint on its own line — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0036.severity = error # Remove blank line between single-line declarations of same kind — covered by SA1516 -dotnet_diagnostic.RCS0039.severity = error # Remove new line before base list — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0041.severity = error # Remove new line between 'if' keyword and 'else' keyword — StyleCop layout rules cover this -dotnet_diagnostic.RCS0042.severity = error # Put auto-accessors on a single line — formatting preference, not enforced -dotnet_diagnostic.RCS0044.severity = error # Use carriage return + linefeed as new line — handled by .gitattributes / editorconfig end_of_line -dotnet_diagnostic.RCS0045.severity = error # Use linefeed as new line — handled by .gitattributes / editorconfig end_of_line -dotnet_diagnostic.RCS0046.severity = error # Use spaces instead of tab — handled by editorconfig indent_style -dotnet_diagnostic.RCS0048.severity = error # Put initializer on a single line — formatting preference, not enforced -dotnet_diagnostic.RCS0049.severity = error # Add blank line after top comment — covered by SA1517 -dotnet_diagnostic.RCS0050.severity = error # Add blank line before top declaration — covered by SA1517 -dotnet_diagnostic.RCS0051.severity = error # Add/remove new line before 'while' in 'do' statement — formatting preference -dotnet_diagnostic.RCS0052.severity = error # Place new line after/before equals token — StyleCop wrapping rules cover this -dotnet_diagnostic.RCS0053.severity = error # Fix formatting of a list — formatting preference -dotnet_diagnostic.RCS0054.severity = error # Fix formatting of a call chain — formatting preference -dotnet_diagnostic.RCS0055.severity = error # Fix formatting of a binary expression chain — formatting preference -dotnet_diagnostic.RCS0056.severity = error # A line is too long — line-length not enforced -dotnet_diagnostic.RCS0057.severity = error # Normalize whitespace at the beginning of a file — handled by editorconfig -dotnet_diagnostic.RCS0058.severity = error # Normalize whitespace at the end of a file — covered by SST1518 -dotnet_diagnostic.RCS0059.severity = error # Place new line after/before null-conditional operator — StyleSharp wrapping rules cover this -dotnet_diagnostic.RCS0060.severity = error # Add/remove line after file scoped namespace declaration — formatting preference -dotnet_diagnostic.RCS0061.severity = error # Add/remove blank line between switch sections — formatting preference -dotnet_diagnostic.RCS0062.severity = error # Put expression body on its own line — formatting preference -dotnet_diagnostic.RCS0063.severity = error # Remove unnecessary blank line — covered by SST1505 / SST1507 +dotnet_diagnostic.RCS0001.severity = none # Add blank line after embedded statement — covered by StyleCop layout rules +dotnet_diagnostic.RCS0002.severity = none # Add blank line after #region — covered by StyleCop SA1517 family +dotnet_diagnostic.RCS0003.severity = none # Add blank line after using directive list — covered by SA1516 +dotnet_diagnostic.RCS0005.severity = none # Add blank line before #endregion — covered by StyleCop layout rules +dotnet_diagnostic.RCS0006.severity = none # Add blank line before using directive list — covered by SA1517 +dotnet_diagnostic.RCS0007.severity = none # Add blank line between accessors — covered by SA1513 +dotnet_diagnostic.RCS0008.severity = none # Add blank line between closing brace and next statement — covered by SA1513 +dotnet_diagnostic.RCS0009.severity = none # Add blank line between declaration and documentation comment — covered by SA1514 +dotnet_diagnostic.RCS0010.severity = none # Add blank line between declarations — covered by SA1516 +dotnet_diagnostic.RCS0011.severity = none # Add/remove blank line between single-line accessors — StyleCop already governs this +dotnet_diagnostic.RCS0012.severity = none # Add blank line between single-line declarations — covered by SA1516 +dotnet_diagnostic.RCS0013.severity = none # Add blank line between single-line declarations of different kind — covered by SA1516 +dotnet_diagnostic.RCS0015.severity = none # Add/remove blank line between using directives — covered by SA1209 / SA1210 +dotnet_diagnostic.RCS0016.severity = none # Put attribute list on its own line — StyleCop SA1133 governs attribute lists +dotnet_diagnostic.RCS0020.severity = none # Format accessor's braces — covered by SA1500 +dotnet_diagnostic.RCS0021.severity = none # Format block's braces — covered by SA1500 +dotnet_diagnostic.RCS0023.severity = none # Format type declaration's braces — covered by SA1500 +dotnet_diagnostic.RCS0024.severity = none # Add new line after switch label — covered by SA1003 +dotnet_diagnostic.RCS0025.severity = none # Put full accessor on its own line — covered by SA1502 +dotnet_diagnostic.RCS0027.severity = none # Place new line after/before binary operator — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0028.severity = none # Place new line after/before '?:' operator — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0029.severity = none # Put constructor initializer on its own line — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0030.severity = none # Put embedded statement on its own line — covered by SA1503 +dotnet_diagnostic.RCS0031.severity = none # Put enum member on its own line — covered by SA1136 +dotnet_diagnostic.RCS0032.severity = none # Place new line after/before arrow token — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0033.severity = none # Put statement on its own line — covered by SA1505 family +dotnet_diagnostic.RCS0034.severity = none # Put type parameter constraint on its own line — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0036.severity = none # Remove blank line between single-line declarations of same kind — covered by SA1516 +dotnet_diagnostic.RCS0039.severity = none # Remove new line before base list — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0041.severity = none # Remove new line between 'if' keyword and 'else' keyword — StyleCop layout rules cover this +dotnet_diagnostic.RCS0042.severity = none # Put auto-accessors on a single line — formatting preference, not enforced +dotnet_diagnostic.RCS0044.severity = none # Use carriage return + linefeed as new line — handled by .gitattributes / editorconfig end_of_line +dotnet_diagnostic.RCS0045.severity = none # Use linefeed as new line — handled by .gitattributes / editorconfig end_of_line +dotnet_diagnostic.RCS0046.severity = none # Use spaces instead of tab — handled by editorconfig indent_style +dotnet_diagnostic.RCS0048.severity = none # Put initializer on a single line — formatting preference, not enforced +dotnet_diagnostic.RCS0049.severity = none # Add blank line after top comment — covered by SA1517 +dotnet_diagnostic.RCS0050.severity = none # Add blank line before top declaration — covered by SA1517 +dotnet_diagnostic.RCS0051.severity = none # Add/remove new line before 'while' in 'do' statement — formatting preference +dotnet_diagnostic.RCS0052.severity = none # Place new line after/before equals token — StyleCop wrapping rules cover this +dotnet_diagnostic.RCS0053.severity = none # Fix formatting of a list — formatting preference +dotnet_diagnostic.RCS0054.severity = none # Fix formatting of a call chain — formatting preference +dotnet_diagnostic.RCS0055.severity = none # Fix formatting of a binary expression chain — formatting preference +dotnet_diagnostic.RCS0056.severity = none # A line is too long — line-length not enforced +dotnet_diagnostic.RCS0057.severity = none # Normalize whitespace at the beginning of a file — handled by editorconfig +dotnet_diagnostic.RCS0058.severity = none # Normalize whitespace at the end of a file — covered by SST1518 +dotnet_diagnostic.RCS0059.severity = none # Place new line after/before null-conditional operator — StyleSharp wrapping rules cover this +dotnet_diagnostic.RCS0060.severity = none # Add/remove line after file scoped namespace declaration — formatting preference +dotnet_diagnostic.RCS0061.severity = none # Add/remove blank line between switch sections — formatting preference +dotnet_diagnostic.RCS0062.severity = none # Put expression body on its own line — formatting preference +dotnet_diagnostic.RCS0063.severity = none # Remove unnecessary blank line — covered by SST1505 / SST1507 ################### # StyleSharp Analyzers (SST) @@ -1113,11 +1113,20 @@ stylesharp.document_private_fields = true stylesharp.document_interfaces = all stylesharp.SST1305.allowed_hungarian_prefixes = rx stylesharp.instance_member_qualification = omit_this +# SST2271 enforces one var-versus-explicit choice. Track the csharp_style_var_* preferences +# above, which ask for var everywhere, rather than the rule's when_obvious default. +stylesharp.use_var = always stylesharp.max_cyclomatic_complexity = 10 stylesharp.max_cognitive_complexity = 15 stylesharp.max_property_cognitive_complexity = 3 # SST1484 also reports a field that shadows one inherited from a base type. stylesharp.SST1484.check_base_types = true + +# SST2403 reports `this` escaping a constructor. These two take `this` and hand it straight back +# to the object it came from, so nothing else can observe a half-built instance: ToProperty stores +# the helper on the same object, and WhenActivated defers its callback until activation. Both are +# the shapes the MVVM framework documents writing in a constructor. +stylesharp.SST2403.allowed_escape_methods = WhenActivated, ToProperty stylesharp.max_line_length = 200 # SST1521 (characters; keeps the limit this repo has always enforced) stylesharp.max_file_lines = 1000 # SST1522 (code lines; blank lines and comments do not count) # stylesharp.max_member_lines = 60 # SST1523 (code lines) @@ -1136,7 +1145,7 @@ dotnet_diagnostic.SST1006.severity = error # A preprocessor keyword is preceded dotnet_diagnostic.SST1007.severity = error # An operator keyword is not followed by a space dotnet_diagnostic.SST1008.severity = error # An opening parenthesis is followed by a space dotnet_diagnostic.SST1009.severity = error # A closing parenthesis is preceded by a space -dotnet_diagnostic.SST1010.severity = error # An opening square bracket has adjacent whitespace — conflicts with modern collection expressions +dotnet_diagnostic.SST1010.severity = none # An opening square bracket has adjacent whitespace — conflicts with modern collection expressions dotnet_diagnostic.SST1011.severity = error # A closing square bracket is preceded by a space dotnet_diagnostic.SST1012.severity = error # An opening brace is not followed by a space on a single line dotnet_diagnostic.SST1013.severity = error # A closing brace is not preceded by a space on a single line @@ -1158,7 +1167,7 @@ dotnet_diagnostic.SST1028.severity = error # A line ends with trailing whitespac # Readability and maintainability dotnet_diagnostic.SST1100.severity = error # A base. prefix is used where the type does not override the member -dotnet_diagnostic.SST1101.severity = error # see docs/rules/SST1101.md +dotnet_diagnostic.SST1101.severity = none # see docs/rules/SST1101.md dotnet_diagnostic.SST1102.severity = error # A query clause is separated from the previous clause by a blank line dotnet_diagnostic.SST1103.severity = error # Query clauses mix single-line and multi-line layout dotnet_diagnostic.SST1104.severity = error # A query clause shares the last line of a multi-line previous clause @@ -1173,7 +1182,11 @@ dotnet_diagnostic.SST1114.severity = error # A blank line separates the declarat dotnet_diagnostic.SST1115.severity = error # A blank line separates a parameter from the preceding comma dotnet_diagnostic.SST1116.severity = error # A qualified name can be shortened without changing the symbol it binds to dotnet_diagnostic.SST1117.severity = error # Instance member access follows the configured this. qualification style -dotnet_diagnostic.SST1118.severity = error # A parameter should not span multiple lines +# SST1118 wants each parameter or argument on one line, which collides with the 200-character +# max_line_length above. Of the 41 sites here, 18 cannot be collapsed inside 200 characters - +# multi-line diagnostic message concatenations and [DynamicallyAccessedMembers(A | B | C)] lists +# reach 429. The two rules cannot both hold, and the line limit is the one this repo enforces. +dotnet_diagnostic.SST1118.severity = none # A parameter should not span multiple lines dotnet_diagnostic.SST1119.severity = error # A numeric literal groups its digit separators irregularly dotnet_diagnostic.SST1120.severity = error # A comment contains no text dotnet_diagnostic.SST1121.severity = error # A framework type name is used instead of its built-in alias (opt-in rule, enabled here) @@ -1280,27 +1293,27 @@ dotnet_diagnostic.SST1220.severity = error # An all-named argument list is in a dotnet_diagnostic.SST1221.severity = error # `where` constraint clauses are not ordered to match the type-parameter list. Code fix reorders them. Info. # Naming -dotnet_diagnostic.SST1300.severity = error # Types and members should be PascalCase — naming duplicates existing analyzers +dotnet_diagnostic.SST1300.severity = error # Types and members should be PascalCase dotnet_diagnostic.SST1302.severity = error # Interface names should begin with I dotnet_diagnostic.SST1303.severity = error # Const names should be PascalCase dotnet_diagnostic.SST1304.severity = error # Non-private readonly fields should be PascalCase dotnet_diagnostic.SST1305.severity = error # Field names should not use Hungarian notation -dotnet_diagnostic.SST1306.severity = error # Field names should begin with a lower-case letter — private fields use _camelCase here +dotnet_diagnostic.SST1306.severity = none # Field names should begin with a lower-case letter — private fields use _camelCase here dotnet_diagnostic.SST1307.severity = error # Accessible fields should be PascalCase -dotnet_diagnostic.SST1308.severity = error # Field names should not be prefixed with m_ or s_ — too broad for existing conventions +dotnet_diagnostic.SST1308.severity = none # Field names should not be prefixed with m_ or s_ — too broad for existing conventions dotnet_diagnostic.SST1309.severity = error # Private fields should be _camelCase -dotnet_diagnostic.SST1310.severity = error # Field names should not contain underscores — conflicts with _camelCase -dotnet_diagnostic.SST1311.severity = error # Static readonly fields should be PascalCase — we use _camelCase for private static readonly too +dotnet_diagnostic.SST1310.severity = none # Field names should not contain underscores — conflicts with _camelCase +dotnet_diagnostic.SST1311.severity = none # Static readonly fields should be PascalCase — we use _camelCase for private static readonly too dotnet_diagnostic.SST1312.severity = error # Local variables should be camelCase dotnet_diagnostic.SST1313.severity = error # Parameters should be camelCase dotnet_diagnostic.SST1314.severity = error # Type parameters should begin with T dotnet_diagnostic.SST1315.severity = error # Union member names should match the configured casing -dotnet_diagnostic.SST1316.severity = error # Tuple element names should use the configured casing — tuple naming is not enforced here -dotnet_diagnostic.SST1317.severity = error # Asynchronous method names should end with 'Async' — conflicts with this project's Rx-compatibility and naming mechanism +dotnet_diagnostic.SST1316.severity = error # Tuple element names should use the configured casing +dotnet_diagnostic.SST1317.severity = none # Asynchronous method names should end with 'Async' — conflicts with this project's Rx-compatibility and naming mechanism dotnet_diagnostic.SST1318.severity = error # Overriding parameter names should match the base declaration dotnet_diagnostic.SST1319.severity = error # An enumeration's type name is not PascalCase dotnet_diagnostic.SST1320.severity = error # A parameter name matches its method's name -dotnet_diagnostic.SST1321.severity = error # Public APIs intentionally use Async to describe asynchronous observable behavior without returning an awaitable. +dotnet_diagnostic.SST1321.severity = none # Public APIs intentionally use Async to describe asynchronous observable behavior without returning an awaitable. # Maintainability dotnet_diagnostic.SST1400.severity = error # An element does not declare an access modifier @@ -1314,12 +1327,23 @@ dotnet_diagnostic.SST1407.severity = error # Mixed-precedence arithmetic is not dotnet_diagnostic.SST1408.severity = error # Mixed conditional operators are not parenthesized dotnet_diagnostic.SST1410.severity = error # An anonymous method has an empty parameter list dotnet_diagnostic.SST1411.severity = error # An attribute uses an empty argument list -dotnet_diagnostic.SST1412.severity = error # Store files as UTF-8 with a byte order mark — conflicts with SST1450 (UTF-8 without BOM) -dotnet_diagnostic.SST1413.severity = error # A multi-line initializer omits the trailing comma — trailing commas are not required here +dotnet_diagnostic.SST1412.severity = none # Store files as UTF-8 with a byte order mark — conflicts with SST1450 (UTF-8 without BOM) +dotnet_diagnostic.SST1413.severity = error # A multi-line initializer omits the trailing comma dotnet_diagnostic.SST1414.severity = error # A tuple type in a member signature has an unnamed element dotnet_diagnostic.SST1415.severity = error # An argument-exception constructor uses a string literal where nameof would track renames -dotnet_diagnostic.SST1416.severity = error # Do not declare public members in a non-public type -dotnet_diagnostic.SST1417.severity = error # Namespace should match the folder structure +# SST1416 treats a public member of a non-public type as pointless, which stops holding the +# moment the type is reached reflectively: Type.GetProperty and Activator.CreateInstance(Type) +# use binding flags that see public members only. Demoting them compiles but silently changes +# behaviour - it hid every property on the reflection request-model fixtures, and would stop the +# JSON converter factory from constructing EnumConverter. The Index/Range polyfills likewise +# need the public members the compiler recognises for index and range lowering. +dotnet_diagnostic.SST1416.severity = none # Do not declare public members in a non-public type +# SST1417 derives the expected namespace from the folder, so it cannot be satisfied by a type +# that deliberately lives in a BCL namespace: PushStreamContent extends System.Net.Http and +# NameValueCollection backfills System.Collections.Specialized. Moving them under a matching +# folder would make the expected namespace Refit.System.Net.Http, so there is no layout that +# both satisfies the rule and keeps the namespace these types must have. +dotnet_diagnostic.SST1417.severity = none # Namespace should match the folder structure dotnet_diagnostic.SST1418.severity = error # Declare precedence when mixing the null-coalescing operator dotnet_diagnostic.SST1419.severity = error # Remove redundant modifiers dotnet_diagnostic.SST1420.severity = error # Trivial properties should be auto-implemented @@ -1407,7 +1431,7 @@ dotnet_diagnostic.SST1499.severity = error # A static field visible outside its dotnet_diagnostic.SST1500.severity = error # A brace in a multi-line construct shares its line with other code dotnet_diagnostic.SST1501.severity = error # A statement block is collapsed onto a single line dotnet_diagnostic.SST1502.severity = error # An element body is collapsed onto a single line -dotnet_diagnostic.SST1503.severity = error # A control-flow statement omits the braces around its child statement — duplicate with existing brace preferences +dotnet_diagnostic.SST1503.severity = error # A control-flow statement omits the braces around its child statement dotnet_diagnostic.SST1504.severity = error # The accessors of a property/event mix single-line and multi-line forms dotnet_diagnostic.SST1505.severity = error # An opening brace is followed by a blank line dotnet_diagnostic.SST1506.severity = error # An element documentation header is followed by a blank line @@ -1437,7 +1461,10 @@ dotnet_diagnostic.SST1529.severity = error # A wrapped `?.`/`.` call chain place dotnet_diagnostic.SST1530.severity = error # A newline sits between a type declaration and its base list. Code fix pulls the base list onto the declaration line. Opt-in. dotnet_diagnostic.SST1531.severity = error # A short object initializer is split across lines. Code fix collapses it when it fits. Opt-in. dotnet_diagnostic.SST1532.severity = error # A file mixes line endings. Configurable (`lf`/`crlf`, default lf). Opt-in. -dotnet_diagnostic.SST1533.severity = error # A source file contains no code. Opt-in. +# SST1533 reports a file that declares no type, which is what a polyfill wrapped in #if looks +# like on the frameworks that already have the API - HttpContentExtensions is empty on net9.0+ +# by design. The rule cannot distinguish that from a genuinely empty file. +dotnet_diagnostic.SST1533.severity = none # A source file contains no code dotnet_diagnostic.SST1535.severity = error # A constructor initializer colon should not be followed by a blank line dotnet_diagnostic.SST1536.severity = error # A conditional operator token should not be followed by a blank line dotnet_diagnostic.SST1537.severity = error # An expression-body arrow should not be followed by a blank line @@ -1451,7 +1478,10 @@ dotnet_diagnostic.SST1605.severity = error # Partial element documentation shoul dotnet_diagnostic.SST1606.severity = error # The summary should have text dotnet_diagnostic.SST1607.severity = error # Partial element summary should have text dotnet_diagnostic.SST1608.severity = error # Documentation should not use the default placeholder summary -dotnet_diagnostic.SST1609.severity = error # Property documentation should have a value +# SST1609 wants a element on every documented property. On the 174 properties here that +# text only ever restates the ("Gets the request timeout." / "The request timeout."), +# so it adds a maintenance burden without telling a reader anything the summary did not. +dotnet_diagnostic.SST1609.severity = none # Property documentation should have a value dotnet_diagnostic.SST1610.severity = error # Property value documentation should have text dotnet_diagnostic.SST1611.severity = error # Parameters should be documented dotnet_diagnostic.SST1612.severity = error # Parameter documentation should match the parameters @@ -1522,7 +1552,7 @@ dotnet_diagnostic.SST2015.severity = error # A ++ or -- is buried inside a large dotnet_diagnostic.SST2016.severity = error # A DateTime on a visible signature loses its offset at the boundary dotnet_diagnostic.SST2017.severity = error # A .Date or .TimeOfDay read proves the value is only a date, or only a time of day dotnet_diagnostic.SST2018.severity = error # A redundant null check sits beside an is type pattern -dotnet_diagnostic.SST2019.severity = error # Test for null rather than for object +dotnet_diagnostic.SST2019.severity = error # Test for null rather than for the object type # Modern language and library usage dotnet_diagnostic.SST1700.severity = error # An extension block declares no members @@ -1534,7 +1564,7 @@ dotnet_diagnostic.SST1705.severity = error # A class mixes classic extension met dotnet_diagnostic.SST1706.severity = error # An extension block targets a broad receiver type such as object or dynamic dotnet_diagnostic.SST1707.severity = error # Extension blocks should be ordered by receiver type dotnet_diagnostic.SST1708.severity = error # An extension method never uses its `this` receiver, so it need not be an extension. -dotnet_diagnostic.SST1709.severity = error # A method in a `*Extensions` class whose first parameter lacks `this`. Code fix converts it to an extension block. Opt-in. +dotnet_diagnostic.SST1709.severity = error # A method in a `*Extensions` class whose first parameter lacks `this`. Code fix converts it to an extension block. dotnet_diagnostic.SST1800.severity = error # Record classes should be sealed dotnet_diagnostic.SST1801.severity = error # A positional record parameter does not match the configured casing dotnet_diagnostic.SST1802.severity = error # A record declares a settable rather than init-only instance property @@ -1551,7 +1581,7 @@ dotnet_diagnostic.SST2201.severity = error # A return-only switch statement can dotnet_diagnostic.SST2202.severity = error # An object creation repeats an explicit target type dotnet_diagnostic.SST2203.severity = error # An array or string index can use from-end indexing dotnet_diagnostic.SST2204.severity = error # A string slice can use range syntax -dotnet_diagnostic.SST2205.severity = error # An enum switch statement omits named enum values — duplicate of IDE0010 (disabled: too noisy for default/fallthrough) and S131; statement switches deliberately no-op omitted values, and a default to satisfy it is rejected by SST1179/S3532. SST2206 keeps the valuable switch-expression exhaustiveness check. +dotnet_diagnostic.SST2205.severity = none # An enum switch statement omits named enum values — duplicate of IDE0010 (disabled: too noisy for default/fallthrough) and S131; statement switches deliberately no-op omitted values, and a default to satisfy it is rejected by SST1179/S3532. SST2206 keeps the valuable switch-expression exhaustiveness check. dotnet_diagnostic.SST2206.severity = error # An enum switch expression omits named enum values dotnet_diagnostic.SST2207.severity = error # A null guard and return can keep the throw in the returned expression dotnet_diagnostic.SST2208.severity = error # An out variable can be declared at the call site @@ -1579,7 +1609,7 @@ dotnet_diagnostic.SST2229.severity = error # see docs/rules/SST2229.md dotnet_diagnostic.SST2230.severity = error # see docs/rules/SST2230.md dotnet_diagnostic.SST2231.severity = error # A broad object pattern can use a direct null pattern dotnet_diagnostic.SST2232.severity = error # nameof does not need concrete generic type arguments -dotnet_diagnostic.SST2233.severity = error # see docs/rules/SST2233.md +dotnet_diagnostic.SST2233.severity = none # see docs/rules/SST2233.md dotnet_diagnostic.SST2234.severity = error # Nullable should use the T? shorthand dotnet_diagnostic.SST2235.severity = error # Capture-free local functions should be static dotnet_diagnostic.SST2236.severity = error # Tail-position using blocks can use using declarations @@ -1599,7 +1629,7 @@ dotnet_diagnostic.SST2249.severity = error # A literal-format string.Format or l dotnet_diagnostic.SST2250.severity = error # A bare local assigned once by the next statement can be an initialized declaration dotnet_diagnostic.SST2251.severity = error # A method call names type arguments that inference would supply dotnet_diagnostic.SST2252.severity = error # A switch statement is nested inside another switch statement -dotnet_diagnostic.SST2254.severity = error # A target-typed `new()` is written where an explicit type reads more clearly; the code fix restores `new TypeName(...)`. Opt-in — the counterpart to SST2202's target-typed direction, so a team enables at most one. +dotnet_diagnostic.SST2254.severity = none # A target-typed `new()` is written where an explicit type reads more clearly; the code fix restores `new TypeName(...)`. Opt-in — the counterpart to SST2202's target-typed direction, so a team enables at most one. dotnet_diagnostic.SST2255.severity = error # A hand-written null-or-empty string test. Code fix uses `string.IsNullOrEmpty`. dotnet_diagnostic.SST2256.severity = error # An extension method called in static form. Code fix rewrites to instance form. Info. dotnet_diagnostic.SST2257.severity = error # A lambda block body that is a single `return`. Code fix uses an expression body. Info. @@ -1610,20 +1640,20 @@ dotnet_diagnostic.SST2261.severity = error # `(x && !y) dotnet_diagnostic.SST2262.severity = error # A raw string literal whose content needs no raw syntax. Code fix demotes it. Info. dotnet_diagnostic.SST2263.severity = error # An infinite loop whose body re-derives its stop condition. Code fix hoists the condition into the header. Info. dotnet_diagnostic.SST2264.severity = error # A numeric literal cast to an enum. Code fix names the member. -dotnet_diagnostic.SST2265.severity = error # Consecutive fluent calls on one receiver can fold into a chain. Opt-in. -dotnet_diagnostic.SST2266.severity = error # A local read exactly once can be inlined into that use. Opt-in. -dotnet_diagnostic.SST2267.severity = error # Infinite loops written in mixed `while(true)`/`for(;;)` styles. Configurable. Opt-in. -dotnet_diagnostic.SST2268.severity = error # Inconsistent `()` on object creation with an initializer. Configurable. Opt-in. -dotnet_diagnostic.SST2269.severity = error # Inconsistent parentheses around a conditional's condition. Configurable. Opt-in. -dotnet_diagnostic.SST2270.severity = error # Inconsistent explicit-vs-implicit array-creation type. Configurable. Opt-in. -dotnet_diagnostic.SST2271.severity = error # `var`-vs-explicit local type per the configured preference. Configurable. Opt-in. -dotnet_diagnostic.SST2272.severity = error # `[Flags]` member values written as mixed decimals and shifts. Configurable. Opt-in. -dotnet_diagnostic.SST2273.severity = error # A function or loop body wraps its work in a trailing `if` that could be an early-exit guard clause. Code fix inverts it. Configurable threshold. Opt-in. +dotnet_diagnostic.SST2265.severity = error # Consecutive fluent calls on one receiver can fold into a chain +dotnet_diagnostic.SST2266.severity = error # A local read exactly once can be inlined into that use +dotnet_diagnostic.SST2267.severity = error # Infinite loops written in mixed `while(true)`/`for(;;)` styles. Configurable. +dotnet_diagnostic.SST2268.severity = error # Inconsistent `()` on object creation with an initializer. Configurable. +dotnet_diagnostic.SST2269.severity = error # Inconsistent parentheses around a conditional's condition. Configurable. +dotnet_diagnostic.SST2270.severity = error # Inconsistent explicit-vs-implicit array-creation type. Configurable. +dotnet_diagnostic.SST2271.severity = error # `var`-vs-explicit local type per the configured preference. Configurable. +dotnet_diagnostic.SST2272.severity = error # `[Flags]` member values written as mixed decimals and shifts. Configurable. +dotnet_diagnostic.SST2273.severity = error # A function or loop body wraps its work in a trailing `if` that could be an early-exit guard clause. Code fix inverts it. Configurable threshold. dotnet_diagnostic.SST2274.severity = error # A value assigned with `as` and then null-checked is an `is` declaration pattern in one step. Code fix rewrites it. dotnet_diagnostic.SST2275.severity = error # A method whose block body is a single statement can use an expression body `=> expr`. Code fix rewrites it. -dotnet_diagnostic.SST2276.severity = error # A constructor whose block body is a single statement can use an expression body. Code fix rewrites it. Opt-in. -dotnet_diagnostic.SST2277.severity = error # An operator whose block body is a single `return` can use an expression body. Code fix rewrites it. Opt-in. -dotnet_diagnostic.SST2278.severity = error # A conversion operator whose block body is a single `return` can use an expression body. Code fix rewrites it. Opt-in. +dotnet_diagnostic.SST2276.severity = error # A constructor whose block body is a single statement can use an expression body. Code fix rewrites it. +dotnet_diagnostic.SST2277.severity = error # An operator whose block body is a single `return` can use an expression body. Code fix rewrites it. +dotnet_diagnostic.SST2278.severity = error # A conversion operator whose block body is a single `return` can use an expression body. Code fix rewrites it. dotnet_diagnostic.SST2279.severity = error # A get-only property whose getter is a single `return` can use a whole-member expression body. Code fix rewrites it. dotnet_diagnostic.SST2280.severity = error # A get-only indexer whose getter is a single `return` can use a whole-member expression body. Code fix rewrites it. dotnet_diagnostic.SST2281.severity = error # A local function whose block body is a single statement can use an expression body. Code fix rewrites it. @@ -1644,7 +1674,7 @@ dotnet_diagnostic.SST2310.severity = error # Deprecated code is still here; remo dotnet_diagnostic.SST2311.severity = error # A visible const is copied into every assembly that reads it dotnet_diagnostic.SST2312.severity = error # A type is declared outside any namespace dotnet_diagnostic.SST2313.severity = error # An enum is stored as a type the project does not allow -dotnet_diagnostic.SST2314.severity = error # An [Obsolete] has a message but no DiagnosticId — unusable here: ObsoleteAttribute.DiagnosticId is .NET 5+, and this source is shared with net462 +dotnet_diagnostic.SST2314.severity = none # An [Obsolete] has a message but no DiagnosticId — unusable here: ObsoleteAttribute.DiagnosticId is .NET 5+, and this source is shared with net462 dotnet_diagnostic.SST2315.severity = error # A type owns a disposable field but does not implement IDisposable dotnet_diagnostic.SST2316.severity = error # A type declares Dispose or DisposeAsync without implementing IDisposable dotnet_diagnostic.SST2317.severity = error # A disposable type owns a raw IntPtr without a SafeHandle or finalizer @@ -1656,16 +1686,16 @@ dotnet_diagnostic.SST2322.severity = error # A non-private readonly field holds dotnet_diagnostic.SST2323.severity = error # A stateless abstract class declaring only public abstract members should be an interface dotnet_diagnostic.SST2324.severity = error # A member is declared more accessible than its containing type dotnet_diagnostic.SST2325.severity = error # An async method checks an argument after its first await -dotnet_diagnostic.SST2326.severity = error # An interface-typed value is narrowed to a concrete implementation — this is a high-performance core library, not strictly SOLID code, and narrowing to a known runtime type is a normal fast-path technique here: foreach over IEnumerable boxes List's struct enumerator (40 bytes per call, measured) where the indexed loop behind the type test allocates nothing +dotnet_diagnostic.SST2326.severity = none # An interface-typed value is narrowed to a concrete implementation — this is a high-performance core library, not strictly SOLID code, and narrowing to a known runtime type is a normal fast-path technique here: foreach over IEnumerable boxes List's struct enumerator (40 bytes per call, measured) where the indexed loop behind the type test allocates nothing dotnet_diagnostic.SST2327.severity = error # A type tests its own runtime type against a class instead of dispatching through a virtual member dotnet_diagnostic.SST2328.severity = error # A raw native pointer handle is exposed instead of a SafeHandle dotnet_diagnostic.SST2329.severity = error # A `[Flags]` enum declares no zero-valued member. Code fix adds `None = 0`. dotnet_diagnostic.SST2330.severity = error # A `[Flags]` member is a numeric literal equal to a combination of others (`All = 7`). Code fix writes `A -dotnet_diagnostic.SST2331.severity = error # An enum leaves member values implicit, so their numbers depend on declaration order. Opt-in. +dotnet_diagnostic.SST2331.severity = error # An enum leaves member values implicit, so their numbers depend on declaration order dotnet_diagnostic.SST2332.severity = error # An auto-property's `private set` is only written during construction; make it get-only. -dotnet_diagnostic.SST2333.severity = error # A generic comparison/equality contract is implemented without its non-generic counterpart. Opt-in. -dotnet_diagnostic.SST2334.severity = error # A publicly visible type has no `[DebuggerDisplay]`. Opt-in. -dotnet_diagnostic.SST2335.severity = error # Parts of a partial type disagree on the `static` modifier. Opt-in. +dotnet_diagnostic.SST2333.severity = error # A generic comparison/equality contract is implemented without its non-generic counterpart +dotnet_diagnostic.SST2334.severity = error # A publicly visible type has no `[DebuggerDisplay]` +dotnet_diagnostic.SST2335.severity = error # Parts of a partial type disagree on the `static` modifier # Correctness dotnet_diagnostic.SST2400.severity = error # Two arguments name each other's parameters and have been transposed @@ -1751,8 +1781,8 @@ dotnet_diagnostic.SST2493.severity = error # `== null`/`!= null` on an unconstra dotnet_diagnostic.SST2494.severity = error # A `??` whose left operand is a constant null, so the right is always taken. Code fix folds it. dotnet_diagnostic.SST2495.severity = error # A `[Flags]` combination includes an operand whose bits another already covers. Code fix removes it. dotnet_diagnostic.SST2496.severity = error # An explicit `Dispose`/`Close` on a resource an enclosing `using` already disposes. Code fix removes it. Info. -dotnet_diagnostic.SST2497.severity = error # Do not forward a member to itself -dotnet_diagnostic.SST2498.severity = error # Do not use nameof on a type parameter +dotnet_diagnostic.SST2497.severity = error # A member forwards to itself, so calling it recurses until the stack is gone +dotnet_diagnostic.SST2498.severity = error # `nameof` on a type parameter is the constant "T", not the substituted type's name # Testing dotnet_diagnostic.SST2500.severity = error # A test method contains no assertion and no expected-exception check @@ -1776,9 +1806,9 @@ dotnet_diagnostic.SST2701.severity = error # A `[JSInvokable]` method is not pub dotnet_diagnostic.SST2702.severity = error # A `[SupplyParameterFromQuery]` property has a type the framework cannot bind from the query string, which throws at runtime. dotnet_diagnostic.SST2703.severity = error # A routable component's route constraint (`{id:int}`) disagrees with the matching `[Parameter]` CLR type, so the route silently fails to match. dotnet_diagnostic.SST2704.severity = error # A public action on an `[ApiController]` declares no HTTP-verb attribute, so it answers every verb and can make routing ambiguous. -dotnet_diagnostic.SST2705.severity = error # A bound model member is a non-nullable value type with no required marker, so a request that omits it binds the default with no error. Opt-in. +dotnet_diagnostic.SST2705.severity = error # A bound model member is a non-nullable value type with no required marker, so a request that omits it binds the default with no error dotnet_diagnostic.SST2706.severity = error # A Windows Forms entry point carries neither `[STAThread]` nor `[MTAThread]`; without STA, clipboard, drag-and-drop, and common dialogs misbehave. Code fix adds `[STAThread]`. -dotnet_diagnostic.SST2707.severity = error # A fire-and-forget `Task.Run` in a controller captures the request's `HttpContext`, which is disposed when the request ends, so the background work throws `ObjectDisposedException`. Opt-in. +dotnet_diagnostic.SST2707.severity = error # A fire-and-forget `Task.Run` in a controller captures the request's `HttpContext`, which is disposed when the request ends, so the background work throws `ObjectDisposedException` dotnet_diagnostic.SST2708.severity = error # A component subscribes to an event in a lifecycle method but never unsubscribes, so the event source keeps the component alive — a per-session leak on a Server circuit. dotnet_diagnostic.SST2709.severity = error # `StateHasChanged` is called while the component is being disposed, which the renderer no longer supports and throws. dotnet_diagnostic.SST2710.severity = error # `StateHasChanged` is called directly from a timer callback, off the renderer's dispatcher; marshal it with `InvokeAsync(StateHasChanged)`. @@ -1816,10 +1846,10 @@ dotnet_diagnostic.PSH1019.severity = error # The range indexer on an array alloc dotnet_diagnostic.PSH1020.severity = error # Prefer a jagged array over a multidimensional one dotnet_diagnostic.PSH1021.severity = error # An explicit GC.Collect or GC.WaitForPendingFinalizers forces collection the runtime tunes itself dotnet_diagnostic.PSH1022.severity = error # A parameterless `new EventArgs()` allocates where the shared `EventArgs.Empty` singleton would serve. Code fix uses the singleton. -dotnet_diagnostic.PSH1023.severity = error # Use a tuple instead of an anonymous type for a local value +dotnet_diagnostic.PSH1023.severity = error # A local anonymous type allocates where a tuple would not dotnet_diagnostic.PSH1100.severity = error # Hot-path code should avoid System.Linq.Enumerable calls -dotnet_diagnostic.PSH1101.severity = error # LINQ terminal predicate simplification is reserved for test code; production code should avoid LINQ on hot paths -dotnet_diagnostic.PSH1102.severity = error # LINQ type-filter simplification is reserved for test code; production code should avoid LINQ on hot paths +dotnet_diagnostic.PSH1101.severity = none # LINQ terminal predicate simplification is reserved for test code; production code should avoid LINQ on hot paths +dotnet_diagnostic.PSH1102.severity = none # LINQ type-filter simplification is reserved for test code; production code should avoid LINQ on hot paths dotnet_diagnostic.PSH1103.severity = error # Prefer the collection's own count over enumerating dotnet_diagnostic.PSH1104.severity = error # Use TryGetValue instead of ContainsKey followed by an indexer read dotnet_diagnostic.PSH1105.severity = error # Avoid double lookups on dictionaries and sets @@ -1831,7 +1861,7 @@ dotnet_diagnostic.PSH1110.severity = error # Use the collection's own predicate dotnet_diagnostic.PSH1111.severity = error # Use Contains for membership tests dotnet_diagnostic.PSH1112.severity = error # Seed the collection through its constructor (fix honors performancesharp.prefer_collection_expressions) dotnet_diagnostic.PSH1113.severity = error # Sort naturally instead of ordering by the element itself -dotnet_diagnostic.PSH1114.severity = error # Freeze static lookup collections that are never mutated. Opt-in. +dotnet_diagnostic.PSH1114.severity = error # Freeze static lookup collections that are never mutated dotnet_diagnostic.PSH1115.severity = error # Insert-if-absent should probe the dictionary once dotnet_diagnostic.PSH1116.severity = error # Probe string-keyed collections with a span through GetAlternateLookup dotnet_diagnostic.PSH1117.severity = error # Ask the collection whether it is empty @@ -1877,10 +1907,10 @@ dotnet_diagnostic.PSH1302.severity = error # TaskCompletionSource should run con dotnet_diagnostic.PSH1303.severity = error # Do not block an async method with Thread.Sleep dotnet_diagnostic.PSH1304.severity = error # Use PeriodicTimer instead of pacing a loop with Task.Delay dotnet_diagnostic.PSH1305.severity = error # Enumerate a ConcurrentDictionary directly, not its Keys/Values snapshots -dotnet_diagnostic.PSH1306.severity = error # Guard one-time execution with an interlocked latch. Opt-in. +dotnet_diagnostic.PSH1306.severity = error # Guard one-time execution with an interlocked latch dotnet_diagnostic.PSH1307.severity = error # Access interlocked fields with Volatile dotnet_diagnostic.PSH1308.severity = error # Return the completed task instead of Task.FromResult -dotnet_diagnostic.PSH1309.severity = error # Register cancellation callbacks without flowing the execution context. Opt-in. +dotnet_diagnostic.PSH1309.severity = error # Register cancellation callbacks without flowing the execution context dotnet_diagnostic.PSH1310.severity = error # Dispose IAsyncDisposable resources with await using in async code dotnet_diagnostic.PSH1311.severity = error # Remove a pass-through async state machine and return the task directly dotnet_diagnostic.PSH1312.severity = error # Return a completed task instead of null @@ -1898,7 +1928,7 @@ dotnet_diagnostic.PSH1406.severity = error # Ask Regex for the answer directly dotnet_diagnostic.PSH1407.severity = error # Query the dictionary, not its Keys view dotnet_diagnostic.PSH1408.severity = error # Measure elapsed time with Stopwatch timestamps dotnet_diagnostic.PSH1409.severity = error # Use the built-in throw helpers for argument guards -dotnet_diagnostic.PSH1410.severity = error # Mark trivial forwarders for aggressive inlining. Opt-in. +dotnet_diagnostic.PSH1410.severity = error # Mark trivial forwarders for aggressive inlining dotnet_diagnostic.PSH1411.severity = error # Seal non-public types nothing derives from so the JIT can devirtualize dotnet_diagnostic.PSH1412.severity = error # Use Random.Shared instead of allocating a Random dotnet_diagnostic.PSH1413.severity = error # Read the Unix epoch from the framework, not a hand-built DateTime @@ -1975,7 +2005,7 @@ dotnet_diagnostic.SES1402.severity = error # Do not load an assembly from raw by dotnet_diagnostic.SES1403.severity = error # JSON deserialization depth limit must stay within a safe ceiling dotnet_diagnostic.SES1404.severity = error # A type is instantiated by name from a non-constant Activator typeName dotnet_diagnostic.SES1405.severity = error # MessagePack typeless deserialization reconstructs whatever type the payload names -dotnet_diagnostic.SES1406.severity = error # Reflection must not reach non-public members via BindingFlags.NonPublic (opt-in; replaces S3011) +dotnet_diagnostic.SES1406.severity = error # Reflection must not reach non-public members via BindingFlags.NonPublic # Web hardening dotnet_diagnostic.SES1501.severity = error # A CORS policy must not allow credentials together with any origin @@ -2013,15 +2043,18 @@ dotnet_diagnostic.SES1707.severity = error # A secret-shaped literal appears in dotnet_diagnostic.SES1708.severity = error # `CircuitOptions.DetailedErrors` is enabled, shipping server exception detail to every connected client. dotnet_diagnostic.SES1709.severity = error # `SerializeAllClaims` serializes every claim into client-readable WebAssembly authentication state, exposing internal ids, tokens, and PII. dotnet_diagnostic.SES1710.severity = error # Antiforgery validation is disabled on a form (`[RequireAntiforgeryToken(required: false)]`), removing CSRF protection. -dotnet_diagnostic.RS0016.severity = error # public symbol missing from the PublicAPI baseline -dotnet_diagnostic.RS0017.severity = error # PublicAPI baseline entry no longer in source ################### # Public API surface tracking (PAS) ################### -# PAS0001/PAS0002/PAS0003/PAS0005 are errors by default and need no entry here. -dotnet_diagnostic.PAS0004.severity = error # no public API baseline for this target framework +dotnet_diagnostic.PAS0001.severity = error # A public symbol is missing from the baseline for this target framework +dotnet_diagnostic.PAS0002.severity = error # A baseline entry no longer exists in the public API +dotnet_diagnostic.PAS0003.severity = error # A public symbol differs from its baseline entry +dotnet_diagnostic.PAS0004.severity = error # No public API baseline for this target framework +dotnet_diagnostic.PAS0005.severity = error # The public API baseline could not be read +dotnet_diagnostic.RS0016.severity = error # A public symbol is missing from the PublicAPI baseline +dotnet_diagnostic.RS0017.severity = error # A PublicAPI baseline entry no longer exists in source ################### # Microsoft.NET.ILLink.Analyzers (IL) @@ -2158,467 +2191,467 @@ dotnet_diagnostic.IL3057.severity = error # Reflection access to generic paramet # SonarAnalyzer.CSharp (S) ################### # Repository suppressions -dotnet_diagnostic.S1075.severity = error # Hardcoded URI — canonical SourceLink hosts are the point -dotnet_diagnostic.S2436.severity = error # Too many generic parameters — needed for the projector overload -dotnet_diagnostic.S4036.severity = error # PATH-relative process spawn — benchmark only, trusted env -dotnet_diagnostic.S8969.severity = error # Nullability inference is inconsistent across the repository's target frameworks +dotnet_diagnostic.S1075.severity = none # Hardcoded URI — canonical SourceLink hosts are the point +dotnet_diagnostic.S2436.severity = none # Too many generic parameters — needed for the projector overload +dotnet_diagnostic.S4036.severity = none # PATH-relative process spawn — benchmark only, trusted env +dotnet_diagnostic.S8969.severity = none # Nullability inference is inconsistent across the repository's target frameworks # Blocker bugs -dotnet_diagnostic.S1048.severity = error # Finalizers should not throw exceptions — covered by SST1485 -dotnet_diagnostic.S2190.severity = error # Loops and recursions should not be infinite -dotnet_diagnostic.S2275.severity = error # Composite format strings should not lead to unexpected behavior at runtime - DUPLICATE CA2241 -dotnet_diagnostic.S2857.severity = error # SQL keywords should be delimited by whitespace — covered by SST2470 -dotnet_diagnostic.S2930.severity = error # "IDisposables" should be disposed — covered by SST2410 -dotnet_diagnostic.S2931.severity = error # Classes with "IDisposable" members should implement "IDisposable" — covered by SST2315 -dotnet_diagnostic.S3464.severity = error # Type inheritance should not be recursive — covered by SST2437 -dotnet_diagnostic.S3869.severity = error # "SafeHandle.DangerousGetHandle" should not be called -> replaced by SST2484 -dotnet_diagnostic.S3889.severity = error # "Thread.Resume" and "Thread.Suspend" should not be used -> replaced by obsolete or compiler -dotnet_diagnostic.S4159.severity = error # Classes should implement their "ExportAttribute" interfaces — covered by SST2472 +dotnet_diagnostic.S1048.severity = none # Finalizers should not throw exceptions — covered by SST1485 +dotnet_diagnostic.S2190.severity = none # Loops and recursions should not be infinite +dotnet_diagnostic.S2275.severity = none # Composite format strings should not lead to unexpected behavior at runtime - DUPLICATE CA2241 +dotnet_diagnostic.S2857.severity = none # SQL keywords should be delimited by whitespace — covered by SST2470 +dotnet_diagnostic.S2930.severity = none # "IDisposables" should be disposed — covered by SST2410 +dotnet_diagnostic.S2931.severity = none # Classes with "IDisposable" members should implement "IDisposable" — covered by SST2315 +dotnet_diagnostic.S3464.severity = none # Type inheritance should not be recursive — covered by SST2437 +dotnet_diagnostic.S3869.severity = none # "SafeHandle.DangerousGetHandle" should not be called -> replaced by SST2484 +dotnet_diagnostic.S3889.severity = none # "Thread.Resume" and "Thread.Suspend" should not be used -> replaced by obsolete or compiler +dotnet_diagnostic.S4159.severity = none # Classes should implement their "ExportAttribute" interfaces — covered by SST2472 # Critical bugs -dotnet_diagnostic.S2551.severity = error # Shared resources should not be used for locking — covered by SST1902 -dotnet_diagnostic.S2952.severity = error # Classes should "Dispose" of members from the classes' own "Dispose" methods -> replaced by SST2315 -dotnet_diagnostic.S3449.severity = error # Right operands of shift operators should be integers -> replaced by SST1478 -dotnet_diagnostic.S4275.severity = error # Getters and setters should access the expected fields — covered by SST2422 -dotnet_diagnostic.S4277.severity = error # "Shared" parts should not be created with "new" — covered by SST2473 -dotnet_diagnostic.S4583.severity = error # Calls to delegate's method "BeginInvoke" should be paired with calls to "EndInvoke" -> replaced by obsolete (APM BeginInvoke/EndInvoke) -dotnet_diagnostic.S4586.severity = error # Non-async "Task/Task" methods should not return null — covered by PSH1312 -dotnet_diagnostic.S5856.severity = error # Regular expressions should be syntactically valid — covered by SST2444 -dotnet_diagnostic.S6674.severity = error # Log message template should be syntactically correct — covered by SST2441 +dotnet_diagnostic.S2551.severity = none # Shared resources should not be used for locking — covered by SST1902 +dotnet_diagnostic.S2952.severity = none # Classes should "Dispose" of members from the classes' own "Dispose" methods -> replaced by SST2315 +dotnet_diagnostic.S3449.severity = none # Right operands of shift operators should be integers -> replaced by SST1478 +dotnet_diagnostic.S4275.severity = none # Getters and setters should access the expected fields — covered by SST2422 +dotnet_diagnostic.S4277.severity = none # "Shared" parts should not be created with "new" — covered by SST2473 +dotnet_diagnostic.S4583.severity = none # Calls to delegate's method "BeginInvoke" should be paired with calls to "EndInvoke" -> replaced by obsolete (APM BeginInvoke/EndInvoke) +dotnet_diagnostic.S4586.severity = none # Non-async "Task/Task" methods should not return null — covered by PSH1312 +dotnet_diagnostic.S5856.severity = none # Regular expressions should be syntactically valid — covered by SST2444 +dotnet_diagnostic.S6674.severity = none # Log message template should be syntactically correct — covered by SST2441 # Major bugs -dotnet_diagnostic.S1244.severity = error # Floating point numbers should not be tested for equality — covered by SST1473 -dotnet_diagnostic.S1656.severity = error # Variables should not be self-assigned — covered by SST1189 -dotnet_diagnostic.S1751.severity = error # Loops with at most one iteration should be refactored - covered by SST1444 -dotnet_diagnostic.S1764.severity = error # Identical expressions should not be used on both sides of operators — covered by SST1474 -dotnet_diagnostic.S1848.severity = error # Objects should not be created to be dropped immediately without being used -> replaced by SST1480 -dotnet_diagnostic.S1862.severity = error # Related "if/else if" statements should not have the same condition — covered by SST1475 -dotnet_diagnostic.S2114.severity = error # Collections should not be passed as arguments to their own methods — covered by SST2419 -dotnet_diagnostic.S2123.severity = error # Values should not be uselessly incremented -> replaced by SST2222 -dotnet_diagnostic.S2201.severity = error # Methods without side effects should not have their return values ignored — covered by SST2418 -dotnet_diagnostic.S2225.severity = error # "ToString()" method should not return null — covered by SST2431 -dotnet_diagnostic.S2251.severity = error # A "for" loop update clause should move the counter in the right direction — covered by SST2412 -dotnet_diagnostic.S2252.severity = error # For-loop conditions should be true at least once — covered by SST2413 -dotnet_diagnostic.S2445.severity = error # Blocks should be synchronized on read-only fields — covered by SST1904 -dotnet_diagnostic.S2688.severity = error # "NaN" should not be used in comparisons — covered by SST1473 -dotnet_diagnostic.S2757.severity = error # Non-existent operators like "=+" should not be used — covered by SST2417 -dotnet_diagnostic.S2761.severity = error # Doubled prefix operators "!!" and "~~" should not be used — covered by SST1190 -dotnet_diagnostic.S2995.severity = error # "Object.ReferenceEquals" should not be used for value types -> replaced by CA2013 -dotnet_diagnostic.S2996.severity = error # "ThreadStatic" fields should not be initialized -> replaced by CA2019 -dotnet_diagnostic.S2997.severity = error # "IDisposables" created in a "using" statement should not be returned — covered by SST2423 -dotnet_diagnostic.S3005.severity = error # "ThreadStatic" should not be used on non-static fields -> replaced by CA2259 -dotnet_diagnostic.S3168.severity = error # "async" methods should not return "void" — covered by SST1905 -dotnet_diagnostic.S3172.severity = error # Delegates should not be subtracted — covered by SST2448 -dotnet_diagnostic.S3244.severity = error # Anonymous delegates should not be used to unsubscribe from Events — covered by SST2449 -dotnet_diagnostic.S3249.severity = error # Covered by SST1447 (canonical) -dotnet_diagnostic.S3263.severity = error # Static fields should appear in the order they must be initialized — covered by SST2428 -dotnet_diagnostic.S3343.severity = error # Caller information parameters should come at the end of the parameter list — covered by SST2433 -dotnet_diagnostic.S3346.severity = error # Expressions used in "Debug.Assert" should not produce side effects — covered by SST2450 -dotnet_diagnostic.S3453.severity = error # Classes should not have only "private" constructors — covered by SST2451 -dotnet_diagnostic.S3466.severity = error # Optional parameters should be passed to "base" calls — covered by SST2425 -dotnet_diagnostic.S3598.severity = error # One-way "OperationContract" methods should have "void" return type -> replaced by obsolete (WCF) -dotnet_diagnostic.S3603.severity = error # Methods with "Pure" attribute should return a value — covered by SST2452 -dotnet_diagnostic.S3610.severity = error # Nullable type comparison should not be redundant -> replaced by compiler CS0472 -dotnet_diagnostic.S3903.severity = error # Types should be defined in named namespaces — covered by SST2312 -dotnet_diagnostic.S3923.severity = error # All branches in a conditional structure should not have exactly the same implementation — covered by SST1476 -dotnet_diagnostic.S3926.severity = error # Deserialization methods should be provided for "OptionalField" members -> replaced by obsolete (legacy binary serialization) -dotnet_diagnostic.S3927.severity = error # Serialization event handlers should be implemented correctly — covered by SST2430 -dotnet_diagnostic.S3981.severity = error # Collection sizes and array length comparisons should make sense — covered by SST1479 -dotnet_diagnostic.S3984.severity = error # Exceptions should not be created without being thrown — covered by SST1480 -dotnet_diagnostic.S4143.severity = error # Collection elements should not be replaced unconditionally — covered by SST1487 -dotnet_diagnostic.S4210.severity = error # Windows Forms entry points should be marked with STAThread -> replaced by SST2706 -dotnet_diagnostic.S4260.severity = error # "ConstructorArgument" parameters should exist in constructors -> replaced by SST2487 -dotnet_diagnostic.S4428.severity = error # "PartCreationPolicyAttribute" should be used with "ExportAttribute" — covered by SST2474 -dotnet_diagnostic.S6507.severity = error # Blocks should not be synchronized on local variables — covered by SST1903 -dotnet_diagnostic.S6677.severity = error # Message template placeholders should be unique — covered by SST2442 -dotnet_diagnostic.S6797.severity = error # Blazor query parameter type should be supported -> replaced by SST2702 -dotnet_diagnostic.S6798.severity = error # [JSInvokable] attribute should only be used on public methods -> replaced by SST2701 -dotnet_diagnostic.S6800.severity = error # Component parameter type should match the route parameter type constraint -> replaced by SST2703 -dotnet_diagnostic.S6930.severity = error # Backslash should be avoided in route templates -> replaced by SST2700 +dotnet_diagnostic.S1244.severity = none # Floating point numbers should not be tested for equality — covered by SST1473 +dotnet_diagnostic.S1656.severity = none # Variables should not be self-assigned — covered by SST1189 +dotnet_diagnostic.S1751.severity = none # Loops with at most one iteration should be refactored - covered by SST1444 +dotnet_diagnostic.S1764.severity = none # Identical expressions should not be used on both sides of operators — covered by SST1474 +dotnet_diagnostic.S1848.severity = none # Objects should not be created to be dropped immediately without being used -> replaced by SST1480 +dotnet_diagnostic.S1862.severity = none # Related "if/else if" statements should not have the same condition — covered by SST1475 +dotnet_diagnostic.S2114.severity = none # Collections should not be passed as arguments to their own methods — covered by SST2419 +dotnet_diagnostic.S2123.severity = none # Values should not be uselessly incremented -> replaced by SST2222 +dotnet_diagnostic.S2201.severity = none # Methods without side effects should not have their return values ignored — covered by SST2418 +dotnet_diagnostic.S2225.severity = none # "ToString()" method should not return null — covered by SST2431 +dotnet_diagnostic.S2251.severity = none # A "for" loop update clause should move the counter in the right direction — covered by SST2412 +dotnet_diagnostic.S2252.severity = none # For-loop conditions should be true at least once — covered by SST2413 +dotnet_diagnostic.S2445.severity = none # Blocks should be synchronized on read-only fields — covered by SST1904 +dotnet_diagnostic.S2688.severity = none # "NaN" should not be used in comparisons — covered by SST1473 +dotnet_diagnostic.S2757.severity = none # Non-existent operators like "=+" should not be used — covered by SST2417 +dotnet_diagnostic.S2761.severity = none # Doubled prefix operators "!!" and "~~" should not be used — covered by SST1190 +dotnet_diagnostic.S2995.severity = none # "Object.ReferenceEquals" should not be used for value types -> replaced by CA2013 +dotnet_diagnostic.S2996.severity = none # "ThreadStatic" fields should not be initialized -> replaced by CA2019 +dotnet_diagnostic.S2997.severity = none # "IDisposables" created in a "using" statement should not be returned — covered by SST2423 +dotnet_diagnostic.S3005.severity = none # "ThreadStatic" should not be used on non-static fields -> replaced by CA2259 +dotnet_diagnostic.S3168.severity = none # "async" methods should not return "void" — covered by SST1905 +dotnet_diagnostic.S3172.severity = none # Delegates should not be subtracted — covered by SST2448 +dotnet_diagnostic.S3244.severity = none # Anonymous delegates should not be used to unsubscribe from Events — covered by SST2449 +dotnet_diagnostic.S3249.severity = none # Covered by SST1447 (canonical) +dotnet_diagnostic.S3263.severity = none # Static fields should appear in the order they must be initialized — covered by SST2428 +dotnet_diagnostic.S3343.severity = none # Caller information parameters should come at the end of the parameter list — covered by SST2433 +dotnet_diagnostic.S3346.severity = none # Expressions used in "Debug.Assert" should not produce side effects — covered by SST2450 +dotnet_diagnostic.S3453.severity = none # Classes should not have only "private" constructors — covered by SST2451 +dotnet_diagnostic.S3466.severity = none # Optional parameters should be passed to "base" calls — covered by SST2425 +dotnet_diagnostic.S3598.severity = none # One-way "OperationContract" methods should have "void" return type -> replaced by obsolete (WCF) +dotnet_diagnostic.S3603.severity = none # Methods with "Pure" attribute should return a value — covered by SST2452 +dotnet_diagnostic.S3610.severity = none # Nullable type comparison should not be redundant -> replaced by compiler CS0472 +dotnet_diagnostic.S3903.severity = none # Types should be defined in named namespaces — covered by SST2312 +dotnet_diagnostic.S3923.severity = none # All branches in a conditional structure should not have exactly the same implementation — covered by SST1476 +dotnet_diagnostic.S3926.severity = none # Deserialization methods should be provided for "OptionalField" members -> replaced by obsolete (legacy binary serialization) +dotnet_diagnostic.S3927.severity = none # Serialization event handlers should be implemented correctly — covered by SST2430 +dotnet_diagnostic.S3981.severity = none # Collection sizes and array length comparisons should make sense — covered by SST1479 +dotnet_diagnostic.S3984.severity = none # Exceptions should not be created without being thrown — covered by SST1480 +dotnet_diagnostic.S4143.severity = none # Collection elements should not be replaced unconditionally — covered by SST1487 +dotnet_diagnostic.S4210.severity = none # Windows Forms entry points should be marked with STAThread -> replaced by SST2706 +dotnet_diagnostic.S4260.severity = none # "ConstructorArgument" parameters should exist in constructors -> replaced by SST2487 +dotnet_diagnostic.S4428.severity = none # "PartCreationPolicyAttribute" should be used with "ExportAttribute" — covered by SST2474 +dotnet_diagnostic.S6507.severity = none # Blocks should not be synchronized on local variables — covered by SST1903 +dotnet_diagnostic.S6677.severity = none # Message template placeholders should be unique — covered by SST2442 +dotnet_diagnostic.S6797.severity = none # Blazor query parameter type should be supported -> replaced by SST2702 +dotnet_diagnostic.S6798.severity = none # [JSInvokable] attribute should only be used on public methods -> replaced by SST2701 +dotnet_diagnostic.S6800.severity = none # Component parameter type should match the route parameter type constraint -> replaced by SST2703 +dotnet_diagnostic.S6930.severity = none # Backslash should be avoided in route templates -> replaced by SST2700 # Minor bugs -dotnet_diagnostic.S1206.severity = error # "Equals(Object)" and "GetHashCode()" should be overridden in pairs - DUPLICATE CA2218 -dotnet_diagnostic.S1226.severity = error # Method parameters, caught exceptions and foreach variables' initial values should not be ignored -dotnet_diagnostic.S2183.severity = error # Integral numbers should not be shifted by zero or more than their number of bits-1 — covered by SST1478 -dotnet_diagnostic.S2184.severity = error # Results of integer division should not be assigned to floating point variables — covered by SST1477 -dotnet_diagnostic.S2328.severity = error # "GetHashCode" should not reference mutable fields — covered by SST1482 -dotnet_diagnostic.S2345.severity = error # Flags enumerations should explicitly initialize all their members — covered by SST2303 -dotnet_diagnostic.S2674.severity = error # The length returned from a stream read should be checked — covered by SST2446 -dotnet_diagnostic.S2934.severity = error # Property assignments should not be made for "readonly" fields not constrained to reference types — covered by SST2421 -dotnet_diagnostic.S2955.severity = error # Generic parameters not constrained to reference types should not be compared to "null" -> replaced by compiler CS0019/CS0037 -dotnet_diagnostic.S3363.severity = error # Date and time should not be used as a type for primary keys — covered by SST2475 -dotnet_diagnostic.S3397.severity = error # "base.Equals" should not be used to check for reference equality in "Equals" if "base" is not "object" — covered by SST2435 -dotnet_diagnostic.S3456.severity = error # "string.ToCharArray()" and "ReadOnlySpan.ToArray()" should not be called redundantly — covered by PSH1217 -dotnet_diagnostic.S3887.severity = error # Mutable, non-private fields should not be "readonly" — covered by SST2322 +dotnet_diagnostic.S1206.severity = none # "Equals(Object)" and "GetHashCode()" should be overridden in pairs - DUPLICATE CA2218 +dotnet_diagnostic.S1226.severity = none # Method parameters, caught exceptions and foreach variables' initial values should not be ignored +dotnet_diagnostic.S2183.severity = none # Integral numbers should not be shifted by zero or more than their number of bits-1 — covered by SST1478 +dotnet_diagnostic.S2184.severity = none # Results of integer division should not be assigned to floating point variables — covered by SST1477 +dotnet_diagnostic.S2328.severity = none # "GetHashCode" should not reference mutable fields — covered by SST1482 +dotnet_diagnostic.S2345.severity = none # Flags enumerations should explicitly initialize all their members — covered by SST2303 +dotnet_diagnostic.S2674.severity = none # The length returned from a stream read should be checked — covered by SST2446 +dotnet_diagnostic.S2934.severity = none # Property assignments should not be made for "readonly" fields not constrained to reference types — covered by SST2421 +dotnet_diagnostic.S2955.severity = none # Generic parameters not constrained to reference types should not be compared to "null" -> replaced by compiler CS0019/CS0037 +dotnet_diagnostic.S3363.severity = none # Date and time should not be used as a type for primary keys — covered by SST2475 +dotnet_diagnostic.S3397.severity = none # "base.Equals" should not be used to check for reference equality in "Equals" if "base" is not "object" — covered by SST2435 +dotnet_diagnostic.S3456.severity = none # "string.ToCharArray()" and "ReadOnlySpan.ToArray()" should not be called redundantly — covered by PSH1217 +dotnet_diagnostic.S3887.severity = none # Mutable, non-private fields should not be "readonly" — covered by SST2322 # Blocker vulnerabilities -dotnet_diagnostic.S2115.severity = error # A secure password should be used when connecting to a database -> replaced by SES1203 -dotnet_diagnostic.S2755.severity = error # XML parsers should not be vulnerable to XXE attacks -> replaced by CA3075 -dotnet_diagnostic.S3884.severity = error # "CoSetProxyBlanket" and "CoInitializeSecurity" should not be used -> replaced by obsolete (COM interop security) -dotnet_diagnostic.S6418.severity = error # Secrets should not be hard-coded — covered by SES1201 +dotnet_diagnostic.S2115.severity = none # A secure password should be used when connecting to a database -> replaced by SES1203 +dotnet_diagnostic.S2755.severity = none # XML parsers should not be vulnerable to XXE attacks -> replaced by CA3075 +dotnet_diagnostic.S3884.severity = none # "CoSetProxyBlanket" and "CoInitializeSecurity" should not be used -> replaced by obsolete (COM interop security) +dotnet_diagnostic.S6418.severity = none # Secrets should not be hard-coded — covered by SES1201 # Critical vulnerabilities -dotnet_diagnostic.S4423.severity = error # Weak SSL/TLS protocols should not be used -> replaced by CA5397/CA5398 -dotnet_diagnostic.S4426.severity = error # Cryptographic keys should be robust -> replaced by CA5385 (RSA) / CA5384 (DSA) -dotnet_diagnostic.S4433.severity = error # LDAP connections should be authenticated -> replaced by SES1310 -dotnet_diagnostic.S4830.severity = error # Server certificates should be verified during SSL/TLS connections -> replaced by SES1102 or SES1108 -dotnet_diagnostic.S5344.severity = error # Passwords should not be stored in plaintext or with a fast hashing algorithm -> replaced by SES1009 -dotnet_diagnostic.S5445.severity = error # Insecure temporary file creation methods should not be used -> replaced by SES1307 -dotnet_diagnostic.S5542.severity = error # Encryption algorithms should be used with secure mode and padding scheme -> replaced by CA5358 -dotnet_diagnostic.S5547.severity = error # Cipher algorithms should be robust -> replaced by CA5351 -dotnet_diagnostic.S5659.severity = error # JWT should be signed and verified with strong cipher algorithms -> replaced by SES1503 +dotnet_diagnostic.S4423.severity = none # Weak SSL/TLS protocols should not be used -> replaced by CA5397/CA5398 +dotnet_diagnostic.S4426.severity = none # Cryptographic keys should be robust -> replaced by CA5385 (RSA) / CA5384 (DSA) +dotnet_diagnostic.S4433.severity = none # LDAP connections should be authenticated -> replaced by SES1310 +dotnet_diagnostic.S4830.severity = none # Server certificates should be verified during SSL/TLS connections -> replaced by SES1102 or SES1108 +dotnet_diagnostic.S5344.severity = none # Passwords should not be stored in plaintext or with a fast hashing algorithm -> replaced by SES1009 +dotnet_diagnostic.S5445.severity = none # Insecure temporary file creation methods should not be used -> replaced by SES1307 +dotnet_diagnostic.S5542.severity = none # Encryption algorithms should be used with secure mode and padding scheme -> replaced by CA5358 +dotnet_diagnostic.S5547.severity = none # Cipher algorithms should be robust -> replaced by CA5351 +dotnet_diagnostic.S5659.severity = none # JWT should be signed and verified with strong cipher algorithms -> replaced by SES1503 # Major vulnerabilities -dotnet_diagnostic.S2068.severity = error # Credentials should not be hard-coded -> replaced by SES1201 -dotnet_diagnostic.S2612.severity = error # File permissions should not be set to world-accessible values -> replaced by SES1308 -dotnet_diagnostic.S4211.severity = error # Members should not have conflicting transparency annotations -> replaced by obsolete (Code Access Security) -dotnet_diagnostic.S4212.severity = error # Serialization constructors should be secured -> replaced by obsolete (Code Access Security) -dotnet_diagnostic.S6377.severity = error # XML signatures should be validated securely -> replaced by SES1008 -dotnet_diagnostic.S7039.severity = error # Content Security Policies should be restrictive -> replaced by SES1515 +dotnet_diagnostic.S2068.severity = none # Credentials should not be hard-coded -> replaced by SES1201 +dotnet_diagnostic.S2612.severity = none # File permissions should not be set to world-accessible values -> replaced by SES1308 +dotnet_diagnostic.S4211.severity = none # Members should not have conflicting transparency annotations -> replaced by obsolete (Code Access Security) +dotnet_diagnostic.S4212.severity = none # Serialization constructors should be secured -> replaced by obsolete (Code Access Security) +dotnet_diagnostic.S6377.severity = none # XML signatures should be validated securely -> replaced by SES1008 +dotnet_diagnostic.S7039.severity = none # Content Security Policies should be restrictive -> replaced by SES1515 # Blocker code smells -dotnet_diagnostic.S1147.severity = error # Exit methods should not be called — covered by SST2321 -dotnet_diagnostic.S1451.severity = error # Track lack of copyright and license headers -dotnet_diagnostic.S2178.severity = error # Short-circuit logic should be used in boolean contexts — covered by SST2415 -dotnet_diagnostic.S2187.severity = error # Test classes should contain at least one test case — covered by SST2504 -dotnet_diagnostic.S2306.severity = error # "async" and "await" should not be used as identifiers -> replaced by compiler (contextual keyword) -dotnet_diagnostic.S2368.severity = error # Public methods should not have multidimensional array parameters — jagged arrays are the chosen layout for hot-path lookup tables -dotnet_diagnostic.S2387.severity = error # Child class fields should not shadow parent class fields — covered by SST1484 -dotnet_diagnostic.S2437.severity = error # Unnecessary bit operations should not be performed — covered by SST1481 -dotnet_diagnostic.S2699.severity = error # Tests should include assertions -> replaced by SST2500 -dotnet_diagnostic.S2953.severity = error # Methods named "Dispose" should implement "IDisposable.Dispose" — covered by SST2316 -dotnet_diagnostic.S2970.severity = error # Assertions should be complete -> replaced by SST2508 -dotnet_diagnostic.S3060.severity = error # "is" should not be used with "this" -> replaced by SST2327 -dotnet_diagnostic.S3237.severity = error # "value" contextual keyword should be used — covered by SST2429 -dotnet_diagnostic.S3427.severity = error # Method overloads with default parameter values should not overlap — covered by SST2319 -dotnet_diagnostic.S3433.severity = error # Test method signatures should be correct -> replaced by SST2509 -dotnet_diagnostic.S3443.severity = error # Type should not be examined on "System.Type" instances — covered by SST2432 -dotnet_diagnostic.S3875.severity = error # "operator==" should not be overloaded on reference types -> replaced by SST2464 -dotnet_diagnostic.S3877.severity = error # Exceptions should not be thrown from unexpected methods — covered by SST1485 -dotnet_diagnostic.S4462.severity = error # Calls to "async" methods should not be blocking - covered by PSH1315 -dotnet_diagnostic.S6422.severity = error # Calls to "async" methods should not be blocking in Azure Functions — covered by PSH1315 -dotnet_diagnostic.S6424.severity = error # Interfaces for durable entities should satisfy the restrictions -> off: Durable Entity-specific; not used in this library +dotnet_diagnostic.S1147.severity = none # Exit methods should not be called — covered by SST2321 +dotnet_diagnostic.S1451.severity = none # Track lack of copyright and license headers +dotnet_diagnostic.S2178.severity = none # Short-circuit logic should be used in boolean contexts — covered by SST2415 +dotnet_diagnostic.S2187.severity = none # Test classes should contain at least one test case — covered by SST2504 +dotnet_diagnostic.S2306.severity = none # "async" and "await" should not be used as identifiers -> replaced by compiler (contextual keyword) +dotnet_diagnostic.S2368.severity = none # Public methods should not have multidimensional array parameters — jagged arrays are the chosen layout for hot-path lookup tables +dotnet_diagnostic.S2387.severity = none # Child class fields should not shadow parent class fields — covered by SST1484 +dotnet_diagnostic.S2437.severity = none # Unnecessary bit operations should not be performed — covered by SST1481 +dotnet_diagnostic.S2699.severity = none # Tests should include assertions -> replaced by SST2500 +dotnet_diagnostic.S2953.severity = none # Methods named "Dispose" should implement "IDisposable.Dispose" — covered by SST2316 +dotnet_diagnostic.S2970.severity = none # Assertions should be complete -> replaced by SST2508 +dotnet_diagnostic.S3060.severity = none # "is" should not be used with "this" -> replaced by SST2327 +dotnet_diagnostic.S3237.severity = none # "value" contextual keyword should be used — covered by SST2429 +dotnet_diagnostic.S3427.severity = none # Method overloads with default parameter values should not overlap — covered by SST2319 +dotnet_diagnostic.S3433.severity = none # Test method signatures should be correct -> replaced by SST2509 +dotnet_diagnostic.S3443.severity = none # Type should not be examined on "System.Type" instances — covered by SST2432 +dotnet_diagnostic.S3875.severity = none # "operator==" should not be overloaded on reference types -> replaced by SST2464 +dotnet_diagnostic.S3877.severity = none # Exceptions should not be thrown from unexpected methods — covered by SST1485 +dotnet_diagnostic.S4462.severity = none # Calls to "async" methods should not be blocking - covered by PSH1315 +dotnet_diagnostic.S6422.severity = none # Calls to "async" methods should not be blocking in Azure Functions — covered by PSH1315 +dotnet_diagnostic.S6424.severity = none # Interfaces for durable entities should satisfy the restrictions -> off: Durable Entity-specific; not used in this library # Critical code smells -dotnet_diagnostic.S1006.severity = error # Method overrides should not change parameter defaults — covered by SST2424 -dotnet_diagnostic.S1067.severity = error # Expressions should not be too complex -dotnet_diagnostic.S1163.severity = error # Exceptions should not be thrown in finally blocks -> replaced by CA2219 -dotnet_diagnostic.S1186.severity = error # Methods should not be empty — covered by SST1438 -dotnet_diagnostic.S121.severity = error # Control structures should use curly braces (kept over SA1503 — Sonar 20ms vs SA1503 50ms) -> replaced by SST1503 -dotnet_diagnostic.S1215.severity = error # "GC.Collect" should not be called — covered by PSH1021 -dotnet_diagnostic.S126.severity = error # "if ... else if" constructs should end with "else" clauses -dotnet_diagnostic.S131.severity = error # "switch/Select" statements should contain a "default/Case Else" clauses -dotnet_diagnostic.S134.severity = error # Control flow statements "if", "switch", "for", "foreach", "while", "do" and "try" should not be nested too deeply -dotnet_diagnostic.S1541.severity = error # Methods and properties should not be too complex - covered by SST1442 -dotnet_diagnostic.S1699.severity = error # Constructors should only call non-overridable methods — covered by SST1483 -dotnet_diagnostic.S1821.severity = error # "switch" statements should not be nested -> replaced by SST2252 -dotnet_diagnostic.S1944.severity = error # Invalid casts should be avoided -> replaced by compiler CS0030 -dotnet_diagnostic.S1994.severity = error # "for" loop increment clauses should modify the loops' counters — covered by SST2411 -dotnet_diagnostic.S2197.severity = error # Modulus results should not be checked for direct equality — covered by SST2416 -dotnet_diagnostic.S2198.severity = error # Unnecessary mathematical comparisons should not be made -> replaced by SST2489 -dotnet_diagnostic.S2223.severity = error # Non-constant static fields should not be visible - DUPLICATE CA2211 -dotnet_diagnostic.S2290.severity = error # Field-like events should not be virtual -> replaced by SST2456 -dotnet_diagnostic.S2291.severity = error # Overflow checking should not be disabled for "Enumerable.Sum" — covered by SST2457 -dotnet_diagnostic.S2302.severity = error # "nameof" should be used — covered by SST1415 -dotnet_diagnostic.S2330.severity = error # Array covariance should not be used — covered by SST2434 -dotnet_diagnostic.S2339.severity = error # Public constant members should not be used — covered by SST2311 -dotnet_diagnostic.S2346.severity = error # Flags enumerations zero-value members should be named "None" - DUPLICATE CA1008 -dotnet_diagnostic.S2360.severity = error # Optional parameters should not be used — conflicts with SST2433, which owns caller-info parameters requiring a default -dotnet_diagnostic.S2365.severity = error # Properties should not make collection or array copies — covered by PSH1017 -dotnet_diagnostic.S2479.severity = error # Whitespace and control characters in string literals should be explicit — covered by SST1192 -dotnet_diagnostic.S2692.severity = error # "IndexOf" checks should not be for positive numbers — covered by SST2420 -dotnet_diagnostic.S2696.severity = error # Instance members should not write to "static" fields -> replaced by SST2402 -dotnet_diagnostic.S2701.severity = error # Literal boolean values should not be used in assertions — covered by SST2503 -dotnet_diagnostic.S3215.severity = error # "interface" instances should not be cast to concrete types -> deliberately unenforced, same reason as SST2326 -dotnet_diagnostic.S3216.severity = error # "ConfigureAwait(false)" should be used -> replaced by CA2007 -dotnet_diagnostic.S3217.severity = error # "Explicit" conversions of "foreach" loops should not be used — covered by SST2225 -dotnet_diagnostic.S3218.severity = error # Inner class members should not shadow outer class "static" or type members — covered by SST1484 -dotnet_diagnostic.S3265.severity = error # Non-flags enums should not be used in bitwise operations — covered by SST2458 -dotnet_diagnostic.S3353.severity = error # Unchanged variables should be marked as "const" — covered by PSH1402 -dotnet_diagnostic.S3447.severity = error # "[Optional]" should not be used on "ref" or "out" parameters — covered by SST2459 -dotnet_diagnostic.S3451.severity = error # "[DefaultValue]" should not be used when "[DefaultParameterValue]" is meant — covered by SST2460 -dotnet_diagnostic.S3600.severity = error # "params" should not be introduced on overrides — covered by SST2426 -dotnet_diagnostic.S3776.severity = error # Cognitive Complexity of methods should not be too high - covered by SST1443 -dotnet_diagnostic.S3871.severity = error # Exception types should be "public" -> replaced by CA1064 -dotnet_diagnostic.S3874.severity = error # "out" and "ref" parameters — repo idiom is TryX(..., out T value) -dotnet_diagnostic.S3904.severity = error # Assemblies should have version information -> replaced by obsolete (SDK supplies assembly version) -dotnet_diagnostic.S3937.severity = error # Number patterns should be regular — covered by SST1119 -dotnet_diagnostic.S3972.severity = error # Conditionals should start on new lines — covered by SST1146 -dotnet_diagnostic.S3973.severity = error # A conditionally executed single line should be denoted by indentation -> replaced by SST1503 -dotnet_diagnostic.S3998.severity = error # Threads should not lock on objects with weak identity -> replaced by SST1902 -dotnet_diagnostic.S4000.severity = error # Pointers to unmanaged memory should not be visible -> replaced by SST2328 -dotnet_diagnostic.S4015.severity = error # Inherited member visibility should not be decreased — covered by SST2462 -dotnet_diagnostic.S4019.severity = error # Base class methods should not be hidden — covered by SST2427 -dotnet_diagnostic.S4025.severity = error # Child class fields should not differ from parent class fields only by capitalization — covered by SST2463 -dotnet_diagnostic.S4039.severity = error # Interface methods should be callable by derived types - DUPLICATE CA1033 -dotnet_diagnostic.S4487.severity = error # Unread "private" fields should be removed -dotnet_diagnostic.S4524.severity = error # "default" clauses should be first or last — covered by SST1219 -dotnet_diagnostic.S4635.severity = error # Start index should be used instead of calling Substring — covered by PSH1218 -dotnet_diagnostic.S5034.severity = error # "ValueTask" should be consumed correctly — covered by PSH1316 -dotnet_diagnostic.S6967.severity = error # ModelState.IsValid should be called in controller actions -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S8367.severity = error # Identifiers should not conflict with the C# 14 "field" contextual keyword - the C# 14 compiler reports this: CS9273 (error) for a local named field in an accessor, CS9258 (warning) for a rebinding read -dotnet_diagnostic.S8368.severity = error # Identifiers should not conflict with the C# 14 "extension" contextual keyword - the C# 14 compiler reports this as CS9306, and SST1300 already flags the lowercase type name -dotnet_diagnostic.S8380.severity = error # Return types named "partial" should be escaped with "@" - the compiler reports this as CS8981, and SST1300 already flags the lowercase type name -dotnet_diagnostic.S8381.severity = error # "scoped" should be escaped when used as an identifier or type name in parenthesized lambda parameter lists -> replaced by compiler -dotnet_diagnostic.S927.severity = error # Parameter names should match base declaration and other partial definitions - DUPLICATE CA1725 +dotnet_diagnostic.S1006.severity = none # Method overrides should not change parameter defaults — covered by SST2424 +dotnet_diagnostic.S1067.severity = none # Expressions should not be too complex +dotnet_diagnostic.S1163.severity = none # Exceptions should not be thrown in finally blocks -> replaced by CA2219 +dotnet_diagnostic.S1186.severity = none # Methods should not be empty — covered by SST1438 +dotnet_diagnostic.S121.severity = none # Control structures should use curly braces (kept over SA1503 — Sonar 20ms vs SA1503 50ms) -> replaced by SST1503 +dotnet_diagnostic.S1215.severity = none # "GC.Collect" should not be called — covered by PSH1021 +dotnet_diagnostic.S126.severity = none # "if ... else if" constructs should end with "else" clauses +dotnet_diagnostic.S131.severity = none # "switch/Select" statements should contain a "default/Case Else" clauses +dotnet_diagnostic.S134.severity = none # Control flow statements "if", "switch", "for", "foreach", "while", "do" and "try" should not be nested too deeply +dotnet_diagnostic.S1541.severity = none # Methods and properties should not be too complex - covered by SST1442 +dotnet_diagnostic.S1699.severity = none # Constructors should only call non-overridable methods — covered by SST1483 +dotnet_diagnostic.S1821.severity = none # "switch" statements should not be nested -> replaced by SST2252 +dotnet_diagnostic.S1944.severity = none # Invalid casts should be avoided -> replaced by compiler CS0030 +dotnet_diagnostic.S1994.severity = none # "for" loop increment clauses should modify the loops' counters — covered by SST2411 +dotnet_diagnostic.S2197.severity = none # Modulus results should not be checked for direct equality — covered by SST2416 +dotnet_diagnostic.S2198.severity = none # Unnecessary mathematical comparisons should not be made -> replaced by SST2489 +dotnet_diagnostic.S2223.severity = none # Non-constant static fields should not be visible - DUPLICATE CA2211 +dotnet_diagnostic.S2290.severity = none # Field-like events should not be virtual -> replaced by SST2456 +dotnet_diagnostic.S2291.severity = none # Overflow checking should not be disabled for "Enumerable.Sum" — covered by SST2457 +dotnet_diagnostic.S2302.severity = none # "nameof" should be used — covered by SST1415 +dotnet_diagnostic.S2330.severity = none # Array covariance should not be used — covered by SST2434 +dotnet_diagnostic.S2339.severity = none # Public constant members should not be used — covered by SST2311 +dotnet_diagnostic.S2346.severity = none # Flags enumerations zero-value members should be named "None" - DUPLICATE CA1008 +dotnet_diagnostic.S2360.severity = none # Optional parameters should not be used — conflicts with SST2433, which owns caller-info parameters requiring a default +dotnet_diagnostic.S2365.severity = none # Properties should not make collection or array copies — covered by PSH1017 +dotnet_diagnostic.S2479.severity = none # Whitespace and control characters in string literals should be explicit — covered by SST1192 +dotnet_diagnostic.S2692.severity = none # "IndexOf" checks should not be for positive numbers — covered by SST2420 +dotnet_diagnostic.S2696.severity = none # Instance members should not write to "static" fields -> replaced by SST2402 +dotnet_diagnostic.S2701.severity = none # Literal boolean values should not be used in assertions — covered by SST2503 +dotnet_diagnostic.S3215.severity = none # "interface" instances should not be cast to concrete types -> deliberately unenforced, same reason as SST2326 +dotnet_diagnostic.S3216.severity = none # "ConfigureAwait(false)" should be used -> replaced by CA2007 +dotnet_diagnostic.S3217.severity = none # "Explicit" conversions of "foreach" loops should not be used — covered by SST2225 +dotnet_diagnostic.S3218.severity = none # Inner class members should not shadow outer class "static" or type members — covered by SST1484 +dotnet_diagnostic.S3265.severity = none # Non-flags enums should not be used in bitwise operations — covered by SST2458 +dotnet_diagnostic.S3353.severity = none # Unchanged variables should be marked as "const" — covered by PSH1402 +dotnet_diagnostic.S3447.severity = none # "[Optional]" should not be used on "ref" or "out" parameters — covered by SST2459 +dotnet_diagnostic.S3451.severity = none # "[DefaultValue]" should not be used when "[DefaultParameterValue]" is meant — covered by SST2460 +dotnet_diagnostic.S3600.severity = none # "params" should not be introduced on overrides — covered by SST2426 +dotnet_diagnostic.S3776.severity = none # Cognitive Complexity of methods should not be too high - covered by SST1443 +dotnet_diagnostic.S3871.severity = none # Exception types should be "public" -> replaced by CA1064 +dotnet_diagnostic.S3874.severity = none # "out" and "ref" parameters — repo idiom is TryX(..., out T value) +dotnet_diagnostic.S3904.severity = none # Assemblies should have version information -> replaced by obsolete (SDK supplies assembly version) +dotnet_diagnostic.S3937.severity = none # Number patterns should be regular — covered by SST1119 +dotnet_diagnostic.S3972.severity = none # Conditionals should start on new lines — covered by SST1146 +dotnet_diagnostic.S3973.severity = none # A conditionally executed single line should be denoted by indentation -> replaced by SST1503 +dotnet_diagnostic.S3998.severity = none # Threads should not lock on objects with weak identity -> replaced by SST1902 +dotnet_diagnostic.S4000.severity = none # Pointers to unmanaged memory should not be visible -> replaced by SST2328 +dotnet_diagnostic.S4015.severity = none # Inherited member visibility should not be decreased — covered by SST2462 +dotnet_diagnostic.S4019.severity = none # Base class methods should not be hidden — covered by SST2427 +dotnet_diagnostic.S4025.severity = none # Child class fields should not differ from parent class fields only by capitalization — covered by SST2463 +dotnet_diagnostic.S4039.severity = none # Interface methods should be callable by derived types - DUPLICATE CA1033 +dotnet_diagnostic.S4487.severity = none # Unread "private" fields should be removed +dotnet_diagnostic.S4524.severity = none # "default" clauses should be first or last — covered by SST1219 +dotnet_diagnostic.S4635.severity = none # Start index should be used instead of calling Substring — covered by PSH1218 +dotnet_diagnostic.S5034.severity = none # "ValueTask" should be consumed correctly — covered by PSH1316 +dotnet_diagnostic.S6967.severity = none # ModelState.IsValid should be called in controller actions -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S8367.severity = none # Identifiers should not conflict with the C# 14 "field" contextual keyword - the C# 14 compiler reports this: CS9273 (error) for a local named field in an accessor, CS9258 (warning) for a rebinding read +dotnet_diagnostic.S8368.severity = none # Identifiers should not conflict with the C# 14 "extension" contextual keyword - the C# 14 compiler reports this as CS9306, and SST1300 already flags the lowercase type name +dotnet_diagnostic.S8380.severity = none # Return types named "partial" should be escaped with "@" - the compiler reports this as CS8981, and SST1300 already flags the lowercase type name +dotnet_diagnostic.S8381.severity = none # "scoped" should be escaped when used as an identifier or type name in parenthesized lambda parameter lists -> replaced by compiler +dotnet_diagnostic.S927.severity = none # Parameter names should match base declaration and other partial definitions - DUPLICATE CA1725 # Major code smells -dotnet_diagnostic.S103.severity = error # Lines should not be too long — covered by SST1521 -dotnet_diagnostic.S104.severity = error # Files should not have too many lines of code — covered by SST1522 -dotnet_diagnostic.S106.severity = error # Covered by SST1449 (canonical) -dotnet_diagnostic.S1066.severity = error # Mergeable "if" statements should be combined — covered by SST2013 -dotnet_diagnostic.S107.severity = error # Methods should not have too many parameters — covered by SST1472 -dotnet_diagnostic.S108.severity = error # Nested blocks of code should not be left empty — covered by SST1439 -dotnet_diagnostic.S109.severity = error # Magic numbers should not be used — covered by SST1471 -dotnet_diagnostic.S110.severity = error # Inheritance tree of classes should not be too deep — covered by SST1446 -dotnet_diagnostic.S1110.severity = error # Redundant pairs of parentheses should be removed — covered by SST1459 -dotnet_diagnostic.S1117.severity = error # Local variables should not shadow class fields or properties — covered by SST1484 -dotnet_diagnostic.S1118.severity = error # Utility classes should not have public constructors - DUPLICATE CA1052 -dotnet_diagnostic.S112.severity = error # General or reserved exceptions should never be thrown — covered by SST2409 -dotnet_diagnostic.S1121.severity = error # Assignments should not be made from within sub-expressions — covered by SST1187 -dotnet_diagnostic.S1123.severity = error # "Obsolete" attributes should include explanations — covered by SST2308 -dotnet_diagnostic.S1134.severity = error # Track uses of "FIXME" tags -> off: TODO comment tracker; not enforced here -dotnet_diagnostic.S1144.severity = error # Covered by SST1440 (canonical) -dotnet_diagnostic.S1151.severity = error # "switch case" clauses should not have too many lines of code — covered by SST1524 -dotnet_diagnostic.S1168.severity = error # Empty arrays and collections should be returned instead of null — covered by SST2306 -dotnet_diagnostic.S1172.severity = error # Unused method parameters should be removed — covered by SST1461 -dotnet_diagnostic.S1200.severity = error # Classes should not be coupled to too many other classes -dotnet_diagnostic.S122.severity = error # Statements should be on separate lines — covered by SST1107 -dotnet_diagnostic.S125.severity = error # Sections of code should not be commented out — covered by SST1148 -dotnet_diagnostic.S127.severity = error # "for" loop stop conditions should be invariant — covered by SST2465 -dotnet_diagnostic.S138.severity = error # Functions should not have too many lines of code — covered by SST1523 -dotnet_diagnostic.S1479.severity = error # "switch" statements with many "case" clauses — covered by SST1423 -dotnet_diagnostic.S1607.severity = error # Tests should not be ignored -> off: ignored-test tracker; not enforced here -dotnet_diagnostic.S1696.severity = error # NullReferenceException should not be caught — covered by SST2401 -dotnet_diagnostic.S1854.severity = error # Unused assignments should be removed - DUPLICATE IDE0059 -dotnet_diagnostic.S1871.severity = error # Two branches in a conditional structure should not have exactly the same implementation — covered by SST2414 -dotnet_diagnostic.S2139.severity = error # Exceptions should be either logged or rethrown but not both -> replaced by SST2488 -dotnet_diagnostic.S2166.severity = error # Classes named like "Exception" should extend "Exception" or a subclass - DUPLICATE CA1710 -dotnet_diagnostic.S2234.severity = error # Arguments should be passed in the same order as the method parameters -> replaced by SST2400 -dotnet_diagnostic.S2326.severity = error # Covered by SST1452 (canonical) -dotnet_diagnostic.S2327.severity = error # "try" statements with identical "catch" and/or "finally" blocks should be merged -> replaced by SST2490 -dotnet_diagnostic.S2357.severity = error # Fields should be private — duplicate of SST1401 (canonical); fields intentionally exposed (e.g. public test fields for reflection) already carry per-site SST1401 suppressions -dotnet_diagnostic.S2372.severity = error # Exceptions should not be thrown from property getters — covered by SST1485 -dotnet_diagnostic.S2376.severity = error # Write-only properties should not be used — covered by SST1421 -dotnet_diagnostic.S2629.severity = error # Logging templates should be constant -> replaced by CA2254 -dotnet_diagnostic.S2681.severity = error # Multiline blocks should be enclosed in curly braces — covered by SST1503 -dotnet_diagnostic.S2743.severity = error # Static fields should not be used in generic types - DUPLICATE CA1000 — covered by SST1431 -dotnet_diagnostic.S2925.severity = error # "Thread.Sleep" should not be used in tests — covered by SST2506 -dotnet_diagnostic.S2933.severity = error # Fields that are only assigned in the constructor should be "readonly" - DUPLICATE IDE0044 -dotnet_diagnostic.S2971.severity = error # LINQ expressions should be simplified — covered by PSH1101/PSH1102 -dotnet_diagnostic.S3010.severity = error # Static fields should not be updated in constructors — covered by SST2402 -dotnet_diagnostic.S3011.severity = error # Reflection should not be used to increase accessibility of classes, methods, or fields -> replaced by SES1406 -dotnet_diagnostic.S3059.severity = error # Types should not have members with visibility set higher than the type's visibility -dotnet_diagnostic.S3063.severity = error # "StringBuilder" data should be used — covered by SST2408 -dotnet_diagnostic.S3169.severity = error # Multiple "OrderBy" calls should not be used — covered by PSH1108 -dotnet_diagnostic.S3246.severity = error # Generic type parameters should be co/contravariant when possible -> off: low-precision variance suggestion; not enforced -dotnet_diagnostic.S3262.severity = error # "params" should be used on overrides — covered by SST2426 -dotnet_diagnostic.S3264.severity = error # Events should be invoked — covered by SST2407 -dotnet_diagnostic.S3358.severity = error # Ternary operators should not be nested — covered by SST1147 -dotnet_diagnostic.S3366.severity = error # "this" should not be exposed from constructors — covered by SST2403 -dotnet_diagnostic.S3415.severity = error # Assertion arguments should be passed in the correct order — covered by SST2502 -dotnet_diagnostic.S3431.severity = error # "[ExpectedException]" should not be used — covered by SST2507 -dotnet_diagnostic.S3442.severity = error # "abstract" classes should not have "public" constructors — covered by SST1428 -dotnet_diagnostic.S3445.severity = error # Exceptions should not be explicitly rethrown — covered by SST1430 -dotnet_diagnostic.S3457.severity = error # Composite format strings should be used correctly — covered by SST1454 -dotnet_diagnostic.S3597.severity = error # "ServiceContract" and "OperationContract" attributes should be used together -> replaced by obsolete (WCF) -dotnet_diagnostic.S3880.severity = error # Finalizers should not be empty — covered by PSH1002 -dotnet_diagnostic.S3881.severity = error # "IDisposable" should be implemented correctly — covered by SST2300 -dotnet_diagnostic.S3885.severity = error # "Assembly.Load" should be used -> replaced by SST2486 -dotnet_diagnostic.S3898.severity = error # Covered by PSH1005 (canonical) -dotnet_diagnostic.S3902.severity = error # Covered by PSH1404 (canonical) -dotnet_diagnostic.S3906.severity = error # Event Handlers should have the correct signature — covered by SST2304 -dotnet_diagnostic.S3908.severity = error # Generic event handlers should be used -> replaced by SST2304 -dotnet_diagnostic.S3909.severity = error # Collections should implement the generic interface -> replaced by CA1010 -dotnet_diagnostic.S3925.severity = error # "ISerializable" should be implemented correctly - BinaryFormatter / ISerializable serialization is obsoleted (SYSLIB0050/0051) in modern .NET; we do not opt into legacy serialization for any exception type -dotnet_diagnostic.S3928.severity = error # Parameter names used into ArgumentException constructors should match an existing one - DUPLICATE CA2208 -dotnet_diagnostic.S3956.severity = error # "Generic.List" instances should not be part of public APIs -dotnet_diagnostic.S3971.severity = error # "GC.SuppressFinalize" should not be called — conflicts with PSH1008, which owns the pointless-SuppressFinalize direction and exempts unsealed types -dotnet_diagnostic.S3990.severity = error # Assemblies should be marked as CLS compliant -> replaced by CA1014 -dotnet_diagnostic.S3992.severity = error # Assemblies should explicitly specify COM visibility -> replaced by CA1017 -dotnet_diagnostic.S3993.severity = error # Custom attributes should be marked with "System.AttributeUsageAttribute" -> replaced by CA1018 -dotnet_diagnostic.S3994.severity = error # URI Parameters should not be strings -dotnet_diagnostic.S3995.severity = error # URI return values should not be strings -dotnet_diagnostic.S3996.severity = error # URI properties should not be strings -dotnet_diagnostic.S3997.severity = error # String URI overloads should call "System.Uri" overloads -> replaced by CA1054/CA1056/CA1057 -dotnet_diagnostic.S4002.severity = error # Disposable types should declare finalizers — covered by SST2317 -dotnet_diagnostic.S4004.severity = error # Collection properties should be readonly — covered by SST2305 -dotnet_diagnostic.S4005.severity = error # "System.Uri" arguments should be used instead of strings -dotnet_diagnostic.S4016.severity = error # Enumeration members should not be named "Reserved" -> replaced by CA1700 -dotnet_diagnostic.S4017.severity = error # Method signatures should not contain nested generic types -dotnet_diagnostic.S4035.severity = error # Classes implementing "IEquatable" should be sealed — covered by SST2301 -dotnet_diagnostic.S4050.severity = error # Operators should be overloaded consistently — covered by SST2302 -dotnet_diagnostic.S4055.severity = error # Literals should not be passed as localized parameters -dotnet_diagnostic.S4057.severity = error # Locales should be set for data types -> replaced by obsolete -dotnet_diagnostic.S4059.severity = error # Property names should not match get methods - DUPLICATE CA1721 -dotnet_diagnostic.S4070.severity = error # Non-flags enums should not be marked with "FlagsAttribute" — covered by SST2303 -dotnet_diagnostic.S4144.severity = error # Methods should not have identical implementations — covered by SST2318 -dotnet_diagnostic.S4200.severity = error # Native methods should be wrapped -> replaced by CA1401 -dotnet_diagnostic.S4214.severity = error # "P/Invoke" methods should not be visible - DUPLICATE CA1401 -dotnet_diagnostic.S4220.severity = error # Events should have proper arguments — covered by SST2436 -dotnet_diagnostic.S4456.severity = error # Parameter validation in yielding methods should be wrapped — covered by SST2404 -dotnet_diagnostic.S4457.severity = error # Parameter validation in "async"/"await" methods should be wrapped — covered by SST2325 -dotnet_diagnostic.S4545.severity = error # "DebuggerDisplayAttribute" strings should reference existing members — covered by SST2405 -dotnet_diagnostic.S4581.severity = error # "new Guid()" should not be used — covered by SST2012 -dotnet_diagnostic.S6354.severity = error # Use a testable date/time provider — covered by SST2010 -dotnet_diagnostic.S6419.severity = error # Azure Functions should be stateless -> off: Azure Functions-specific; not used in this library -dotnet_diagnostic.S6420.severity = error # Client instances should not be recreated on each Azure Function invocation — covered by PSH1418 -dotnet_diagnostic.S6421.severity = error # Azure Functions should use Structured Error Handling -> off: Azure Functions-specific; not used in this library -dotnet_diagnostic.S6423.severity = error # Azure Functions should log all failures -> off: Azure Functions-specific; not used in this library -dotnet_diagnostic.S6561.severity = error # Avoid using "DateTime.Now" for benchmarking or timing operations — covered by PSH1408 -dotnet_diagnostic.S6562.severity = error # Covered by SST1451 (canonical) -dotnet_diagnostic.S6563.severity = error # Use UTC when recording DateTime instants — covered by SST2011 -dotnet_diagnostic.S6566.severity = error # Use "DateTimeOffset" instead of "DateTime" — covered by SST2016 -dotnet_diagnostic.S6575.severity = error # Use "TimeZoneInfo.FindSystemTimeZoneById" without converting the timezones with "TimezoneConverter" -> replaced by PSH1419 -dotnet_diagnostic.S6580.severity = error # Use a format provider when parsing date and time - DUPLICATE CA1305 -dotnet_diagnostic.S6673.severity = error # Log message template placeholders should be in the right order — covered by SST2440 -dotnet_diagnostic.S6802.severity = error # Using lambda expressions in loops should be avoided in Blazor markup section -> replaced by PSH1600 -dotnet_diagnostic.S6803.severity = error # Parameters with SupplyParameterFromQuery attribute should be used only in routable components -> off: Blazor-specific; no Blazor surface in this library -dotnet_diagnostic.S6931.severity = error # ASP.NET controller actions should not have a route template starting with "/" -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6932.severity = error # Use model binding instead of reading raw request data -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6934.severity = error # A Route attribute should be added to the controller when a route template is specified at the action level -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6960.severity = error # Controllers should not have mixed responsibilities -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6961.severity = error # API Controllers should derive from ControllerBase instead of Controller -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S6962.severity = error # You should pool HTTP connections with HttpClientFactory — covered by PSH1418 -dotnet_diagnostic.S6964.severity = error # Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting. -> replaced by SST2705 (opt-in) -dotnet_diagnostic.S6965.severity = error # REST API actions should be annotated with an HTTP verb attribute -> replaced by SST2704 -dotnet_diagnostic.S6966.severity = error # Awaitable method should be used — covered by PSH1313 -dotnet_diagnostic.S6968.severity = error # Actions that return a value should be annotated with ProducesResponseTypeAttribute containing the return type -> off: ASP.NET MVC-specific; no controllers in this library -dotnet_diagnostic.S881.severity = error # Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression — covered by SST2015 -dotnet_diagnostic.S907.severity = error # "goto" statement should not be used — covered by SST2014 +dotnet_diagnostic.S103.severity = none # Lines should not be too long — covered by SST1521 +dotnet_diagnostic.S104.severity = none # Files should not have too many lines of code — covered by SST1522 +dotnet_diagnostic.S106.severity = none # Covered by SST1449 (canonical) +dotnet_diagnostic.S1066.severity = none # Mergeable "if" statements should be combined — covered by SST2013 +dotnet_diagnostic.S107.severity = none # Methods should not have too many parameters — covered by SST1472 +dotnet_diagnostic.S108.severity = none # Nested blocks of code should not be left empty — covered by SST1439 +dotnet_diagnostic.S109.severity = none # Magic numbers should not be used — covered by SST1471 +dotnet_diagnostic.S110.severity = none # Inheritance tree of classes should not be too deep — covered by SST1446 +dotnet_diagnostic.S1110.severity = none # Redundant pairs of parentheses should be removed — covered by SST1459 +dotnet_diagnostic.S1117.severity = none # Local variables should not shadow class fields or properties — covered by SST1484 +dotnet_diagnostic.S1118.severity = none # Utility classes should not have public constructors - DUPLICATE CA1052 +dotnet_diagnostic.S112.severity = none # General or reserved exceptions should never be thrown — covered by SST2409 +dotnet_diagnostic.S1121.severity = none # Assignments should not be made from within sub-expressions — covered by SST1187 +dotnet_diagnostic.S1123.severity = none # "Obsolete" attributes should include explanations — covered by SST2308 +dotnet_diagnostic.S1134.severity = none # Track uses of "FIXME" tags -> off: TODO comment tracker; not enforced here +dotnet_diagnostic.S1144.severity = none # Covered by SST1440 (canonical) +dotnet_diagnostic.S1151.severity = none # "switch case" clauses should not have too many lines of code — covered by SST1524 +dotnet_diagnostic.S1168.severity = none # Empty arrays and collections should be returned instead of null — covered by SST2306 +dotnet_diagnostic.S1172.severity = none # Unused method parameters should be removed — covered by SST1461 +dotnet_diagnostic.S1200.severity = none # Classes should not be coupled to too many other classes +dotnet_diagnostic.S122.severity = none # Statements should be on separate lines — covered by SST1107 +dotnet_diagnostic.S125.severity = none # Sections of code should not be commented out — covered by SST1148 +dotnet_diagnostic.S127.severity = none # "for" loop stop conditions should be invariant — covered by SST2465 +dotnet_diagnostic.S138.severity = none # Functions should not have too many lines of code — covered by SST1523 +dotnet_diagnostic.S1479.severity = none # "switch" statements with many "case" clauses — covered by SST1423 +dotnet_diagnostic.S1607.severity = none # Tests should not be ignored -> off: ignored-test tracker; not enforced here +dotnet_diagnostic.S1696.severity = none # NullReferenceException should not be caught — covered by SST2401 +dotnet_diagnostic.S1854.severity = none # Unused assignments should be removed - DUPLICATE IDE0059 +dotnet_diagnostic.S1871.severity = none # Two branches in a conditional structure should not have exactly the same implementation — covered by SST2414 +dotnet_diagnostic.S2139.severity = none # Exceptions should be either logged or rethrown but not both -> replaced by SST2488 +dotnet_diagnostic.S2166.severity = none # Classes named like "Exception" should extend "Exception" or a subclass - DUPLICATE CA1710 +dotnet_diagnostic.S2234.severity = none # Arguments should be passed in the same order as the method parameters -> replaced by SST2400 +dotnet_diagnostic.S2326.severity = none # Covered by SST1452 (canonical) +dotnet_diagnostic.S2327.severity = none # "try" statements with identical "catch" and/or "finally" blocks should be merged -> replaced by SST2490 +dotnet_diagnostic.S2357.severity = none # Fields should be private — duplicate of SST1401 (canonical); fields intentionally exposed (e.g. public test fields for reflection) already carry per-site SST1401 suppressions +dotnet_diagnostic.S2372.severity = none # Exceptions should not be thrown from property getters — covered by SST1485 +dotnet_diagnostic.S2376.severity = none # Write-only properties should not be used — covered by SST1421 +dotnet_diagnostic.S2629.severity = none # Logging templates should be constant -> replaced by CA2254 +dotnet_diagnostic.S2681.severity = none # Multiline blocks should be enclosed in curly braces — covered by SST1503 +dotnet_diagnostic.S2743.severity = none # Static fields should not be used in generic types - DUPLICATE CA1000 — covered by SST1431 +dotnet_diagnostic.S2925.severity = none # "Thread.Sleep" should not be used in tests — covered by SST2506 +dotnet_diagnostic.S2933.severity = none # Fields that are only assigned in the constructor should be "readonly" - DUPLICATE IDE0044 +dotnet_diagnostic.S2971.severity = none # LINQ expressions should be simplified — covered by PSH1101/PSH1102 +dotnet_diagnostic.S3010.severity = none # Static fields should not be updated in constructors — covered by SST2402 +dotnet_diagnostic.S3011.severity = none # Reflection should not be used to increase accessibility of classes, methods, or fields -> replaced by SES1406 +dotnet_diagnostic.S3059.severity = none # Types should not have members with visibility set higher than the type's visibility +dotnet_diagnostic.S3063.severity = none # "StringBuilder" data should be used — covered by SST2408 +dotnet_diagnostic.S3169.severity = none # Multiple "OrderBy" calls should not be used — covered by PSH1108 +dotnet_diagnostic.S3246.severity = none # Generic type parameters should be co/contravariant when possible -> off: low-precision variance suggestion; not enforced +dotnet_diagnostic.S3262.severity = none # "params" should be used on overrides — covered by SST2426 +dotnet_diagnostic.S3264.severity = none # Events should be invoked — covered by SST2407 +dotnet_diagnostic.S3358.severity = none # Ternary operators should not be nested — covered by SST1147 +dotnet_diagnostic.S3366.severity = none # "this" should not be exposed from constructors — covered by SST2403 +dotnet_diagnostic.S3415.severity = none # Assertion arguments should be passed in the correct order — covered by SST2502 +dotnet_diagnostic.S3431.severity = none # "[ExpectedException]" should not be used — covered by SST2507 +dotnet_diagnostic.S3442.severity = none # "abstract" classes should not have "public" constructors — covered by SST1428 +dotnet_diagnostic.S3445.severity = none # Exceptions should not be explicitly rethrown — covered by SST1430 +dotnet_diagnostic.S3457.severity = none # Composite format strings should be used correctly — covered by SST1454 +dotnet_diagnostic.S3597.severity = none # "ServiceContract" and "OperationContract" attributes should be used together -> replaced by obsolete (WCF) +dotnet_diagnostic.S3880.severity = none # Finalizers should not be empty — covered by PSH1002 +dotnet_diagnostic.S3881.severity = none # "IDisposable" should be implemented correctly — covered by SST2300 +dotnet_diagnostic.S3885.severity = none # "Assembly.Load" should be used -> replaced by SST2486 +dotnet_diagnostic.S3898.severity = none # Covered by PSH1005 (canonical) +dotnet_diagnostic.S3902.severity = none # Covered by PSH1404 (canonical) +dotnet_diagnostic.S3906.severity = none # Event Handlers should have the correct signature — covered by SST2304 +dotnet_diagnostic.S3908.severity = none # Generic event handlers should be used -> replaced by SST2304 +dotnet_diagnostic.S3909.severity = none # Collections should implement the generic interface -> replaced by CA1010 +dotnet_diagnostic.S3925.severity = none # "ISerializable" should be implemented correctly - BinaryFormatter / ISerializable serialization is obsoleted (SYSLIB0050/0051) in modern .NET; we do not opt into legacy serialization for any exception type +dotnet_diagnostic.S3928.severity = none # Parameter names used into ArgumentException constructors should match an existing one - DUPLICATE CA2208 +dotnet_diagnostic.S3956.severity = none # "Generic.List" instances should not be part of public APIs +dotnet_diagnostic.S3971.severity = none # "GC.SuppressFinalize" should not be called — conflicts with PSH1008, which owns the pointless-SuppressFinalize direction and exempts unsealed types +dotnet_diagnostic.S3990.severity = none # Assemblies should be marked as CLS compliant -> replaced by CA1014 +dotnet_diagnostic.S3992.severity = none # Assemblies should explicitly specify COM visibility -> replaced by CA1017 +dotnet_diagnostic.S3993.severity = none # Custom attributes should be marked with "System.AttributeUsageAttribute" -> replaced by CA1018 +dotnet_diagnostic.S3994.severity = none # URI Parameters should not be strings +dotnet_diagnostic.S3995.severity = none # URI return values should not be strings +dotnet_diagnostic.S3996.severity = none # URI properties should not be strings +dotnet_diagnostic.S3997.severity = none # String URI overloads should call "System.Uri" overloads -> replaced by CA1054/CA1056/CA1057 +dotnet_diagnostic.S4002.severity = none # Disposable types should declare finalizers — covered by SST2317 +dotnet_diagnostic.S4004.severity = none # Collection properties should be readonly — covered by SST2305 +dotnet_diagnostic.S4005.severity = none # "System.Uri" arguments should be used instead of strings +dotnet_diagnostic.S4016.severity = none # Enumeration members should not be named "Reserved" -> replaced by CA1700 +dotnet_diagnostic.S4017.severity = none # Method signatures should not contain nested generic types +dotnet_diagnostic.S4035.severity = none # Classes implementing "IEquatable" should be sealed — covered by SST2301 +dotnet_diagnostic.S4050.severity = none # Operators should be overloaded consistently — covered by SST2302 +dotnet_diagnostic.S4055.severity = none # Literals should not be passed as localized parameters +dotnet_diagnostic.S4057.severity = none # Locales should be set for data types -> replaced by obsolete +dotnet_diagnostic.S4059.severity = none # Property names should not match get methods - DUPLICATE CA1721 +dotnet_diagnostic.S4070.severity = none # Non-flags enums should not be marked with "FlagsAttribute" — covered by SST2303 +dotnet_diagnostic.S4144.severity = none # Methods should not have identical implementations — covered by SST2318 +dotnet_diagnostic.S4200.severity = none # Native methods should be wrapped -> replaced by CA1401 +dotnet_diagnostic.S4214.severity = none # "P/Invoke" methods should not be visible - DUPLICATE CA1401 +dotnet_diagnostic.S4220.severity = none # Events should have proper arguments — covered by SST2436 +dotnet_diagnostic.S4456.severity = none # Parameter validation in yielding methods should be wrapped — covered by SST2404 +dotnet_diagnostic.S4457.severity = none # Parameter validation in "async"/"await" methods should be wrapped — covered by SST2325 +dotnet_diagnostic.S4545.severity = none # "DebuggerDisplayAttribute" strings should reference existing members — covered by SST2405 +dotnet_diagnostic.S4581.severity = none # "new Guid()" should not be used — covered by SST2012 +dotnet_diagnostic.S6354.severity = none # Use a testable date/time provider — covered by SST2010 +dotnet_diagnostic.S6419.severity = none # Azure Functions should be stateless -> off: Azure Functions-specific; not used in this library +dotnet_diagnostic.S6420.severity = none # Client instances should not be recreated on each Azure Function invocation — covered by PSH1418 +dotnet_diagnostic.S6421.severity = none # Azure Functions should use Structured Error Handling -> off: Azure Functions-specific; not used in this library +dotnet_diagnostic.S6423.severity = none # Azure Functions should log all failures -> off: Azure Functions-specific; not used in this library +dotnet_diagnostic.S6561.severity = none # Avoid using "DateTime.Now" for benchmarking or timing operations — covered by PSH1408 +dotnet_diagnostic.S6562.severity = none # Covered by SST1451 (canonical) +dotnet_diagnostic.S6563.severity = none # Use UTC when recording DateTime instants — covered by SST2011 +dotnet_diagnostic.S6566.severity = none # Use "DateTimeOffset" instead of "DateTime" — covered by SST2016 +dotnet_diagnostic.S6575.severity = none # Use "TimeZoneInfo.FindSystemTimeZoneById" without converting the timezones with "TimezoneConverter" -> replaced by PSH1419 +dotnet_diagnostic.S6580.severity = none # Use a format provider when parsing date and time - DUPLICATE CA1305 +dotnet_diagnostic.S6673.severity = none # Log message template placeholders should be in the right order — covered by SST2440 +dotnet_diagnostic.S6802.severity = none # Using lambda expressions in loops should be avoided in Blazor markup section -> replaced by PSH1600 +dotnet_diagnostic.S6803.severity = none # Parameters with SupplyParameterFromQuery attribute should be used only in routable components -> off: Blazor-specific; no Blazor surface in this library +dotnet_diagnostic.S6931.severity = none # ASP.NET controller actions should not have a route template starting with "/" -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6932.severity = none # Use model binding instead of reading raw request data -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6934.severity = none # A Route attribute should be added to the controller when a route template is specified at the action level -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6960.severity = none # Controllers should not have mixed responsibilities -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6961.severity = none # API Controllers should derive from ControllerBase instead of Controller -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S6962.severity = none # You should pool HTTP connections with HttpClientFactory — covered by PSH1418 +dotnet_diagnostic.S6964.severity = none # Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting. -> replaced by SST2705 (opt-in) +dotnet_diagnostic.S6965.severity = none # REST API actions should be annotated with an HTTP verb attribute -> replaced by SST2704 +dotnet_diagnostic.S6966.severity = none # Awaitable method should be used — covered by PSH1313 +dotnet_diagnostic.S6968.severity = none # Actions that return a value should be annotated with ProducesResponseTypeAttribute containing the return type -> off: ASP.NET MVC-specific; no controllers in this library +dotnet_diagnostic.S881.severity = none # Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression — covered by SST2015 +dotnet_diagnostic.S907.severity = none # "goto" statement should not be used — covered by SST2014 # Minor code smells -dotnet_diagnostic.S100.severity = error # Methods and properties should be named in PascalCase — covered by SST1300 -dotnet_diagnostic.S101.severity = error # Types should be named in PascalCase — covered by SST1300 -dotnet_diagnostic.S105.severity = error # Tabulation characters should not be used — covered by SST1027 -dotnet_diagnostic.S1104.severity = error # Fields should not have public accessibility - DUPLICATE CA1051 -dotnet_diagnostic.S1109.severity = error # A close curly brace should be located at the beginning of a line — covered by SST1500 -dotnet_diagnostic.S1116.severity = error # Empty statements should be removed - DUPLICATE SA1106 -dotnet_diagnostic.S1125.severity = error # Boolean literals should not be redundant — covered by SST1182 -dotnet_diagnostic.S1128.severity = error # Covered by SST1445 (canonical) -dotnet_diagnostic.S113.severity = error # Files should end with a newline -dotnet_diagnostic.S1155.severity = error # "Any()" should be used to test for emptiness — covered by PSH1119 -dotnet_diagnostic.S1185.severity = error # Overriding members should do more than simply call the same member in the base class - DUPLICATE RCS1132 -dotnet_diagnostic.S1192.severity = error # String literals should not be duplicated — covered by SST1486 -dotnet_diagnostic.S1199.severity = error # Nested code blocks should not be used — covered by SST1138 -dotnet_diagnostic.S1210.severity = error # "Equals" and the comparison operators should be overridden when implementing "IComparable" - DUPLICATE CA1036 -dotnet_diagnostic.S1227.severity = error # break statements should not be used except for switch cases -dotnet_diagnostic.S1264.severity = error # A "while" loop should be used instead of a "for" loop — covered by SST2245 -dotnet_diagnostic.S1301.severity = error # "switch" statements should have at least 3 "case" clauses -dotnet_diagnostic.S1312.severity = error # Logger fields should be "private static readonly" -dotnet_diagnostic.S1449.severity = error # Culture should be specified for "string" operations — covered by PSH1207 -dotnet_diagnostic.S1450.severity = error # Private fields only used as local variables in methods should become local variables — covered by SST1422 -dotnet_diagnostic.S1481.severity = error # Unused local variables should be removed — covered by SST1497 -dotnet_diagnostic.S1643.severity = error # Covered by PSH1206 (canonical) -dotnet_diagnostic.S1659.severity = error # Multiple variables should not be declared on the same line — covered by SST1132 -dotnet_diagnostic.S1694.severity = error # An abstract class should have both abstract and concrete methods — covered by SST2323 -dotnet_diagnostic.S1698.severity = error # "==" should not be used when "Equals" is overridden — covered by SST1495 -dotnet_diagnostic.S1858.severity = error # "ToString()" calls should not be redundant — covered by PSH1211 -dotnet_diagnostic.S1905.severity = error # Redundant casts should not be used - DUPLICATE IDE0004 — covered by SST1175 -dotnet_diagnostic.S1939.severity = error # Inheritance list should not be redundant — covered by SST1490 and SST1177 -dotnet_diagnostic.S1940.severity = error # Boolean checks should not be inverted — covered by SST1172 -dotnet_diagnostic.S2094.severity = error # Classes should not be empty — covered by SST1436 -dotnet_diagnostic.S2148.severity = error # Underscores should be used to make large numbers readable — covered by SST1191 -dotnet_diagnostic.S2156.severity = error # "sealed" classes should not have "protected" members — covered by SST1427 -dotnet_diagnostic.S2219.severity = error # Runtime type checking should be simplified — covered by SST2007 -dotnet_diagnostic.S2221.severity = error # "Exception" should not be caught -dotnet_diagnostic.S2292.severity = error # Trivial properties should be auto-implemented — covered by SST1420 -dotnet_diagnostic.S2325.severity = error # Methods and properties that don't access instance data should be static - DUPLICATE CA1822 -dotnet_diagnostic.S2333.severity = error # Redundant modifiers should not be used — covered by SST1419/SST1491 -dotnet_diagnostic.S2342.severity = error # Enumeration types should comply with a naming convention — covered by SST1319 -dotnet_diagnostic.S2344.severity = error # Enumeration type names should not have "Flags" or "Enum" suffixes - DUPLICATE CA1711 -dotnet_diagnostic.S2386.severity = error # Mutable fields should not be "public static" — covered by SST1499 -dotnet_diagnostic.S2486.severity = error # Generic exceptions should not be ignored — covered by SST1429 -dotnet_diagnostic.S2737.severity = error # "catch" clauses should do more than rethrow — covered by SST1470 -dotnet_diagnostic.S2760.severity = error # Sequential tests should not check the same condition — covered by SST1475 -dotnet_diagnostic.S3052.severity = error # Covered by PSH1403 (canonical) -dotnet_diagnostic.S3220.severity = error # Method calls should not resolve ambiguously to overloads with "params" — covered by SST2467 -dotnet_diagnostic.S3234.severity = error # Covered by PSH1008 (canonical) -dotnet_diagnostic.S3235.severity = error # Redundant parentheses should not be used — covered by SST1459 -dotnet_diagnostic.S3236.severity = error # Covered by SST1448 (canonical) -dotnet_diagnostic.S3240.severity = error # The simplest possible condition syntax should be used - duplicate of SST1198 -dotnet_diagnostic.S3241.severity = error # Methods should not return values that are never used -> off: needs whole-program analysis; not enforced here -dotnet_diagnostic.S3242.severity = error # Method parameters should be declared with base types -dotnet_diagnostic.S3247.severity = error # Duplicate casts should not be made — covered by SST1175 -dotnet_diagnostic.S3251.severity = error # Implementations should be provided for "partial" methods — covered by SST2468 -dotnet_diagnostic.S3253.severity = error # Constructor and destructor declarations should not be redundant — covered by SST1433 -dotnet_diagnostic.S3254.severity = error # Default parameter values should not be passed as arguments — covered by SST1494 -dotnet_diagnostic.S3256.severity = error # "string.IsNullOrEmpty" should be used — covered by PSH1204 (style configurable) -dotnet_diagnostic.S3257.severity = error # Declarations and initializations should be as concise as possible -> replaced by SST2202 -dotnet_diagnostic.S3260.severity = error # Non-derived "private" classes and records should be "sealed" — covered by PSH1411 -dotnet_diagnostic.S3261.severity = error # Namespaces should not be empty — covered by SST1435 -dotnet_diagnostic.S3267.severity = error # Loops should be simplified with "LINQ" expressions -dotnet_diagnostic.S3376.severity = error # Attribute, EventArgs, and Exception type names should end with the type being extended - DUPLICATE CA1710 -dotnet_diagnostic.S3398.severity = error # "private" methods called only by inner classes should be moved to those classes — covered by SST1498 -dotnet_diagnostic.S3400.severity = error # Methods should not return constants — covered by SST1493 -dotnet_diagnostic.S3416.severity = error # Loggers should be named for their enclosing types — covered by SST2443 -dotnet_diagnostic.S3440.severity = error # Variables should not be checked against the values they're about to be assigned — covered by SST1492 -dotnet_diagnostic.S3441.severity = error # Redundant property names should be omitted in anonymous classes — covered by SST1173 -dotnet_diagnostic.S3444.severity = error # Interfaces should not simply inherit from base interfaces with colliding members — covered by SST2320 -dotnet_diagnostic.S3450.severity = error # Parameters with "[DefaultParameterValue]" attributes should also be marked "[Optional]" -> replaced by obsolete (legacy DefaultParameterValue) -dotnet_diagnostic.S3458.severity = error # Empty "case" clauses that fall through to the "default" should be omitted — covered by SST1466 -dotnet_diagnostic.S3459.severity = error # Unassigned members should be removed - the compiler reports this as CS0649; the rule only ever fires on private never-assigned fields -dotnet_diagnostic.S3532.severity = error # Empty "default" clauses should be removed — covered by SST1179 -dotnet_diagnostic.S3604.severity = error # Member initializer values should not be redundant — covered by PSH1403 -dotnet_diagnostic.S3626.severity = error # Jump statements should not be redundant — covered by SST1174 -dotnet_diagnostic.S3717.severity = error # Track use of "NotImplementedException" -> replaced by SST2485 -dotnet_diagnostic.S3872.severity = error # Parameter names should not duplicate the names of their methods -> replaced by SST1320 -dotnet_diagnostic.S3876.severity = error # Strings or integral types should be used for indexers -> replaced by CA1043 -dotnet_diagnostic.S3878.severity = error # Arrays should not be created for params parameters — covered by PSH1018 -dotnet_diagnostic.S3897.severity = error # Classes that provide "Equals()" should implement "IEquatable" -> replaced by CA1067 -dotnet_diagnostic.S3962.severity = error # Covered by PSH1402 (canonical) -dotnet_diagnostic.S3963.severity = error # "static" fields should be initialized inline - DUPLICATE CA1810 -dotnet_diagnostic.S3967.severity = error # Multidimensional arrays should not be used - DUPLICATE CA1814 -dotnet_diagnostic.S4018.severity = error # All type parameters should be used in the parameter list to enable type inference — covered by SST2307 -dotnet_diagnostic.S4022.severity = error # Enumerations should have "Int32" storage — covered by SST2313 -dotnet_diagnostic.S4023.severity = error # Interfaces should not be empty — covered by SST1437 -dotnet_diagnostic.S4026.severity = error # Assemblies should be marked with "NeutralResourcesLanguageAttribute" -> replaced by CA1824 -dotnet_diagnostic.S4027.severity = error # Exceptions should provide standard constructors — covered by SST1488 -dotnet_diagnostic.S4040.severity = error # Strings should be normalized to uppercase - DUPLICATE CA1308 -dotnet_diagnostic.S4041.severity = error # Type names should not match namespaces - DUPLICATE CA1724 -dotnet_diagnostic.S4047.severity = error # Generics should be used when appropriate -> off: fuzzy prefer-generics suggestion; not enforced -dotnet_diagnostic.S4049.severity = error # Properties should be preferred - DUPLICATE CA1024 -dotnet_diagnostic.S4052.severity = error # Types should not extend outdated base types -> replaced by obsolete -dotnet_diagnostic.S4056.severity = error # Overloads with a "CultureInfo" or an "IFormatProvider" parameter should be used - DUPLICATE CA1305 -dotnet_diagnostic.S4058.severity = error # Covered by PSH1207 (canonical) -dotnet_diagnostic.S4060.severity = error # Non-abstract attributes should be sealed - DUPLICATE CA1813 -dotnet_diagnostic.S4061.severity = error # "params" should be used instead of "varargs" -> replaced by obsolete (__arglist varargs) -dotnet_diagnostic.S4069.severity = error # Operator overloads should have named alternatives - DUPLICATE CA2225 -dotnet_diagnostic.S4136.severity = error # Method overloads should be grouped together — covered by SST1218 -dotnet_diagnostic.S4201.severity = error # Null checks should not be combined with "is" operator checks — covered by SST2018 -dotnet_diagnostic.S4225.severity = error # Extension methods should not extend "object" — covered by SST1706 -dotnet_diagnostic.S4226.severity = error # Extensions should be in separate namespaces -dotnet_diagnostic.S4261.severity = error # Methods should be named according to their synchronicities - Async suffix not used -dotnet_diagnostic.S4663.severity = error # Covered by SST1120 (canonical) -dotnet_diagnostic.S6513.severity = error # "ExcludeFromCodeCoverage" attributes should include a justification - not available on net462 and older TFMs -dotnet_diagnostic.S6585.severity = error # Don't hardcode the format when turning dates and times to strings — covered by SST2445 -dotnet_diagnostic.S6588.severity = error # Use the "UnixEpoch" field instead of creating "DateTime" instances that point to the beginning of the Unix epoch — covered by PSH1413 -dotnet_diagnostic.S6594.severity = error # Covered by PSH1406 (canonical) -dotnet_diagnostic.S6602.severity = error # Covered by PSH1110 (canonical) -dotnet_diagnostic.S6603.severity = error # Covered by PSH1110 (canonical) -dotnet_diagnostic.S6605.severity = error # Covered by PSH1110 (canonical) -dotnet_diagnostic.S6607.severity = error # The collection should be filtered before sorting — covered by PSH1107 -dotnet_diagnostic.S6608.severity = error # Covered by PSH1106 (canonical) -dotnet_diagnostic.S6609.severity = error # "Min/Max" properties of "Set" types should be used instead of the "Enumerable" extension methods — covered by PSH1122 -dotnet_diagnostic.S6610.severity = error # Covered by PSH1201 (canonical) -dotnet_diagnostic.S6612.severity = error # The lambda parameter should be used instead of capturing arguments in "ConcurrentDictionary" methods — covered by PSH1006 -dotnet_diagnostic.S6613.severity = error # "First" and "Last" properties of "LinkedList" should be used instead of the "First()" and "Last()" extension methods — covered by PSH1124 -dotnet_diagnostic.S6617.severity = error # Covered by PSH1111 (canonical) -dotnet_diagnostic.S6618.severity = error # "string.Create" should be used instead of "FormattableString" — covered by PSH1209 -dotnet_diagnostic.S6664.severity = error # The code block contains too many logging calls -> off: fuzzy too-many-logging-calls metric; not enforced -dotnet_diagnostic.S6667.severity = error # Logging in a catch clause should pass the caught exception as a parameter. — covered by SST2438 -dotnet_diagnostic.S6668.severity = error # Logging arguments should be passed to the correct parameter — covered by SST2439 -dotnet_diagnostic.S6669.severity = error # Logger field or property name should comply with a naming convention -> replaced by SST2601 -dotnet_diagnostic.S6670.severity = error # "Trace.Write" and "Trace.WriteLine" should not be used — covered by SST2600 -dotnet_diagnostic.S6672.severity = error # Generic logger injection should match enclosing type — covered by SST2443 -dotnet_diagnostic.S6675.severity = error # "Trace.WriteLineIf" should not be used with "TraceSwitch" levels -> off: niche TraceSwitch misuse; not enforced here -dotnet_diagnostic.S6678.severity = error # Use PascalCase for named placeholders -> replaced by CA1727 -dotnet_diagnostic.S818.severity = error # Literal suffixes should be upper case — covered by SST2244 +dotnet_diagnostic.S100.severity = none # Methods and properties should be named in PascalCase — covered by SST1300 +dotnet_diagnostic.S101.severity = none # Types should be named in PascalCase — covered by SST1300 +dotnet_diagnostic.S105.severity = none # Tabulation characters should not be used — covered by SST1027 +dotnet_diagnostic.S1104.severity = none # Fields should not have public accessibility - DUPLICATE CA1051 +dotnet_diagnostic.S1109.severity = none # A close curly brace should be located at the beginning of a line — covered by SST1500 +dotnet_diagnostic.S1116.severity = none # Empty statements should be removed - DUPLICATE SA1106 +dotnet_diagnostic.S1125.severity = none # Boolean literals should not be redundant — covered by SST1182 +dotnet_diagnostic.S1128.severity = none # Covered by SST1445 (canonical) +dotnet_diagnostic.S113.severity = none # Files should end with a newline +dotnet_diagnostic.S1155.severity = none # "Any()" should be used to test for emptiness — covered by PSH1119 +dotnet_diagnostic.S1185.severity = none # Overriding members should do more than simply call the same member in the base class - DUPLICATE RCS1132 +dotnet_diagnostic.S1192.severity = none # String literals should not be duplicated — covered by SST1486 +dotnet_diagnostic.S1199.severity = none # Nested code blocks should not be used — covered by SST1138 +dotnet_diagnostic.S1210.severity = none # "Equals" and the comparison operators should be overridden when implementing "IComparable" - DUPLICATE CA1036 +dotnet_diagnostic.S1227.severity = none # break statements should not be used except for switch cases +dotnet_diagnostic.S1264.severity = none # A "while" loop should be used instead of a "for" loop — covered by SST2245 +dotnet_diagnostic.S1301.severity = none # "switch" statements should have at least 3 "case" clauses +dotnet_diagnostic.S1312.severity = none # Logger fields should be "private static readonly" +dotnet_diagnostic.S1449.severity = none # Culture should be specified for "string" operations — covered by PSH1207 +dotnet_diagnostic.S1450.severity = none # Private fields only used as local variables in methods should become local variables — covered by SST1422 +dotnet_diagnostic.S1481.severity = none # Unused local variables should be removed — covered by SST1497 +dotnet_diagnostic.S1643.severity = none # Covered by PSH1206 (canonical) +dotnet_diagnostic.S1659.severity = none # Multiple variables should not be declared on the same line — covered by SST1132 +dotnet_diagnostic.S1694.severity = none # An abstract class should have both abstract and concrete methods — covered by SST2323 +dotnet_diagnostic.S1698.severity = none # "==" should not be used when "Equals" is overridden — covered by SST1495 +dotnet_diagnostic.S1858.severity = none # "ToString()" calls should not be redundant — covered by PSH1211 +dotnet_diagnostic.S1905.severity = none # Redundant casts should not be used - DUPLICATE IDE0004 — covered by SST1175 +dotnet_diagnostic.S1939.severity = none # Inheritance list should not be redundant — covered by SST1490 and SST1177 +dotnet_diagnostic.S1940.severity = none # Boolean checks should not be inverted — covered by SST1172 +dotnet_diagnostic.S2094.severity = none # Classes should not be empty — covered by SST1436 +dotnet_diagnostic.S2148.severity = none # Underscores should be used to make large numbers readable — covered by SST1191 +dotnet_diagnostic.S2156.severity = none # "sealed" classes should not have "protected" members — covered by SST1427 +dotnet_diagnostic.S2219.severity = none # Runtime type checking should be simplified — covered by SST2007 +dotnet_diagnostic.S2221.severity = none # "Exception" should not be caught +dotnet_diagnostic.S2292.severity = none # Trivial properties should be auto-implemented — covered by SST1420 +dotnet_diagnostic.S2325.severity = none # Methods and properties that don't access instance data should be static - DUPLICATE CA1822 +dotnet_diagnostic.S2333.severity = none # Redundant modifiers should not be used — covered by SST1419/SST1491 +dotnet_diagnostic.S2342.severity = none # Enumeration types should comply with a naming convention — covered by SST1319 +dotnet_diagnostic.S2344.severity = none # Enumeration type names should not have "Flags" or "Enum" suffixes - DUPLICATE CA1711 +dotnet_diagnostic.S2386.severity = none # Mutable fields should not be "public static" — covered by SST1499 +dotnet_diagnostic.S2486.severity = none # Generic exceptions should not be ignored — covered by SST1429 +dotnet_diagnostic.S2737.severity = none # "catch" clauses should do more than rethrow — covered by SST1470 +dotnet_diagnostic.S2760.severity = none # Sequential tests should not check the same condition — covered by SST1475 +dotnet_diagnostic.S3052.severity = none # Covered by PSH1403 (canonical) +dotnet_diagnostic.S3220.severity = none # Method calls should not resolve ambiguously to overloads with "params" — covered by SST2467 +dotnet_diagnostic.S3234.severity = none # Covered by PSH1008 (canonical) +dotnet_diagnostic.S3235.severity = none # Redundant parentheses should not be used — covered by SST1459 +dotnet_diagnostic.S3236.severity = none # Covered by SST1448 (canonical) +dotnet_diagnostic.S3240.severity = none # The simplest possible condition syntax should be used - duplicate of SST1198 +dotnet_diagnostic.S3241.severity = none # Methods should not return values that are never used -> off: needs whole-program analysis; not enforced here +dotnet_diagnostic.S3242.severity = none # Method parameters should be declared with base types +dotnet_diagnostic.S3247.severity = none # Duplicate casts should not be made — covered by SST1175 +dotnet_diagnostic.S3251.severity = none # Implementations should be provided for "partial" methods — covered by SST2468 +dotnet_diagnostic.S3253.severity = none # Constructor and destructor declarations should not be redundant — covered by SST1433 +dotnet_diagnostic.S3254.severity = none # Default parameter values should not be passed as arguments — covered by SST1494 +dotnet_diagnostic.S3256.severity = none # "string.IsNullOrEmpty" should be used — covered by PSH1204 (style configurable) +dotnet_diagnostic.S3257.severity = none # Declarations and initializations should be as concise as possible -> replaced by SST2202 +dotnet_diagnostic.S3260.severity = none # Non-derived "private" classes and records should be "sealed" — covered by PSH1411 +dotnet_diagnostic.S3261.severity = none # Namespaces should not be empty — covered by SST1435 +dotnet_diagnostic.S3267.severity = none # Loops should be simplified with "LINQ" expressions +dotnet_diagnostic.S3376.severity = none # Attribute, EventArgs, and Exception type names should end with the type being extended - DUPLICATE CA1710 +dotnet_diagnostic.S3398.severity = none # "private" methods called only by inner classes should be moved to those classes — covered by SST1498 +dotnet_diagnostic.S3400.severity = none # Methods should not return constants — covered by SST1493 +dotnet_diagnostic.S3416.severity = none # Loggers should be named for their enclosing types — covered by SST2443 +dotnet_diagnostic.S3440.severity = none # Variables should not be checked against the values they're about to be assigned — covered by SST1492 +dotnet_diagnostic.S3441.severity = none # Redundant property names should be omitted in anonymous classes — covered by SST1173 +dotnet_diagnostic.S3444.severity = none # Interfaces should not simply inherit from base interfaces with colliding members — covered by SST2320 +dotnet_diagnostic.S3450.severity = none # Parameters with "[DefaultParameterValue]" attributes should also be marked "[Optional]" -> replaced by obsolete (legacy DefaultParameterValue) +dotnet_diagnostic.S3458.severity = none # Empty "case" clauses that fall through to the "default" should be omitted — covered by SST1466 +dotnet_diagnostic.S3459.severity = none # Unassigned members should be removed - the compiler reports this as CS0649; the rule only ever fires on private never-assigned fields +dotnet_diagnostic.S3532.severity = none # Empty "default" clauses should be removed — covered by SST1179 +dotnet_diagnostic.S3604.severity = none # Member initializer values should not be redundant — covered by PSH1403 +dotnet_diagnostic.S3626.severity = none # Jump statements should not be redundant — covered by SST1174 +dotnet_diagnostic.S3717.severity = none # Track use of "NotImplementedException" -> replaced by SST2485 +dotnet_diagnostic.S3872.severity = none # Parameter names should not duplicate the names of their methods -> replaced by SST1320 +dotnet_diagnostic.S3876.severity = none # Strings or integral types should be used for indexers -> replaced by CA1043 +dotnet_diagnostic.S3878.severity = none # Arrays should not be created for params parameters — covered by PSH1018 +dotnet_diagnostic.S3897.severity = none # Classes that provide "Equals()" should implement "IEquatable" -> replaced by CA1067 +dotnet_diagnostic.S3962.severity = none # Covered by PSH1402 (canonical) +dotnet_diagnostic.S3963.severity = none # "static" fields should be initialized inline - DUPLICATE CA1810 +dotnet_diagnostic.S3967.severity = none # Multidimensional arrays should not be used - DUPLICATE CA1814 +dotnet_diagnostic.S4018.severity = none # All type parameters should be used in the parameter list to enable type inference — covered by SST2307 +dotnet_diagnostic.S4022.severity = none # Enumerations should have "Int32" storage — covered by SST2313 +dotnet_diagnostic.S4023.severity = none # Interfaces should not be empty — covered by SST1437 +dotnet_diagnostic.S4026.severity = none # Assemblies should be marked with "NeutralResourcesLanguageAttribute" -> replaced by CA1824 +dotnet_diagnostic.S4027.severity = none # Exceptions should provide standard constructors — covered by SST1488 +dotnet_diagnostic.S4040.severity = none # Strings should be normalized to uppercase - DUPLICATE CA1308 +dotnet_diagnostic.S4041.severity = none # Type names should not match namespaces - DUPLICATE CA1724 +dotnet_diagnostic.S4047.severity = none # Generics should be used when appropriate -> off: fuzzy prefer-generics suggestion; not enforced +dotnet_diagnostic.S4049.severity = none # Properties should be preferred - DUPLICATE CA1024 +dotnet_diagnostic.S4052.severity = none # Types should not extend outdated base types -> replaced by obsolete +dotnet_diagnostic.S4056.severity = none # Overloads with a "CultureInfo" or an "IFormatProvider" parameter should be used - DUPLICATE CA1305 +dotnet_diagnostic.S4058.severity = none # Covered by PSH1207 (canonical) +dotnet_diagnostic.S4060.severity = none # Non-abstract attributes should be sealed - DUPLICATE CA1813 +dotnet_diagnostic.S4061.severity = none # "params" should be used instead of "varargs" -> replaced by obsolete (__arglist varargs) +dotnet_diagnostic.S4069.severity = none # Operator overloads should have named alternatives - DUPLICATE CA2225 +dotnet_diagnostic.S4136.severity = none # Method overloads should be grouped together — covered by SST1218 +dotnet_diagnostic.S4201.severity = none # Null checks should not be combined with "is" operator checks — covered by SST2018 +dotnet_diagnostic.S4225.severity = none # Extension methods should not extend "object" — covered by SST1706 +dotnet_diagnostic.S4226.severity = none # Extensions should be in separate namespaces +dotnet_diagnostic.S4261.severity = none # Methods should be named according to their synchronicities - Async suffix not used +dotnet_diagnostic.S4663.severity = none # Covered by SST1120 (canonical) +dotnet_diagnostic.S6513.severity = none # "ExcludeFromCodeCoverage" attributes should include a justification - not available on net462 and older TFMs +dotnet_diagnostic.S6585.severity = none # Don't hardcode the format when turning dates and times to strings — covered by SST2445 +dotnet_diagnostic.S6588.severity = none # Use the "UnixEpoch" field instead of creating "DateTime" instances that point to the beginning of the Unix epoch — covered by PSH1413 +dotnet_diagnostic.S6594.severity = none # Covered by PSH1406 (canonical) +dotnet_diagnostic.S6602.severity = none # Covered by PSH1110 (canonical) +dotnet_diagnostic.S6603.severity = none # Covered by PSH1110 (canonical) +dotnet_diagnostic.S6605.severity = none # Covered by PSH1110 (canonical) +dotnet_diagnostic.S6607.severity = none # The collection should be filtered before sorting — covered by PSH1107 +dotnet_diagnostic.S6608.severity = none # Covered by PSH1106 (canonical) +dotnet_diagnostic.S6609.severity = none # "Min/Max" properties of "Set" types should be used instead of the "Enumerable" extension methods — covered by PSH1122 +dotnet_diagnostic.S6610.severity = none # Covered by PSH1201 (canonical) +dotnet_diagnostic.S6612.severity = none # The lambda parameter should be used instead of capturing arguments in "ConcurrentDictionary" methods — covered by PSH1006 +dotnet_diagnostic.S6613.severity = none # "First" and "Last" properties of "LinkedList" should be used instead of the "First()" and "Last()" extension methods — covered by PSH1124 +dotnet_diagnostic.S6617.severity = none # Covered by PSH1111 (canonical) +dotnet_diagnostic.S6618.severity = none # "string.Create" should be used instead of "FormattableString" — covered by PSH1209 +dotnet_diagnostic.S6664.severity = none # The code block contains too many logging calls -> off: fuzzy too-many-logging-calls metric; not enforced +dotnet_diagnostic.S6667.severity = none # Logging in a catch clause should pass the caught exception as a parameter. — covered by SST2438 +dotnet_diagnostic.S6668.severity = none # Logging arguments should be passed to the correct parameter — covered by SST2439 +dotnet_diagnostic.S6669.severity = none # Logger field or property name should comply with a naming convention -> replaced by SST2601 +dotnet_diagnostic.S6670.severity = none # "Trace.Write" and "Trace.WriteLine" should not be used — covered by SST2600 +dotnet_diagnostic.S6672.severity = none # Generic logger injection should match enclosing type — covered by SST2443 +dotnet_diagnostic.S6675.severity = none # "Trace.WriteLineIf" should not be used with "TraceSwitch" levels -> off: niche TraceSwitch misuse; not enforced here +dotnet_diagnostic.S6678.severity = none # Use PascalCase for named placeholders -> replaced by CA1727 +dotnet_diagnostic.S818.severity = none # Literal suffixes should be upper case — covered by SST2244 # Informational code smells -dotnet_diagnostic.S1133.severity = error # Deprecated code should be removed — covered by SST2310 -dotnet_diagnostic.S1135.severity = error # Track uses of "TODO" tags -> off: FIXME comment tracker; not enforced here -dotnet_diagnostic.S1309.severity = error # Track uses of in-source issue suppressions +dotnet_diagnostic.S1133.severity = none # Deprecated code should be removed — covered by SST2310 +dotnet_diagnostic.S1135.severity = none # Track uses of "TODO" tags -> off: FIXME comment tracker; not enforced here +dotnet_diagnostic.S1309.severity = none # Track uses of in-source issue suppressions # Uncategorized dotnet_diagnostic.S9999-cpd.severity = error # Copy-paste token calculator @@ -2632,29 +2665,29 @@ dotnet_diagnostic.S9999-token-type.severity = error # Token type calculator dotnet_diagnostic.S9999-warning.severity = error # Analysis Warning generator # Critical security hotspots -dotnet_diagnostic.S2245.severity = error # Using pseudorandom number generators (PRNGs) is security-sensitive - DUPLICATE CA5394 -dotnet_diagnostic.S2257.severity = error # Using non-standard cryptographic algorithms is security-sensitive -> replaced by SES1007 -dotnet_diagnostic.S4502.severity = error # Disabling CSRF protections is security-sensitive -> replaced by in-box ASP.NET antiforgery analyzer -dotnet_diagnostic.S4790.severity = error # Using weak hashing algorithms is security-sensitive -> replaced by CA5350/CA5351 -dotnet_diagnostic.S4792.severity = error # Configuring loggers is security-sensitive -> off: logging-configuration audit hotspot; not enforced here -dotnet_diagnostic.S5042.severity = error # Expanding archive files without controlling resource consumption is security-sensitive -> off: unbounded decompression; needs taint analysis, out of scope -dotnet_diagnostic.S5332.severity = error # Using clear-text protocols is security-sensitive -> replaced by SES1106 -dotnet_diagnostic.S5443.severity = error # Using publicly writable directories is security-sensitive -> replaced by SES1308 +dotnet_diagnostic.S2245.severity = none # Using pseudorandom number generators (PRNGs) is security-sensitive - DUPLICATE CA5394 +dotnet_diagnostic.S2257.severity = none # Using non-standard cryptographic algorithms is security-sensitive -> replaced by SES1007 +dotnet_diagnostic.S4502.severity = none # Disabling CSRF protections is security-sensitive -> replaced by in-box ASP.NET antiforgery analyzer +dotnet_diagnostic.S4790.severity = none # Using weak hashing algorithms is security-sensitive -> replaced by CA5350/CA5351 +dotnet_diagnostic.S4792.severity = none # Configuring loggers is security-sensitive -> off: logging-configuration audit hotspot; not enforced here +dotnet_diagnostic.S5042.severity = none # Expanding archive files without controlling resource consumption is security-sensitive -> off: unbounded decompression; needs taint analysis, out of scope +dotnet_diagnostic.S5332.severity = none # Using clear-text protocols is security-sensitive -> replaced by SES1106 +dotnet_diagnostic.S5443.severity = none # Using publicly writable directories is security-sensitive -> replaced by SES1308 # Major security hotspots -dotnet_diagnostic.S1313.severity = error # Using hardcoded IP addresses is security-sensitive -> off: hardcoded-IP heuristic; too noisy to enforce -dotnet_diagnostic.S2077.severity = error # Formatting SQL queries is security-sensitive -> replaced by CA2100 -dotnet_diagnostic.S5693.severity = error # Allowing requests with excessive content length is security-sensitive -> replaced by SES1505 -dotnet_diagnostic.S5753.severity = error # Disabling ASP.NET "Request Validation" feature is security-sensitive -> replaced by obsolete (legacy ASP.NET request validation) -dotnet_diagnostic.S5766.severity = error # Creating Serializable objects without data validation checks is security-sensitive -> off: legacy BinaryFormatter deserialization; obsolete path, not used here -dotnet_diagnostic.S6444.severity = error # Not specifying a timeout for regular expressions is security-sensitive -> replaced by SES1509 -dotnet_diagnostic.S6640.severity = error # Using unsafe code blocks is security-sensitive -> off: unsafe-code audit; not enforced here +dotnet_diagnostic.S1313.severity = none # Using hardcoded IP addresses is security-sensitive -> off: hardcoded-IP heuristic; too noisy to enforce +dotnet_diagnostic.S2077.severity = none # Formatting SQL queries is security-sensitive -> replaced by CA2100 +dotnet_diagnostic.S5693.severity = none # Allowing requests with excessive content length is security-sensitive -> replaced by SES1505 +dotnet_diagnostic.S5753.severity = none # Disabling ASP.NET "Request Validation" feature is security-sensitive -> replaced by obsolete (legacy ASP.NET request validation) +dotnet_diagnostic.S5766.severity = none # Creating Serializable objects without data validation checks is security-sensitive -> off: legacy BinaryFormatter deserialization; obsolete path, not used here +dotnet_diagnostic.S6444.severity = none # Not specifying a timeout for regular expressions is security-sensitive -> replaced by SES1509 +dotnet_diagnostic.S6640.severity = none # Using unsafe code blocks is security-sensitive -> off: unsafe-code audit; not enforced here # Minor security hotspots -dotnet_diagnostic.S2092.severity = error # Creating cookies without the "secure" flag is security-sensitive -> replaced by CA5382 -dotnet_diagnostic.S3330.severity = error # Creating cookies without the "HttpOnly" flag is security-sensitive -> replaced by CA5383 -dotnet_diagnostic.S4507.severity = error # Delivering code in production with debug features activated is security-sensitive -> off: debug features in production; partly covered by SES1506, rest not enforced -dotnet_diagnostic.S5122.severity = error # Having a permissive Cross-Origin Resource Sharing policy is security-sensitive -> replaced by SES1501 +dotnet_diagnostic.S2092.severity = none # Creating cookies without the "secure" flag is security-sensitive -> replaced by CA5382 +dotnet_diagnostic.S3330.severity = none # Creating cookies without the "HttpOnly" flag is security-sensitive -> replaced by CA5383 +dotnet_diagnostic.S4507.severity = none # Delivering code in production with debug features activated is security-sensitive -> off: debug features in production; partly covered by SES1506, rest not enforced +dotnet_diagnostic.S5122.severity = none # Having a permissive Cross-Origin Resource Sharing policy is security-sensitive -> replaced by SES1501 ############################################# # JetBrains ReSharper / Rider Inspections @@ -2838,10 +2871,3 @@ end_of_line = lf [*.{cmd, bat}] end_of_line = lf - -############################################# -# Test projects (TUnit) -############################################# -# TUnit instantiates test classes per test, so they must remain instance classes and -# cannot be marked static — even when a partial declaration happens to hold only static -# members (the instance [Test] methods live in sibling partial files). diff --git a/.gitattributes b/.gitattributes index 01c527ecb..a5d963a4f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,19 +1,65 @@ -# Auto detect text files and perform LF normalization -* text=auto +# Auto-detect text files and force LF in the repository AND the working tree, on every +# platform. eol=lf is set explicitly on each pattern: a more specific line only overrides +# the attributes it names, and a bare `text` would otherwise fall back to core.autocrlf +# and check out CRLF on Windows. +* text=auto eol=lf -# Custom for Visual Studio -*.cs diff=csharp +# Source code +*.cs text eol=lf diff=csharp +*.xaml text eol=lf +*.slnx text eol=lf +*.sln text eol=lf +*.csproj text eol=lf +*.props text eol=lf +*.targets text eol=lf +*.json text eol=lf +*.xml text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.md text eol=lf +*.txt text eol=lf +*.sh text eol=lf +*.ps1 text eol=lf +*.cmd text eol=lf +*.bat text eol=lf +*.config text eol=lf +*.editorconfig text eol=lf -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain +# Binary files (do not normalise or diff). `binary` expands to `-text -diff`, which +# overrides the `* text=auto eol=lf` above. Every extension here previously carried +# `-text` only by virtue of its Git LFS line, so all of them must be listed explicitly +# now that LFS is gone, or `text=auto` would be left guessing. -.idea/ +# Images +*.png binary +*.jpg binary +*.gif binary +*.ico binary +*.bmp binary +*.webp binary +*.psd binary + +# Fonts +*.ttf binary +*.otf binary +*.woff binary +*.woff2 binary + +# Archives +*.zip binary +*.gz binary +*.7z binary +*.tar binary + +# Compiled output and signing material +*.dll binary +*.exe binary +*.pdb binary +*.lib binary +*.so binary +*.winmd binary +*.pfx binary +*.snk binary + +# Documents +*.pdf binary diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 73f980c97..014136fa3 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -9,7 +9,7 @@ 1.61.38 - 3.38.1 + 3.41.14 @@ -50,7 +50,7 @@ - +