-
Notifications
You must be signed in to change notification settings - Fork 238
New rule S6932: Use model binding instead of reading raw request data #8953
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
Conversation
|
|
094e1ee to
b892fbb
Compare
f798a43 to
f71058e
Compare
cf1cf61 to
ee4a89a
Compare
a907dbd to
e0d6cf2
Compare
b269fb7 to
bedee1d
Compare
d4b3db7 to
e4fa96c
Compare
zsolt-kolbay-sonarsource
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Very well documented and optimized! Left a couple of polishing comments.
analyzers/tests/SonarAnalyzer.Test/TestCases/AspNet/UseAspNetModelBinding_AspNetCore.cs
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/UseAspNetModelBinding.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/UseAspNetModelBinding.cs
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/UseAspNetModelBinding.cs
Outdated
Show resolved
Hide resolved
analyzers/tests/SonarAnalyzer.Test/Rules/AspNet/UseAspNetModelBindingTest.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/Rules/AspNet/UseAspNetModelBinding.cs
Outdated
Show resolved
Hide resolved
|
|
|
Peach validation:
The issues are raised for
Most of the issues are TPs. A lot of FPs are in helper methods of controllers where data is extracted conditionally. It is debatable whether we need to fix these: Some accesses are problematic for other reasons as well, like using IHttpContextAccessor here. Some FPs are undetectable like here or here, where FileFormCollection binding is insufficient for the use case. One FP should be fixed: Access to |








Fixes #8871
Based on #8950
Replaces #8930