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 S1128 FN: unused using alias directives #8128

Open
cristian-ambrosini-sonarsource opened this issue Oct 2, 2023 · 1 comment
Open

Fix S1128 FN: unused using alias directives #8128

cristian-ambrosini-sonarsource opened this issue Oct 2, 2023 · 1 comment
Labels
Area: C# C# rules related issues. Area: C#12 C#12 related issues Type: False Negative Rule is NOT triggered when it should be.

Comments

@cristian-ambrosini-sonarsource
Copy link
Contributor

The rule does not take into account for unnecessary using alias directives to alias tuple types, array types, pointer types, or other unsafe types.

using Person = (string name, string surname); // FN
using unsafe IntPointerExt = int*; // FN
using IntArray = int[]; // FN

namespace ANamespace
{
    using Point2D = (int, int); // FN
    using unsafe IntPointer = int*; // FN: unused
}
@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource added Type: False Negative Rule is NOT triggered when it should be. Area: C#12 C#12 related issues labels Oct 2, 2023
@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource changed the title Fix S1128 FN: using alias directive to alias any type Fix S1128 FN: unused using alias directive to alias any type Oct 2, 2023
@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource changed the title Fix S1128 FN: unused using alias directive to alias any type Fix S1128 FN: unused using alias directives Oct 2, 2023
@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource moved this from To do to In progress in Best Kanban Oct 19, 2023
@cristian-ambrosini-sonarsource
Copy link
Contributor Author

I'm moving back this task to 'ToDo' as we propose to align the rule with Roslyn's CS8019 interception. For more details, please refer to this Scanner issue. This proposed solution would address this issue, along with all other open issues associated with this rule.

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: C#12 C#12 related issues Type: False Negative Rule is NOT triggered when it should be.
Projects
None yet
Development

No branches or pull requests

2 participants