Skip to content

Resolve SonarQube findings in WebApi, Db, and Service code - #595

Merged
LarsLaskowski merged 1 commit into
mainfrom
maintenance/sonar
Aug 16, 2026
Merged

Resolve SonarQube findings in WebApi, Db, and Service code#595
LarsLaskowski merged 1 commit into
mainfrom
maintenance/sonar

Conversation

@LarsLaskowski

Copy link
Copy Markdown
Owner

Pull Request

📖 Description

Addresses several SonarQube findings that had accumulated across the backend. AppMetrics had a prose comment that tripped the S125 "commented-out code" heuristic because a line happened to end in a semicolon; it is reworded without changing its meaning. WebHosting's CORS policy (S5122) and Development-only plain-HTTP binding (S5332) are documented and suppressed via GlobalSuppressions.cs, following the project's existing suppression convention, because the API has no authentication (so origin restriction adds no real access control) and the HTTP binding never runs in production. Also included: a simplified ChampionshipEntity.IsFinished setter, an unnecessary null-forgiving operator removed from PacketProcessor, an unused constructor dependency removed from HealthController, and WebHosting.StopWebHosting now passes its cancellation token through to StopAsync.

This is a maintenance/chore change; no behavior changes are intended.

🎫 Issues

No related issue.

👩‍💻 Reviewer Notes

The two suppressions in GlobalSuppressions.cs are the parts most worth a close look — the justifications explain why the underlying Sonar concern doesn't apply to this project's deployment model (unauthenticated API, two independently addressable Docker images, Development-only HTTP binding). Everything else is a small, self-contained cleanup.

📑 Test Plan

No behavior changes, so no new tests were added. Existing coverage already exercises ChampionshipEntity.IsFinished, PacketProcessor's packet handling, and WebHosting's host lifecycle.

✅ Checklist

General

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the project's code style guidelines.

Backend-specific (.NET)

  • I have added or updated a repository, service, or processor in F1Server.*.
  • I have added or updated Unit Tests in F1Server.Tests for the change.
  • I have kept multi-database support in sync across F1Server.Db.MsSqlMigrations, F1Server.Db.MySqlMigrations and F1Server.Db.PostgreSqlMigrations.

⏭ Next Steps

None.

Rewords a prose comment in AppMetrics that tripped the S125
commented-code heuristic by ending a line in a semicolon. Suppresses
the S5122 and S5332 findings on WebHosting's CORS policy and
Development-only HTTP binding with documented justifications, since
the API has no authentication and the binding never runs in
production. Also simplifies the ChampionshipEntity.IsFinished setter,
removes an unnecessary null-forgiving operator in PacketProcessor,
drops an unused dependency from HealthController, and passes the
cancellation token through WebHosting.StopWebHosting.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
12.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@LarsLaskowski
LarsLaskowski merged commit 95f025c into main Aug 16, 2026
5 of 6 checks passed
@LarsLaskowski
LarsLaskowski deleted the maintenance/sonar branch August 16, 2026 13:57
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