Skip to content

Fix #945 — clean up build warnings (Lite 190→0, Dashboard 3→0)#948

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/945-build-warnings-cleanup
May 8, 2026
Merged

Fix #945 — clean up build warnings (Lite 190→0, Dashboard 3→0)#948
erikdarlingdata merged 1 commit into
devfrom
feature/945-build-warnings-cleanup

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Reduces full-rebuild warning counts to 0 across all three projects.

Project Before After
Lite 190 0
Dashboard 3 0
Installer 0 0

Files

.editorconfig (new, repo root)

Suppresses CA1873 ("Avoid potentially expensive logging") globally with a justifying comment. This rule fires on any non-literal argument to a logging method — including trivial field accesses like _logger.LogInformation(""X: {Path}"", _path) — and accounted for ~97% of Lite's warning count. The cost the rule warns about is consistently negligible in this codebase. Real fix would be migrating to LoggerMessage source generators across the codebase, which is a separate effort.

Lite/Controls/CorrelatedTimelineLanesControl.xaml.cs (CS8604 ×2)

The comparison-data fetch path passed possibly-null Task<T>.Result directly to .Select(...) after only checking IsCompletedSuccessfully. The same file does ?.Count ?? 0 for these exact fields elsewhere, so null was anticipated — the .Select lines just missed the guard. Added && Result != null to the conditions on both lines.

Lite/Mcp/McpAnalysisTools.cs (CA1859 ×1)

FormatBaselineContext already builds and returns a Dictionary<string, object>, but the declared return type was object?, forcing boxing. Tightened to Dictionary<string, object>?.

Dashboard/ServerTab.Plans.cs (CA1806 ×3)

Three sites called int.TryParse(..., out X) and discarded the bool return, relying on TryParse setting the out param to default on failure. Behavior is correct, but the analyzer can't see the intent. Replaced with _ = int.TryParse(...) to make the discard explicit. Behavior unchanged.

Notes

Static analyzers fire on the WPF temp-project compilation step, so each warning shows up twice in the raw output. The 187 / 3 unique counts above match the deduplicated tallies.

CS8019 / CS8933 (redundant using directives covered by global usings) appear in IDE diagnostics but are not surfaced by dotnet build, so they don't affect the build warning count and aren't addressed here.

🤖 Generated with Claude Code

Lite went from 190 warnings to 0, Dashboard from 3 to 0, Installer was
already clean. Total fixes:

- Add repo-root .editorconfig suppressing CA1873 ("potentially expensive
  logging") with rationale. This rule fires on every non-literal
  argument to a logging method including trivial field accesses, which
  accounts for ~97% of Lite's warning count and is pure noise — the
  cost the rule warns about is consistently negligible. Proper fix is
  migrating to LoggerMessage source generators, tracked separately.

- Lite/Controls/CorrelatedTimelineLanesControl.xaml.cs: guard against
  null .Result on completed comparison-data tasks before passing to
  .Select() (CS8604 ×2). The author already wrote `?.Count ?? 0` for
  the same fields elsewhere, so null was anticipated; the .Select calls
  just missed the guard.

- Lite/Mcp/McpAnalysisTools.cs: tighten FormatBaselineContext return
  type from object? to Dictionary<string, object>?, removing the
  unnecessary boxing (CA1859).

- Dashboard/ServerTab.Plans.cs: discard the bool returns from three
  int.TryParse calls with `_ =`, making the "ignore failure, use
  default 0" intent explicit (CA1806 ×3). Behavior unchanged —
  TryParse already sets the out param to default on failure.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 02e135b into dev May 8, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/945-build-warnings-cleanup branch May 8, 2026 15:07
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