SonarQube Java
  1. SonarQube Java
  2. SONARJAVA-190

Rule: Left curly braces should be located at the beginning of lines of code

    Details

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

      Description

      This tickets leads to the depreciation of the Checkstyle rule com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck.

        Issue Links

          Activity

          Hide
          Freddy Mallet added a comment -
          Show
          Freddy Mallet added a comment - Implements http://jira.sonarsource.com/browse/RSPEC-1106
          Hide
          Dinesh Bolkensteyn added a comment -

          Done

          Show
          Dinesh Bolkensteyn added a comment - Done
          Hide
          Dinesh Bolkensteyn added a comment -

          178,722 violations, such a high number was expected

          Show
          Dinesh Bolkensteyn added a comment - 178,722 violations, such a high number was expected
          Hide
          Fabrice Bellingard added a comment - - edited

          The following case generates a false positive:

          String[] array = new String[] {"", "", ""};
          

          IMO, if a left and corresponding right curly braces are on the same line, then this check should be disabled.

          Let's discuss this.

          Show
          Fabrice Bellingard added a comment - - edited The following case generates a false positive: String [] array = new String [] { "", " ", " "}; IMO, if a left and corresponding right curly braces are on the same line, then this check should be disabled. Let's discuss this.
          Hide
          Dinesh Bolkensteyn added a comment -

          As discussed, we're not going to apply this rule against array initializers and annotations, but only to code blocks.

          Show
          Dinesh Bolkensteyn added a comment - As discussed, we're not going to apply this rule against array initializers and annotations, but only to code blocks.
          Hide
          Dinesh Bolkensteyn added a comment -

          Done

          Show
          Dinesh Bolkensteyn added a comment - Done
          Hide
          Dinesh Bolkensteyn added a comment -

          Difference: expected: 178722, actual: 174202

          Show
          Dinesh Bolkensteyn added a comment - Difference: expected: 178722, actual: 174202
          Hide
          Fabrice Bellingard added a comment -

          Tested.

          Show
          Fabrice Bellingard added a comment - Tested.

            People

            • Assignee:
              Dinesh Bolkensteyn
              Reporter:
              Freddy Mallet
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: