Skip to content

Clean up build warnings across Lite, Dashboard, and Installer #945

@erikdarlingdata

Description

@erikdarlingdata

Background

A full rebuild of Lite produces 190 unique warnings (380 raw — each fires twice because WPF compiles XAML through a temp project). Counts for Dashboard and Installer haven't been audited yet but likely have similar profiles.

Lite breakdown

Code Unique count Description Verdict
CA1873 184 ""Evaluation of this argument may be expensive and unnecessary if logging is disabled"" — fires on every _logger?.LogXxx(""…"", someField) call Noise. The analyzer flags any non-literal argument. Real fix is LoggerMessage.Define source generators (big refactor) or if (_logger.IsEnabled(level)) wrappers (ugly). Suppress globally — the ""expense"" of a field access is negligible.
CS8604 2 ""Possible null reference argument"" at Lite/Controls/CorrelatedTimelineLanesControl.xaml.cs:178,182 — passing a nullable collection to .Select(...) Real. Fix with null-coalesce or guard.
CA1859 1 ""Change return type from object? to Dictionary<string, object>? for performance"" at Lite/Mcp/McpAnalysisTools.cs:843 Real. Concrete return type avoids boxing.

Proposed approach

  1. Add a project-root .editorconfig (or extend an existing one) that suppresses CA1873 with a justification comment.
  2. Fix the three real warnings in Lite (CS8604 ×2, CA1859 ×1).
  3. Run the same audit on Dashboard and Installer; fix what's real, suppress what isn't.
  4. Verify dotnet build reports 0 warnings on all three projects.

Suppression should be global via .editorconfig, not per-file #pragma warning disable, so future code stays clean.

Out of scope

  • Migrating to LoggerMessage.Define / source-generator logging (separate, larger effort).
  • Treating warnings as errors. We can revisit TreatWarningsAsErrors once the count is at zero.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions