Skip to content

Fix for Useless assignment to local variable#305

Merged
samsmithnz merged 2 commits intomainfrom
finding-autofix-93f80890
Dec 5, 2025
Merged

Fix for Useless assignment to local variable#305
samsmithnz merged 2 commits intomainfrom
finding-autofix-93f80890

Conversation

@samsmithnz
Copy link
Copy Markdown
Collaborator

To address the issue, remove the assignment to the result variable in CountMandMsInA1CubicNullUnitTest() and invoke Calculator.CountMandMs(unit, height, width, length); as a standalone statement. This retains the exception-throwing behavior for invalid input but avoids introducing an unused local variable. The only line to change in the shown code is line 233 in the src/MandMCounter.Tests/MandMTests.cs file: replace the assignment to result with just the method call. No other code, imports, or definitions are affected.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@samsmithnz samsmithnz marked this pull request as ready for review December 5, 2025 13:48
@samsmithnz samsmithnz enabled auto-merge December 5, 2025 13:48
@samsmithnz samsmithnz merged commit c44793b into main Dec 5, 2025
6 checks passed
@samsmithnz samsmithnz deleted the finding-autofix-93f80890 branch December 5, 2025 13:51
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