Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-3749

Rule S6205: Switch arrow labels should not use redundant keywords

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.15
    • Component/s: Rules
    • Labels:

      Description

      Implements RSPEC-6205.

      This rule targets only "arrow label", not the original two dots (':').

      We want to report 4 situations, with 4 different messages:

      • For Switch Expression, when a block contains a single yield -> "Remove this redundant block and yield."
      • If a block as the body of the case group contains a single statement (which is not a yield) -> "Remove this redundant block."
      • For Switch Statement, when a block contains a break and one additional statement -> "Remove this redundant block and break."
        • If more than two -> "Remove this redundant break."

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                quentin.jaquier Quentin Jaquier
                Reporter:
                quentin.jaquier Quentin Jaquier
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: