SonarQube Java
  1. SonarQube Java
  2. SONARJAVA-151

Rule S00122: Statements should be on separate lines

    Details

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

      Description

      http://jira.sonarsource.com/browse/RSPEC-122

      Deprecate checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck

        Issue Links

          Activity

          Hide
          Fabrice Bellingard added a comment -

          Those cases are not taken into account:

          void foo() {
            int b = 0; b++;
          }
          
          void foo() {
            int b; int a;
          }
          

          And maybe also this case?

          class Bar {
            int a; int b;
          }
          
          Show
          Fabrice Bellingard added a comment - Those cases are not taken into account: void foo() { int b = 0; b++; } void foo() { int b; int a; } And maybe also this case? class Bar { int a; int b; }
          Hide
          Evgeny Mandrikov added a comment -

          Behaviour in first and second cases was fixed.

          And as discussed this rule won't cover third case for the moment, because this is not a statement, but a declaration. And indeed - Checkstyle has separate rule for declarations. So in future we can consider two options update this rule to also cover declarations or create a new rule.

          Show
          Evgeny Mandrikov added a comment - Behaviour in first and second cases was fixed. And as discussed this rule won't cover third case for the moment, because this is not a statement, but a declaration. And indeed - Checkstyle has separate rule for declarations. So in future we can consider two options update this rule to also cover declarations or create a new rule.
          Hide
          Fabrice Bellingard added a comment -

          Tested!

          Show
          Fabrice Bellingard added a comment - Tested!
          Hide
          Evgeny Mandrikov added a comment -

          Integration tests were updated.

          Show
          Evgeny Mandrikov added a comment - Integration tests were updated.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: