Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>
<ItemGroup>
<PackageVersion Include="MinVer" Version="7.0.0" />
<PackageVersion Include="StyleSharp.Analyzers" Version="3.12.14" />
<PackageVersion Include="StyleSharp.Analyzers" Version="3.13.4" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.15.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="5.0.0-1.25277.114" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="5.0.0-1.25277.114" />
Expand Down Expand Up @@ -54,7 +54,7 @@
<!-- Test infrastructure -->
<ItemGroup>
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageVersion Include="TUnit" Version="1.56.35" />
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.8.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ protected override ValueTask<IAsyncDisposable> SubscribeAtAsync(int index, Cance
/// <param name="values">When the method returns <see langword="true"/>, the snapshot.</param>
/// <returns><see langword="true"/> when every source has produced a value; otherwise <see langword="false"/>.</returns>
[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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ protected override ValueTask<IAsyncDisposable> SubscribeAtAsync(int index, Cance
/// <param name="values">When the method returns <see langword="true"/>, the snapshot.</param>
/// <returns><see langword="true"/> when every source has produced a value; otherwise <see langword="false"/>.</returns>
[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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ protected override ValueTask<IAsyncDisposable> SubscribeAtAsync(int index, Cance
/// <param name="values">When the method returns <see langword="true"/>, the snapshot.</param>
/// <returns><see langword="true"/> when every source has produced a value; otherwise <see langword="false"/>.</returns>
[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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ protected override ValueTask<IAsyncDisposable> SubscribeAtAsync(int index, Cance
/// <param name="values">When the method returns <see langword="true"/>, the snapshot.</param>
/// <returns><see langword="true"/> when every source has produced a value; otherwise <see langword="false"/>.</returns>
[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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ protected override ValueTask<IAsyncDisposable> SubscribeAtAsync(int index, Cance
/// <param name="values">When the method returns <see langword="true"/>, the snapshot.</param>
/// <returns><see langword="true"/> when every source has produced a value; otherwise <see langword="false"/>.</returns>
[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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ protected override ValueTask<IAsyncDisposable> SubscribeAtAsync(int index, Cance
/// <param name="values">When the method returns <see langword="true"/>, the snapshot.</param>
/// <returns><see langword="true"/> when every source has produced a value; otherwise <see langword="false"/>.</returns>
[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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ protected override ValueTask<IAsyncDisposable> SubscribeAtAsync(int index, Cance
/// <param name="values">When the method returns <see langword="true"/>, the snapshot.</param>
/// <returns><see langword="true"/> when every source has produced a value; otherwise <see langword="false"/>.</returns>
[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)
Expand Down
Loading