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

Attributes should comply with a naming convention

    XMLWordPrintable

    Details

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

      name value

      Show
      name value
    • List of parameters:
      Hide

      Key: format
      Description: Regular expression used to check attribute names against.
      Default: ^[a-z]([A-Z][a-z0-9])*$

      Show
      Key: format Description: Regular expression used to check attribute names against. Default: ^ [a-z] ( [A-Z] [a-z0-9] )*$
    • 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

      Shared naming conventions allow teams to collaborate efficiently. This rule checks that all attribute names match a provided regular expression.

      Noncompliant Code Example

      With the default regular expression:

      <xs:element name="fruit">
        ...
        <xs:attribute name="FLESH_COLOR" type="xs:string">     <!-- Noncompliant -->
      </xs:element>
      

      Compliant Solution

      <xs:element name="fruit">
        ...
        <xs:attribute name="fleshColor" type="xs:string">
      </xs:element>
      

        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: