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

Coroutine names should comply with a naming convention

    XMLWordPrintable

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Rename coroutine "XXXX" to match the regular expression ${format}.
    • Default Severity:
      Minor
    • Impact:
      Low
    • Likelihood:
      Low
    • Default Quality Profiles:
      Sonar way
    • Legacy Key:
      MethodName
    • Targeted languages:
      C++
    • Irrelevant for Languages:
      Cobol, HTML, PL/I, PL/SQL, T-SQL, XML
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      5min
    • Analysis Level:
      Syntactic Analysis
    • Analysis Scope:
      Main Sources, Test Sources
    • Common Rule:
      Yes
    • Checkstyle:
      MethodName, AbbreviationAsWordInName
    • ESLint:
      id-length, id-match, no_underscore_dangle
    • FindBugs:
      NM_METHOD_NAMING_CONVENTION
    • PMD:
      MethodNamingConventions, ShortMethodName
    • Pylint:
      C0103
    • ReSharper:
      InconsistentNaming

      Description

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

      Noncompliant Code Example

      With default provided regular expression: ^[a-z][a-zA-Z0-9]*$:

      generator<int> Iota(int n = 0) {
        while(true)
          co_yield n++;
      }

      Compliant Solution

      generator<int> iota(int n = 0) {
        while(true)
          co_yield n++;
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              freddy.mallet Freddy Mallet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: