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 S2368 FP: Do not raise on extension methods when "this" is multidimensional array #7329

Closed
gregory-paidis-sonarsource opened this issue Jun 2, 2023 · 1 comment · Fixed by #8152
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@gregory-paidis-sonarsource
Copy link
Contributor

Description

More details can be found on this community ticket

Repro steps

public static void MatrixForEach<T>(this T[,] dataMatrix, Action<T, int, int> action) // Do not raise here, this extension method is specifically made for multi-d matrices
{ 
  // code
}

Expected behavior

Do not raise.

Actual behavior

Raises.

@gregory-paidis-sonarsource gregory-paidis-sonarsource added Type: False Positive Rule IS triggered when it shouldn't be. Area: VB.NET VB.NET rules related issues. Area: C# C# rules related issues. labels Jun 2, 2023
@gregory-paidis-sonarsource
Copy link
Contributor Author

Not sure if this should be marked as FP or Improvement, but the description of a FP is "rule is raising when it should NOT", so I think this should be taken care of as part of a hardening sprint (as we usually do we FP/FNs)

@gregory-paidis-sonarsource gregory-paidis-sonarsource changed the title Fix S2368 FP: Do not raise on extension methods where "this" is multidimensional array Fix S2368 FP: Do not raise on extension methods when "this" is multidimensional array Jun 2, 2023
@andrei-epure-sonarsource andrei-epure-sonarsource added this to the 9.13 milestone Nov 1, 2023
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. 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.

2 participants