Skip to content

Fix S1075 FP: Do not raise an issue for XML namespace URIs #8967

Open
@mary-georgiou-sonarsource

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Area: C#C# rules related issues.Type: False PositiveRule IS triggered when it shouldn't be.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions