-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix S6964 FP: Do not raise in properties with required modifier #9285
Labels
Area: C#
C# rules related issues.
Sprint: Hardening
Fix FPs/FNs/improvements
Type: False Positive
Rule IS triggered when it shouldn't be.
Projects
Milestone
Comments
Hello @cremor. The rule does take into consideration the Thanks! |
My issue is about the |
@cremor I misread - my bad. Thanks a lot! I confirm this is a false positive. We'll tackle it soon, as we plan to harden the ASP.NET rules in the following weeks. |
mary-georgiou-sonarsource
added
Area: C#
C# rules related issues.
Type: False Positive
Rule IS triggered when it shouldn't be.
labels
May 17, 2024
mary-georgiou-sonarsource
changed the title
Fix S6964 FP: Properties with the
Fix S6964 FP: Do not raise in properties with required modifier
May 17, 2024
required
keyword should be ignored
antonioaversa
pushed a commit
that referenced
this issue
May 17, 2024
github-actions
bot
assigned zsolt-kolbay-sonarsource and unassigned mary-georgiou-sonarsource
May 21, 2024
github-actions
bot
assigned mary-georgiou-sonarsource and unassigned zsolt-kolbay-sonarsource
May 21, 2024
github-actions
bot
moved this from Review in progress
to Review approved
in Best Kanban
May 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: C#
C# rules related issues.
Sprint: Hardening
Fix FPs/FNs/improvements
Type: False Positive
Rule IS triggered when it shouldn't be.
Description
The rule S6964 should not be active for model properties that use the
required
keyword. Those properties can never be under-posted because the JSON deserialization for them fails.Repro steps
required
properties (e.g.required int
) and use it in a POST controller method.[Required]
attribute manually.Expected behavior
Rule should not be reported.
Actual behavior
Rule is reported.
Known workarounds
I had to create a new quality profile in SonarCloud to disable the rule completely.
Related information
SonarCloudPrepare@1
task)SonarCloudAnalyze@1
task)windows-latest
build agent on Azure DevOpsThe text was updated successfully, but these errors were encountered: