Skip to content

Re-enable Roslyn analyzers (AV/MA/SA) and fix all reported issues#189

Open
dennisdoomen wants to merge 1 commit into
mainfrom
dennisdoomen/fix-roslyn-analyzers
Open

Re-enable Roslyn analyzers (AV/MA/SA) and fix all reported issues#189
dennisdoomen wants to merge 1 commit into
mainfrom
dennisdoomen/fix-roslyn-analyzers

Conversation

@dennisdoomen

Copy link
Copy Markdown
Owner

Re-enables the CSharpGuidelines (AV), Meziantou (MA), and StyleCop (SA) Roslyn analyzers and fixes all reported errors and warnings so the build is fully clean.

Build errors fixed

  • AV1500 — 6 methods exceeding the 40-statement limit refactored by extracting private helper methods: SecurityRiskEvaluator, PackageAdoptionRiskFactor, GitHubRepositoryRiskEnricher, IssueHealthRiskFactor, NpmRegistryMetadataFetcher, RiskHtmlReportWriter, AnalyzeCommand
  • AV1561DependencyHealthCountEnricher.CountDependencyHealth replaced 4-element tuple with new DependencyHealthCounts record

Warnings fixed

  • AV1537 — Added unconditional else clauses to if-else-if chains
  • AV1553 — Removed optional null default from LicenseFetcher constructor
  • AV1708CommonFileDetector renamed to avoid 'Common' in type name
  • MA0002 — Added StringComparer to dictionary/set constructors
  • MA0014 — Replaced ApplicationException with InvalidOperationException
  • MA0016 — Changed concrete List<T> field types to IList<T>
  • MA0074 — Added StringComparison.Ordinal to StartsWith calls
  • SA1128/SA1134/SA1214/SA1316/SA1407/SA1512/SA1515 — Fixed formatting issues

Verification

dotnet build completes with 0 errors and 0 warnings. 161/163 tests pass; the 1 failure (Can_analyze_yarn_projects_without_lock_file) is a pre-existing environment issue (yarn not installed) unrelated to these changes.

@dennisdoomen dennisdoomen force-pushed the dennisdoomen/fix-roslyn-analyzers branch from 20eea37 to 0e66129 Compare June 8, 2026 11:33
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Test Results

0 tests   - 163   0 ✅  - 161   0s ⏱️ - 2m 39s
0 suites  -   1   0 💤 ±  0 
0 files    -   1   0 ❌  -   2 

Results for commit 0e66129. ± Comparison against base commit 003a338.

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