[Bug] SonarQube S4275: property setter assigns the wrong field (FileUploadScan) #240

Closed
opened 2026-06-19 18:44:00 +00:00 by spikerj · 1 comment
Owner

Surfaced by SonarQube (api.spikersoft.com), rule csharpsquid:S4275, severity CRITICAL (RELIABILITY).

Problem

A property setter refers to a different field than its getter, so writes silently do not affect the value the getter returns. This is a genuine logic bug.

Location

  • spikersoft-backend/SpikerSoft.Data/Mongos/FileUploadScan.cs:33 — "Refactor this setter so that it actually refers to the field _status."

Fix

Point the setter at _status (the same field the getter reads) and add/verify a test that round-trips the property.

Rule: https://rules.sonarsource.com/csharp/RSPEC-4275/

Surfaced by SonarQube (`api.spikersoft.com`), rule `csharpsquid:S4275`, severity CRITICAL (RELIABILITY). ## Problem A property setter refers to a different field than its getter, so writes silently do not affect the value the getter returns. This is a genuine logic bug. ## Location - `spikersoft-backend/SpikerSoft.Data/Mongos/FileUploadScan.cs:33` — "Refactor this setter so that it actually refers to the field `_status`." ## Fix Point the setter at `_status` (the same field the getter reads) and add/verify a test that round-trips the property. _Rule: https://rules.sonarsource.com/csharp/RSPEC-4275/_
spikerj added the bugsonarqube labels 2026-06-19 18:44:00 +00:00
Author
Owner

Resolved in spikersoft-backend PR #12 (merged to master). FileUploadScan.Status setter now assigns _status instead of the compiler field, so status writes are no longer dropped. Closing.

Resolved in spikersoft-backend PR #12 (merged to `master`). `FileUploadScan.Status` setter now assigns `_status` instead of the compiler `field`, so status writes are no longer dropped. Closing.
Sign in to join this conversation.