Skip to content

[Sprint 20] Reduce analyzer warning backlog #402

Description

@mpaulosky

Summary

Broaden the analyzer cleanup issue to match the work already completed on this branch, covering validated warning reductions across multiple test projects plus targeted production-code fixes in src/AppHost, src/Web, and related architecture surfaces. The cleanup remains code-fix first, with suppressions allowed only when they are narrow, justified, and documented.

Current Context

Recent branch work has moved beyond an initial cleanup slice and now includes validated analyzer and test-runtime fixes across:

  • tests/AppHost.Tests/*
  • tests/Web.Tests/*
  • tests/Web.Tests.Bunit/*
  • tests/Web.Tests.Integration/*
  • tests/Architecture.Tests/*
  • src/AppHost/AppHost.cs
  • src/AppHost/Properties/AssemblyInfo.cs
  • src/Web/Components/Theme/ThemeProvider.razor.cs
  • src/Web/Data/MongoDbBlogPostRepository.cs
  • src/Web/Data/MongoDbCategoryRepository.cs
  • src/Web/Infrastructure/FileStorage/LocalDiskFileStorage.cs
  • src/Web/Security/RoleClaimsHelper.cs

The warning families addressed on this branch include targeted fixes for analyzer findings such as CA2007, CA1515, CA1307, CA1063, CA1816, CA1711, CA2000, CA2201, and CA2012, depending on project and file context.

Local validation already completed for the committed branch work:

  • dotnet build MyBlog.slnx -c Release -v minimal passed
  • AppHost.Tests passed 60/60 with no skips
  • Web.Tests.Integration passed 36/36 with no warnings
  • Web.Tests passed 260/260
  • Web.Tests.Bunit passed 112/112

Goals

  • Reduce the analyzer warning backlog with code changes that improve correctness, maintainability, or test reliability.
  • Align the issue scope with the branch’s actual delivered work across test projects, AppHost, targeted src/Web files, and small architecture-test adjustments.
  • Preserve the existing standard that production code should not gain blanket warning suppression.
  • Allow suppressions only when they are justified, narrowly scoped, and documented in code or PR rationale.
  • Keep build and test validation green while warning cleanup progresses.

Acceptance Criteria

  • The issue scope reflects the branch’s current analyzer cleanup across test projects, targeted src/Web production files, src/AppHost, and architecture-related adjustments.
  • Warning reductions are implemented primarily through code fixes, not broad suppression.
  • Any suppression added on this branch is narrowly scoped, explicitly justified, and documented.
  • Focused local validation is recorded for the cleanup already completed on this branch.
  • The resulting branch continues to satisfy repo build and test gates, including pre-push validation.

Notes

  • Follow-on from issue #400 and PR #401.
  • Project board target: MyBlog project #4.
  • Sprint target: Sprint 20: Mongo ObjectId Migration.
  • This issue now tracks a broader validated cleanup pass rather than only a first incremental slice.
  • Local-only workspace artifacts such as .squad/* and .vscode/settings.json are not intended deliverables for the eventual PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationpriority:p1This sprintsquadSquad triage inbox — Lead will assign to a membersquad:aragornAssigned to Aragorn (Lead / Architect)squad:legolasAssigned to Legolas (Frontend / Blazor)type:choreMaintenance, refactoring, cleanup

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions