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 S6966 FP: Don't raise on XmlReader and XmlWriter methods #9336

Closed
denis-troller opened this issue May 27, 2024 · 1 comment · Fixed by #9364
Closed

Fix S6966 FP: Don't raise on XmlReader and XmlWriter methods #9336

denis-troller opened this issue May 27, 2024 · 1 comment · Fixed by #9364
Assignees
Labels
Area: C# C# rules related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@denis-troller
Copy link

Description

Rule S6966 raises on XMLReader methods, however the ability to use these methods successfully depends on whether the object was created with the Async flag set to true in its settings.
Unless the creation is in scope, we should not raise on those as the ability to use those methods might not be under the user's control.

@mary-georgiou-sonarsource mary-georgiou-sonarsource added Type: False Positive Rule IS triggered when it shouldn't be. Area: C# C# rules related issues. Sprint: Hardening Fix FPs/FNs/improvements labels May 27, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource added this to the 9.26 milestone May 27, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title Fix S6966 FP/FN: XMLReader.MoveToContentAsync depends on a setting Fix S6966 FP: XMLReader.MoveToContentAsync depends on a setting May 30, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title Fix S6966 FP: XMLReader.MoveToContentAsync depends on a setting Fix S6966 FP: XmlReader and XmlWriter async methods depend on XmlReaderSettings.Async Property May 30, 2024
@mary-georgiou-sonarsource
Copy link
Contributor

mary-georgiou-sonarsource commented May 30, 2024

What the description mentions happens also for XmlWriter methods.

As it's complicated for now to support the scenario where we check if the settings provided to the XmlReader/Writer constructor have the async property set as true (requires SE), we'll exempt all the methods coming from XmlReader and XmlWriter.

@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title Fix S6966 FP: XmlReader and XmlWriter async methods depend on XmlReaderSettings.Async Property Fix S6966 FP: Don't raise on XmlReader and XmlWriter async methods May 30, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title Fix S6966 FP: Don't raise on XmlReader and XmlWriter async methods Fix S6966 FP: Don't raise on XmlReader and XmlWriter methods May 30, 2024
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. Sprint: Hardening Fix FPs/FNs/improvements Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants