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

"union" names should comply with a naming convention

    Details

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

      Key: format
      Description: Regular expression union names should match.
      Default: ^[A-Z][a-zA-Z0-9]*$
      Type: STRING

      Show
      Key: format Description: Regular expression union names should match. Default: ^ [A-Z] [a-zA-Z0-9] *$ Type: STRING
    • Default Severity:
      Minor
    • Impact:
      Low
    • Likelihood:
      Low
    • Covered Languages:
      C, C++, Objective-C
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      10min

      Description

      Sharing some naming conventions enables teams to collaborate more efficiently. This rule checks that all union names match a provided regular expression.

      Noncompliant Code Example

      Using the default regular expression ^[A-Z][a-zA-Z0-9]*$:

      union my_union {
          int one;
          int two;
      };
      

      Compliant Solution

      union MyUnion {
          int one;
          int two;
      };
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                evgeny.mandrikov Evgeny Mandrikov
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: