Skip to content

refactor(analyzers): share helper catalogs and drop test aliases - #149

Merged
e128 merged 2 commits into
mainfrom
refactor/codebase-untangling
Nov 11, 2026
Merged

e128 merged 2 commits into
mainfrom
refactor/codebase-untangling

Conversation

@e128

@e128 e128 commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Executive Summary

The repository carried ten untangling items plus four E128218 follow-up phases. The shared logic was duplicated across analyzers, and the analyzer test suite wrapped AnalyzerTestRunner in 199 one-line aliases that only renamed the call. This change consolidates the duplicated catalogs, adds the remaining implicit state machine phases, and deletes 179 of those aliases. scripts/check.sh passes: shell lint, format, build, and 2665 tests.

Code Changes

  • Add MutableCollectionCatalog, PathNameKind, and PragmaWarningDirectives as the single owner of their tables, so the exposure, path, and suppression analyzers stop carrying private copies.
  • Move the FIPS hash name and OID tables into FipsSymbolHelpers. Derive DiskIoCatalog method kinds from one set per kind.
  • Align MetadataTypes.RegisterForType with Find, and pass SuggestedType through FileSystemPathAnalyzer instead of recomputing it.
  • Extend E128218 with forwarded accessor pairs, mutable struct support, cross-type writes gated on internal write access, and the e128_state_min_transition_bodies option.
  • E128CodeFixProviderBase keeps the syntax root fetch. 119 of 120 providers locate the reported node from that root, so moving the fetch into each provider would copy the same null guard 120 times. PragmaBalanceCodeFixProvider was the one provider that ignored the root and now overrides RegisterCodeFixesAsync directly.
  • Delete 179 VerifyAsync aliases and add the three runner overloads they depended on. The 20 helpers that remain inject a stub preamble, a reference set, a language version, or an options value tied to a parameter.
  • Bump SonarAnalyzer.CSharp to 10.36.0.15337. All three new rules (S9414, S9415, S9422) are enabled by default, so the blanket error severity already covers them. S3900 is off by default and was missing from .globalconfig, so it is now named there.
  • Restore the Microsoft.CodeAnalysis.CSharp.Workspaces and System.Security.Cryptography.Pkcs central pins a concurrent edit removed. Without them restore fell back to 1.0.1 and 9.0.6, which produced NU1010, NU1701, and two vulnerability errors.
  • Analyzer release files: version 2.8.0, with the Unshipped row promoted to AnalyzerReleases.Shipped.md.

Tests and Tooling

  • scripts/check.sh passes: shell lint, format check, build, and the full test suite.
  • Test count unchanged at 2665, so no test was dropped by the alias removal.
  • Sonar rule enablement was read from the shipped analyzer assembly rather than the release notes: descriptors report IsEnabledByDefault=True for S9414, S9415, and S9422. The rule catalog is identical between 10.35 and 10.36.
  • No benchmark run. The change set adds no hot path.

Review Guide

  • src/E128.Analyzers/Design/ImplicitStateMachineAnalyzer.cs: the four new phases and their gating.
  • The shared catalogs: confirm each analyzer now reads one table.
  • tests/E128.Analyzers.Tests/AnalyzerTestRunner.cs: the three overloads that replace the aliases.
  • Directory.Packages.props and .globalconfig: the restored pins and the S3900 entry.

Rollback

Revert the commit. The analyzer version bump and the release-file promotion revert with it.

🤖 Generated with Claude Code

e128 added 2 commits November 11, 2026 07:43
- Add shared catalogs: MutableCollectionCatalog, PathNameKind, PragmaWarningDirectives.
- Move FIPS hash tables into FipsSymbolHelpers and derive DiskIoCatalog method kinds.
- Align MetadataTypes.RegisterForType with Find and pass SuggestedType through the path analyzer.
- Extend E128218 with forwarded accessors, mutable structs, cross-type writes, and the transition option.
- Delete 179 one-line VerifyAsync aliases and add the runner overloads they replaced.
- Bump SonarAnalyzer to 10.36.0.15337, enable S3900, and restore the central package pins.
- Prune the roadmap to the open union item and refresh the lode contracts.

Co-Authored-By: Claude

Co-Authored-By: Claude
- Split reports on '<' with tr so awk reads one element per line.
- Drop the require_tool check and the CI apt-get install of libxml2-utils.
- Record the dependency in lode/dotnet/code-coverage.md.

Co-Authored-By: Claude

Co-Authored-By: Claude
@e128
e128 merged commit 436e6ef into main Nov 11, 2026
2 checks passed
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