diff --git a/.editorconfig b/.editorconfig index 2ba00cf..1ebd2f2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -207,7 +207,7 @@ dotnet_diagnostic.CA1032.severity = error # Implement standard exception constru 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 = error # Avoid empty interfaces +dotnet_diagnostic.CA1040.severity = none # Avoid empty interfaces — duplicate of SST1437 (canonical); marker interfaces (IActivatableView etc.) are deliberate public API dotnet_diagnostic.CA1041.severity = error # Provide ObsoleteAttribute message dotnet_diagnostic.CA1043.severity = error # Use integral or string argument for indexers dotnet_diagnostic.CA1044.severity = error # Properties should not be write only @@ -216,7 +216,7 @@ dotnet_diagnostic.CA1046.severity = error # Do not overload operator equals on r dotnet_diagnostic.CA1047.severity = error # Do not declare protected member in sealed type dotnet_diagnostic.CA1048.severity = error # Do not declare virtual members in sealed types dotnet_diagnostic.CA1050.severity = error # Declare types in namespaces -dotnet_diagnostic.CA1051.severity = error # Do not declare visible instance fields +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 @@ -1135,6 +1135,9 @@ stylesharp.document_interfaces = all stylesharp.SST1305.allowed_hungarian_prefixes = rx stylesharp.instance_member_qualification = omit_this stylesharp.avoid_linq_on_hot_path = true +stylesharp.max_cyclomatic_complexity = 10 +stylesharp.max_cognitive_complexity = 15 +stylesharp.max_property_cognitive_complexity = 3 # Spacing dotnet_diagnostic.SST1000.severity = error # A control-flow keyword is not followed by a space @@ -1346,6 +1349,9 @@ dotnet_diagnostic.SST1438.severity = error # Methods should not be empty dotnet_diagnostic.SST1439.severity = error # Nested code blocks should not be left empty dotnet_diagnostic.SST1440.severity = error # Private members with no local use should be removed dotnet_diagnostic.SST1441.severity = error # Private fields assigned but never read should be removed +dotnet_diagnostic.SST1442.severity = error # A function has too many direct branch points +dotnet_diagnostic.SST1443.severity = error # A function has too much nested control flow +dotnet_diagnostic.SST1444.severity = error # A loop cannot naturally reach a second iteration dotnet_diagnostic.SST1450.severity = error # Store files as UTF-8 without a byte order mark # Layout @@ -1456,7 +1462,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 +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 @@ -1658,7 +1664,7 @@ dotnet_diagnostic.S6674.severity = error # Log message template should be syntac ################### dotnet_diagnostic.S1244.severity = error # Floating point numbers should not be tested for equality dotnet_diagnostic.S1656.severity = none # Variables should not be self-assigned — covered by SST1189 -dotnet_diagnostic.S1751.severity = error # Loops with at most one iteration should be refactored +dotnet_diagnostic.S1751.severity = none # 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 dotnet_diagnostic.S1848.severity = error # Objects should not be created to be dropped immediately without being used dotnet_diagnostic.S1862.severity = error # Related "if/else if" statements should not have the same condition @@ -1790,7 +1796,7 @@ dotnet_diagnostic.S1215.severity = none # "GC.Collect" should not be called 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 = error # Methods and properties should not be too complex +dotnet_diagnostic.S1541.severity = none # Methods and properties should not be too complex - covered by SST1442 dotnet_diagnostic.S1699.severity = error # Constructors should only call non-overridable methods dotnet_diagnostic.S1821.severity = error # "switch" statements should not be nested dotnet_diagnostic.S1944.severity = error # Invalid casts should be avoided @@ -1819,7 +1825,7 @@ dotnet_diagnostic.S3353.severity = error # Unchanged variables should be marked dotnet_diagnostic.S3447.severity = error # "[Optional]" should not be used on "ref" or "out" parameters dotnet_diagnostic.S3451.severity = error # "[DefaultValue]" should not be used when "[DefaultParameterValue]" is meant dotnet_diagnostic.S3600.severity = error # "params" should not be introduced on overrides -dotnet_diagnostic.S3776.severity = error # Cognitive Complexity of methods should not be too high +dotnet_diagnostic.S3776.severity = none # Cognitive Complexity of methods should not be too high - covered by SST1443 dotnet_diagnostic.S3871.severity = error # Exception types should be "public" dotnet_diagnostic.S3874.severity = none # "out" and "ref" parameters — repo idiom is TryX(..., out T value) dotnet_diagnostic.S3904.severity = error # Assemblies should have version information @@ -1880,7 +1886,7 @@ dotnet_diagnostic.S2166.severity = none # Classes named like "Exception" should dotnet_diagnostic.S2234.severity = error # Arguments should be passed in the same order as the method parameters dotnet_diagnostic.S2326.severity = error # Unused type parameters should be removed dotnet_diagnostic.S2327.severity = error # "try" statements with identical "catch" and/or "finally" blocks should be merged -dotnet_diagnostic.S2357.severity = error # Fields should be private +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 = error # Exceptions should not be thrown from property getters dotnet_diagnostic.S2376.severity = error # Write-only properties should not be used dotnet_diagnostic.S2629.severity = error # Logging templates should be constant diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 0ae9483..4cc5a66 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -9,7 +9,7 @@ - + @@ -54,7 +54,7 @@ - + diff --git a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest10Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,TResult}.cs b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest10Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,TResult}.cs index ccff4f5..a62d77b 100644 --- a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest10Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,TResult}.cs +++ b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest10Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,TResult}.cs @@ -193,9 +193,9 @@ protected override ValueTask SubscribeAtAsync(int index, Cance /// When the method returns , the snapshot. /// when every source has produced a value; otherwise . [SuppressMessage( - "Major Code Smell", - "S1541:Methods and properties should not be too complex", - Justification = "Short-circuited checks over every source's Optional are the snapshot semantic.")] + "Maintainability", + "SST1442:A function has too many direct branch points", + Justification = "One short-circuited Optional check per source is the snapshot semantic; the branch count is inherent to the operator arity.")] private bool TryReadValues(out (T1 V1, T2 V2, T3 V3, T4 V4, T5 V5, T6 V6, T7 V7, T8 V8, T9 V9, T10 V10) values) { if (Value1.TryGetValue(out var value1) diff --git a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest11Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,TResult}.cs b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest11Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,TResult}.cs index 3db598f..ceda166 100644 --- a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest11Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,TResult}.cs +++ b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest11Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,TResult}.cs @@ -206,9 +206,9 @@ protected override ValueTask SubscribeAtAsync(int index, Cance /// When the method returns , the snapshot. /// when every source has produced a value; otherwise . [SuppressMessage( - "Major Code Smell", - "S1541:Methods and properties should not be too complex", - Justification = "Short-circuited checks over every source's Optional are the snapshot semantic.")] + "Maintainability", + "SST1442:A function has too many direct branch points", + Justification = "One short-circuited Optional check per source is the snapshot semantic; the branch count is inherent to the operator arity.")] private bool TryReadValues(out (T1 V1, T2 V2, T3 V3, T4 V4, T5 V5, T6 V6, T7 V7, T8 V8, T9 V9, T10 V10, T11 V11) values) { if (Value1.TryGetValue(out var value1) diff --git a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest12Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,TResult}.cs b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest12Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,TResult}.cs index 5875ecc..6a22cb6 100644 --- a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest12Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,TResult}.cs +++ b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest12Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,TResult}.cs @@ -219,9 +219,9 @@ protected override ValueTask SubscribeAtAsync(int index, Cance /// When the method returns , the snapshot. /// when every source has produced a value; otherwise . [SuppressMessage( - "Major Code Smell", - "S1541:Methods and properties should not be too complex", - Justification = "Short-circuited checks over every source's Optional are the snapshot semantic.")] + "Maintainability", + "SST1442:A function has too many direct branch points", + Justification = "One short-circuited Optional check per source is the snapshot semantic; the branch count is inherent to the operator arity.")] private bool TryReadValues(out (T1 V1, T2 V2, T3 V3, T4 V4, T5 V5, T6 V6, T7 V7, T8 V8, T9 V9, T10 V10, T11 V11, T12 V12) values) { if (Value1.TryGetValue(out var value1) diff --git a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest13Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,TResult}.cs b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest13Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,TResult}.cs index c53de08..f88047c 100644 --- a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest13Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,TResult}.cs +++ b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest13Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,TResult}.cs @@ -232,9 +232,9 @@ protected override ValueTask SubscribeAtAsync(int index, Cance /// When the method returns , the snapshot. /// when every source has produced a value; otherwise . [SuppressMessage( - "Major Code Smell", - "S1541:Methods and properties should not be too complex", - Justification = "Short-circuited checks over every source's Optional are the snapshot semantic.")] + "Maintainability", + "SST1442:A function has too many direct branch points", + Justification = "One short-circuited Optional check per source is the snapshot semantic; the branch count is inherent to the operator arity.")] private bool TryReadValues(out (T1 V1, T2 V2, T3 V3, T4 V4, T5 V5, T6 V6, T7 V7, T8 V8, T9 V9, T10 V10, T11 V11, T12 V12, T13 V13) values) { if (Value1.TryGetValue(out var value1) diff --git a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest14Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,TResult}.cs b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest14Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,TResult}.cs index 84ac945..b00ee36 100644 --- a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest14Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,TResult}.cs +++ b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest14Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,TResult}.cs @@ -245,9 +245,9 @@ protected override ValueTask SubscribeAtAsync(int index, Cance /// When the method returns , the snapshot. /// when every source has produced a value; otherwise . [SuppressMessage( - "Major Code Smell", - "S1541:Methods and properties should not be too complex", - Justification = "Short-circuited checks over every source's Optional are the snapshot semantic.")] + "Maintainability", + "SST1442:A function has too many direct branch points", + Justification = "One short-circuited Optional check per source is the snapshot semantic; the branch count is inherent to the operator arity.")] private bool TryReadValues(out (T1 V1, T2 V2, T3 V3, T4 V4, T5 V5, T6 V6, T7 V7, T8 V8, T9 V9, T10 V10, T11 V11, T12 V12, T13 V13, T14 V14) values) { if (Value1.TryGetValue(out var value1) diff --git a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest15Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,TResult}.cs b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest15Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,TResult}.cs index a7597ab..5853518 100644 --- a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest15Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,TResult}.cs +++ b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest15Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,TResult}.cs @@ -258,9 +258,9 @@ protected override ValueTask SubscribeAtAsync(int index, Cance /// When the method returns , the snapshot. /// when every source has produced a value; otherwise . [SuppressMessage( - "Major Code Smell", - "S1541:Methods and properties should not be too complex", - Justification = "Short-circuited checks over every source's Optional are the snapshot semantic.")] + "Maintainability", + "SST1442:A function has too many direct branch points", + Justification = "One short-circuited Optional check per source is the snapshot semantic; the branch count is inherent to the operator arity.")] private bool TryReadValues(out (T1 V1, T2 V2, T3 V3, T4 V4, T5 V5, T6 V6, T7 V7, T8 V8, T9 V9, T10 V10, T11 V11, T12 V12, T13 V13, T14 V14, T15 V15) values) { if (Value1.TryGetValue(out var value1) diff --git a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest16Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,TResult}.cs b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest16Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,TResult}.cs index da08fa5..5657de4 100644 --- a/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest16Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,TResult}.cs +++ b/src/ReactiveUI.Primitives.Async.Core/Advanced/SyncLatest16Coordinator{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,TResult}.cs @@ -271,9 +271,9 @@ protected override ValueTask SubscribeAtAsync(int index, Cance /// When the method returns , the snapshot. /// when every source has produced a value; otherwise . [SuppressMessage( - "Major Code Smell", - "S1541:Methods and properties should not be too complex", - Justification = "Short-circuited checks over every source's Optional are the snapshot semantic.")] + "Maintainability", + "SST1442:A function has too many direct branch points", + Justification = "One short-circuited Optional check per source is the snapshot semantic; the branch count is inherent to the operator arity.")] private bool TryReadValues(out (T1 V1, T2 V2, T3 V3, T4 V4, T5 V5, T6 V6, T7 V7, T8 V8, T9 V9, T10 V10, T11 V11, T12 V12, T13 V13, T14 V14, T15 V15, T16 V16) values) { if (Value1.TryGetValue(out var value1)