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

Fix S4004 FP: The rule should not raise on the properties decorated with the Parameter attribute #8005

Closed
costin-zaharia-sonarsource opened this issue Sep 14, 2023 · 0 comments · Fixed by #8006
Assignees
Labels
Area: C# C# rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@costin-zaharia-sonarsource
Copy link
Member

costin-zaharia-sonarsource commented Sep 14, 2023

Description

Blazor properties need to have a public setter. There is even a rule for that: https://learn.microsoft.com/en-us/aspnet/core/diagnostics/bl0001?view=aspnetcore-7.0

S4004 recommends the opposite.

Repro steps

See: https://peach.sonarsource.com/code?id=mudblazor&branch=master&selected=mudblazor%3AMudBlazor.Docs%2FComponents%2FDocsPageSection.razor.cs

Expected behavior

The rule should not raise an issue in this case.

Actual behavior

The rule reports an issue:
image

Related information

  • C#/VB.NET Plugins version 9.9
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. Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
2 participants