Skip to content
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

New rule S6934: You should specify the RouteAttribute when an HttpMethodAttribute is specified at an action level #8954

Merged
merged 21 commits into from
Mar 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
42f16a9
Scaffolding
martin-strecker-sonarsource Mar 18, 2024
cd74863
Fix compiler errors
martin-strecker-sonarsource Mar 18, 2024
b96d9b3
WIP: First implementation
martin-strecker-sonarsource Mar 18, 2024
da9a5ee
Fix test cases
martin-strecker-sonarsource Mar 18, 2024
5d11ac1
Refactorings
martin-strecker-sonarsource Mar 18, 2024
fb16edb
Include the full test class in #if NET
costin-zaharia-sonarsource Mar 20, 2024
fd30c37
Add more test cases
costin-zaharia-sonarsource Mar 21, 2024
69ef0d2
Add more test cases
costin-zaharia-sonarsource Mar 21, 2024
aca9cfb
Implement support for Route attribute
costin-zaharia-sonarsource Mar 21, 2024
57c6155
Document wrong reporting with partial classes
costin-zaharia-sonarsource Mar 21, 2024
d7f4354
Add compliant case with Route attribute
costin-zaharia-sonarsource Mar 21, 2024
5411043
Fix reporting on partial classes
costin-zaharia-sonarsource Mar 21, 2024
cb4f216
Implement exceptions
costin-zaharia-sonarsource Mar 21, 2024
f2d654d
Update rspec
costin-zaharia-sonarsource Mar 21, 2024
38199fc
Ensure the secondary locations are reported even if the first analyze…
costin-zaharia-sonarsource Mar 21, 2024
532393e
Reduce nesting
costin-zaharia-sonarsource Mar 21, 2024
e2f3ea0
Simplify property
costin-zaharia-sonarsource Mar 21, 2024
97d80f8
Remove the duplication special handling
costin-zaharia-sonarsource Mar 21, 2024
3042fd3
Address comments
costin-zaharia-sonarsource Mar 22, 2024
e6f4ff0
Address code review comments
costin-zaharia-sonarsource Mar 22, 2024
a2956d9
trigger build
costin-zaharia-sonarsource Mar 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add compliant case with Route attribute
  • Loading branch information
costin-zaharia-sonarsource committed Mar 22, 2024
commit d7f435472728875243f0aae86bc0e522a98396b5
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ public class RouteTemplatesAreSpecifiedController : Controller
public IActionResult Comment() => View();
}

[Route("api/[controller]")]
public class WithRouteAttributeIsCompliantController : Controller
{
[HttpGet("Test")]
public IActionResult Index() => View();
}

public class WithUserDefinedAttributeController : Controller // Noncompliant [customAttribute]
{
[MyHttpMethod("Test")]
Expand Down