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

Label names should comply with a naming convention

    XMLWordPrintable

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Rename label "xxx" to match the regular expression: xxx
    • List of parameters:
      • key: format
      • description: Regular expression used to check the label names against.
      • default: ^[A-Z][A-Z0-9_]*$
    • Default Severity:
      Minor
    • Impact:
      Low
    • Likelihood:
      Low
    • Default Quality Profiles:
      Sonar way
    • Targeted languages:
      C#, Flex, Java
    • Covered Languages:
      C, C++, Objective-C
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      5min

      Description

      Shared coding conventions allow teams to collaborate effectively. This rule checks that labels match a provided regular expression.

      Noncompliant Code Example

      With default provided regular expression ^[A-Z][A-Z0-9_]*$:

      exit:  // Noncompliant
        doCleanup();
      

      Compliant Solution

      EXIT:  // Compliant
        doCleanup();
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated: