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 S1654 FP: Do not report on event handlers, interfaces and overrides #7137

Closed
PavlinII opened this issue Apr 30, 2023 · 2 comments · Fixed by #9388
Closed

Fix S1654 FP: Do not report on event handlers, interfaces and overrides #7137

PavlinII opened this issue Apr 30, 2023 · 2 comments · Fixed by #9388
Assignees
Labels
Area: VB.NET VB.NET rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@PavlinII
Copy link
Contributor

When a method is an event handler, the parameter names should follow parameter names from the event.

When the regex from S1654 does not allow the parameter, it should not raise

Warning S1654 Rename this parameter to match the regular expression: '^(id_)?[A-Z]{1,3}([a-z0-9]+[A-Z]{0,3})*$'.

Private Sub dtS_ColumnChanged(sender As Object, e As DataColumnChangeEventArgs) Handles dtS.ColumnChanged
//                            ^^^^^^
//                                              ^

S1654 should not raise on methods that contains Handles keyword

@pavel-mikula-sonarsource pavel-mikula-sonarsource added Type: False Positive Rule IS triggered when it shouldn't be. Area: VB.NET VB.NET rules related issues. labels May 1, 2023
@martin-strecker-sonarsource
Copy link
Contributor

Besides Handles, Implements should also be added as an exception, IMO.

@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource added this to the 9.7 milestone Jul 26, 2023
@martin-strecker-sonarsource martin-strecker-sonarsource removed this from the 9.7 milestone Aug 4, 2023
@pavel-mikula-sonarsource pavel-mikula-sonarsource added this to the 9.27 milestone Jun 4, 2024
@pavel-mikula-sonarsource pavel-mikula-sonarsource changed the title Fix S1654 FP: Do not report on event handlers Fix S1654 FP: Do not report on event handlers, interfaces and overrides Jun 4, 2024
@pavel-mikula-sonarsource
Copy link
Contributor

Same for method that overrides base methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: VB.NET VB.NET rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants