Uploaded image for project: 'SonarSlang'
  1. SonarSlang
  2. SONARSLANG-336

[Slang] FP on ternary operator S134: Control flow statements should not be nested too deeply

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: Metrics
    • Labels:
      None

      Description

      Rule RSPEC-134 should not raise issues on ternary operators.

      Slang have the same AST node "if" that can be used in two different context:
      A statement:

      if (condition) {
        foo()
      }
      

      A ternary operator (in a expression):

      x = if (condition) 1 else 2
      

      Rule S134 should only raise issue on statement.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alban.auzeill Alban Auzeill
                Reporter:
                alban.auzeill Alban Auzeill
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: