SonarQube JavaScript
  1. SonarQube JavaScript
  2. SONARJS-55

Rule: An unconditional break statement shall terminate every non-empty switch-clause

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Activity

      Hide
      Freddy Mallet added a comment -

      Works well Evgeny, could you just replace the description by :

      When the last statement of a switch-clause is not a break statement, the control flow "falls" into the next switch-clause. Whilst this is sometimes intentional, it is often a mistake which could lead to some unexpected behaviors. 
      
      This rule doesn't apply to empty switch-clauses. Indeed those empty switch-clauses allow to specify the same behavior to a group of cases.
      
      Show
      Freddy Mallet added a comment - Works well Evgeny, could you just replace the description by : When the last statement of a switch -clause is not a break statement, the control flow "falls" into the next switch -clause. Whilst this is sometimes intentional, it is often a mistake which could lead to some unexpected behaviors. This rule doesn't apply to empty switch -clauses. Indeed those empty switch -clauses allow to specify the same behavior to a group of cases.
      Hide
      Evgeny Mandrikov added a comment -

      Done.

      Show
      Evgeny Mandrikov added a comment - Done.
      Hide
      Freddy Mallet added a comment -

      Manually tested !

      Show
      Freddy Mallet added a comment - Manually tested !

        People

        • Assignee:
          Evgeny Mandrikov
          Reporter:
          Evgeny Mandrikov
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: