Skip to content

build(analyzers): update StyleSharp to 3.13.4 and adopt new complexity rules#102

Merged
glennawatson merged 1 commit into
mainfrom
glennawatson/update-analyzers-again
Jun 26, 2026
Merged

build(analyzers): update StyleSharp to 3.13.4 and adopt new complexity rules#102
glennawatson merged 1 commit into
mainfrom
glennawatson/update-analyzers-again

Conversation

@glennawatson

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Build / tooling update — analyzer package bump and adoption of the new StyleSharp complexity rules.

What is the new behavior?

  • Bumps StyleSharp.Analyzers 3.12.14 → 3.13.4 and Microsoft.NET.Test.Sdk 18.6.0 → 18.7.0.
  • Enables the new StyleSharp complexity rules — SST1442 (too many direct branch points), SST1443 (too much nested control flow), SST1444 (loop that cannot reach a second iteration) — and sets the cyclomatic/cognitive thresholds.
  • Disables the Sonar/CA rules that are now duplicates of the canonical SST equivalents (S1541SST1442, S3776SST1443, S1751SST1444, CA1040/CA1051/S2357, and SST2205 in favour of the switch-expression-only SST2206).
  • Adds a scoped [SuppressMessage] for SST1442 on TryReadValues in the arity-10..16 SyncLatest coordinators. The branch count there is one short-circuited per-source readiness check, so it is inherent to the operator arity and cannot drop below the threshold without non-short-circuit & (which S2178 forbids).

What is the current behavior?

Older StyleSharp build with the complexity rules sourced from Sonar/CA analyzers and no SST1442/1443/1444 coverage.

What might this PR break?

None. Pure build/analyzer configuration plus suppression attributes; no product or test code behavior changes. Full solution builds clean (0 warnings) and all 10,020 tests pass.

Checklist

  • I have read the Contribute guide
  • Tests have been added or updated (for bug fixes / features)
  • Docs have been added or updated (for bug fixes / features)
  • Changes target the main branch
  • PR title follows Conventional Commits

Additional information

The branch-count suppression is the only viable path for these deliberate high-arity operators: && short-circuits (each a branch point), & would trip S2178, and an N-source combinator genuinely needs N readiness checks.

…y rules

- Bump StyleSharp.Analyzers 3.12.14 -> 3.13.4 and Microsoft.NET.Test.Sdk 18.6.0 -> 18.7.0
- Enable SST1442/SST1443/SST1444 (branching, nesting, single-iteration loop) and set complexity thresholds
- Disable Sonar/CA duplicates now covered by the SST equivalents (S1541, S3776, S1751, CA1040, CA1051, S2357, SST2205)
- Scope-suppress SST1442 on TryReadValues in the arity-10..16 SyncLatest coordinators where the per-source readiness check count is inherent to the operator arity
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.91%. Comparing base (8b04a2e) to head (4d754eb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
- Coverage   90.94%   90.91%   -0.03%     
==========================================
  Files         651      651              
  Lines       20464    20464              
  Branches     2454     2454              
==========================================
- Hits        18610    18604       -6     
- Misses       1485     1488       +3     
- Partials      369      372       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@glennawatson glennawatson merged commit 39613af into main Jun 26, 2026
12 of 13 checks passed
@glennawatson glennawatson deleted the glennawatson/update-analyzers-again branch June 26, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant