Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-3841

targetNamespaces should comply with a naming convention

    XMLWordPrintable

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Rename this "targetNamespace" to match the regular expression: ${format}.
    • Highlighting:
      Hide

      Namespace value

      Show
      Namespace value
    • List of parameters:
      Hide
      • Key: format
      • Description: Regular expression used to check targetNamespaces against
      • Default value: ^http:\/ {2}

        www\.*\/.

      Show
      Key: format Description: Regular expression used to check targetNamespaces against Default value: ^http:\/ {2} www\.* \/.
    • Default Severity:
      Minor
    • Impact:
      Low
    • Likelihood:
      Low
    • Targeted languages:
      XML
    • Irrelevant for Languages:
      ABAP, C#, C, C++, Cobol, CSS, Flex, HTML, Java, JavaScript, Objective-C, PHP, PL/I, PL/SQL, Python, RPG, Swift, VB.Net, VB6
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      5min
    • Analysis Scope:
      Main Sources, Test Sources

      Description

      Sharing naming conventions allows teams to collaborate efficiently. This rule checks that targetNamespaces match a provided regular expression.

      Noncompliant Code Example

      With the default regular expression: http://www+

      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                 elementFormDefault="qualified" version="1"
                  targetNamespace="fruit">  <!-- Noncompliant -->
      ...
      

      Compliant Solution

      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                 elementFormDefault="qualified" version="1"
                 targetNamespace="http://www.codeSamples.com/fruit">
      ...
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ann.campbell.2 Ann Campbell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: