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 S3242: Do not suggest ICollection<KVP<TKey, TValue>> #782

Closed
Evangelink opened this issue Sep 15, 2017 · 2 comments
Closed

Fix S3242: Do not suggest ICollection<KVP<TKey, TValue>> #782

Evangelink opened this issue Sep 15, 2017 · 2 comments
Assignees
Labels
Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@Evangelink
Copy link
Contributor

The current implementation of the rule is currently raising quite a lot of FP and we should came up with some ideas about tuning the rule to Kill the Noise.

For example:
1/ Do not suggest a non-generic base type (i.e. not IEnumerable over IEnumerable<T>).

2/ Do not suggest ICollection<KeyValuePair<TKey, TValue>> over IDictionary<TKey, TValue>.

Let's have a look at sonarcloud and peach to try to find the right patterns.

@Evangelink Evangelink added Area: RSPEC Type: False Positive Rule IS triggered when it shouldn't be. labels Sep 15, 2017
@michalb-sonar michalb-sonar added this to the 6.6 milestone Oct 16, 2017
@Evangelink Evangelink self-assigned this Oct 19, 2017
@Evangelink
Copy link
Contributor Author

I cannot reproduce the issue (neither the non-generic nor the ICollection<KeyValuePair<TKey, TValue>>).

@michalb-sonar
Copy link
Contributor

Re 2)

public void Test_03(Dictionary<string, string> foo)
{
    var x = foo.Count;
}

@Evangelink Evangelink changed the title Fix S3242: Kill the noise Fix S3242: Do not suggest ICollection<KVP<TKey, TValue>> Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

No branches or pull requests

2 participants