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 S1075 FP: Do not raise an issue for XML namespace URIs #8967

Open
mary-georgiou-sonarsource opened this issue Mar 21, 2024 · 0 comments
Open
Labels
Area: C# C# rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.

Comments

@mary-georgiou-sonarsource
Copy link
Contributor

Description

The syntax for such an XML namespace is a URI. but it is not used to access any network resource. As such it is not subject to the problems described in S1075.

Repro steps

using System.Xml;

private static XmlNamespaceManager CreateNamespaceManager()
{
    var namespaceManager = new XmlNamespaceManager(new NameTable());   // FP
    namespaceManager.AddNamespace("ffc", "http://www.redacted.com/namespaces/ffc"); // FP
    namespaceManager.AddNamespace("dex", "http://www.redacted.com/namespaces/dex"); // FP
    return namespaceManager;
}

Follow this past issue on which namespaces should be covered: #6223

Issue initially reported here.

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. Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

No branches or pull requests

1 participant