SonarQube
  1. SonarQube
  2. SONAR-1760

Support the annotation "@SuppressWarnings" at class and method level

    Details

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

      Description

      The //NOSONAR tag is useful to deactivate all rules at a given line but is not suitable to deactivate all rules (or only a given rule) for all the lines of a method or a class.

      In that case, the use of the @SuppressWarnings would perfectly fit the needs.

      The excepted value to deactivate all rules would be :

      @SuppressWarnings("all") //which is pretty standard
      

      The excepted value to deactivate only one rule or a list of rules would be :

      @SuppressWarnings("MY_RULE_KEY")
      @SuppressWarnings({"MY_RULE_KEY1","MY_RULE_KEY2})
      

        Issue Links

          Activity

          Hide
          Evgeny Mandrikov added a comment -

          Together with Freddy we decided that as first step we must support only

          @SuppressWarnings("all")

          , so done in r6048.

          Also note that this annotation disables all violations, even produced by Checkstyle rule SuppressWarnings, but not new Squid rule (SONAR-1817). So maybe we should create analogue of this rule, but for annotation.

          Show
          Evgeny Mandrikov added a comment - Together with Freddy we decided that as first step we must support only @SuppressWarnings( "all" ) , so done in r6048 . Also note that this annotation disables all violations, even produced by Checkstyle rule SuppressWarnings, but not new Squid rule ( SONAR-1817 ). So maybe we should create analogue of this rule, but for annotation.
          Hide
          Evgeny Mandrikov added a comment -

          Fixed for class level in r6381.

          Show
          Evgeny Mandrikov added a comment - Fixed for class level in r6381 .

            People

            • Assignee:
              Freddy Mallet
              Reporter:
              Freddy Mallet
            • Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: