4 Replies Latest reply on Nov 30, 2009 12:32 AM by Xavier Agnetti

    Cannot suppress a specific violation

    smirnoff81 Level 1

      Hi,

       

      I downloaded RC5 and tried to suppress a specific violation but it didn't work.

      Please see ticket FLEXPMD-88 for detailed information. The status of the ticket is "Closed/Fixed" however the problem is still there.

       

      I have two questions...

      1. What exactly the syntax is to suppress a specific violation?

      I tried 4 ways but none of them suppresses the mentioned violation. In fact all of them suppress all violations. These are the 4 ways I tried this feature:

      // NO PMD AlertShow
      // NO PMD AlertShowRule
      // NO PMD com.adobe.ac.pmd.rules.maintanability.AlertShow
      // NO PMD com.adobe.ac.pmd.rules.maintanability.AlertShowRule

       

      2. How should we proceed with the ticket related to this problem? Do we reopen the old ticket or create a copy of it?

      I believe the old ticket FLEXPMD-88 should be reopen mentioning that the issue is still present in RC5 because this ticket is in the list of RC5 changes. The point is not to stress that an issue was not properly solved in RC5 but to keep the RC5 state transparent to all people who may use it. They may go through the RC5 change list and see that FLEXPMD-88 was closed/fixed and if we create another ticket they won't immediately get the information that suppressing a specific violation is still open.


      Unfortunately I cannot reopen the old ticket. Probably an Adobe employee can so I will expect your answer before doing anything in JIRA.

       

      Thanks

        • 1. Re: Cannot suppress a specific violation
          Xavier Agnetti Adobe Employee

          I reopened the issue.

           

          You are right. It does not work as expected. I will fix it and smoke test it.

           

          Thanks

           

          Xavier

          • 2. Re: Cannot suppress a specific violation
            Xavier Agnetti Adobe Employee

            Are you using Maven or Ant?

            If you use Maven, I will publish the snapshot artifacts with the fix in place.

             

            Xavier

            1 person found this helpful
            • 3. Re: Cannot suppress a specific violation
              smirnoff81 Level 1

              Hi Xavier,

               

              Thanks for the quick reaction to the issue!

              Currently there are a lot of places in the source code where suppressing is needed and a fix earlier than the next RC would make the FlexPMD reports defintely more meaningful. This would be really appreciated!

              I invoke FlexPMD as a command-line tool. It is not integrated neither in Ant script nor Maven.

               

              A few remarks to the possible fix:

              1. Please make it somehow clear what the exact syntax is. In the bug I mentioned 4 ways to suppress a violation but I still don't know which is the right one. Probably all are wrong.

              2.  Suppressing by // NO PMD <RuleName> must not lead to suppressing all violations in case the <RuleName> doesn't match existing rule name. This is important because in case a rule name changes from a version to version or the developer enters wrong rule name they should not get suppressing for all violations. This would happen silently to them and it may lead to hiding other problems. In case it is a wrong rule name then nothing should be suppressed.

              3. FlexPMD should trace during parsing what exactly gets suppressed and at which line number. This will keep developers and the tool on the same page.

               

              Thanks a lot for your hard work!

              • 4. Re: Cannot suppress a specific violation
                Xavier Agnetti Adobe Employee

                1. The four ways you mentioned are now working. They were supposed to work in RC5, but it did not as you noticed. It is now fixed and unit-tested against trunk. It will be in the next release which will happen soon.

                2. That's the way it is now working.

                3. Good idea. I will add it.

                 

                Thanks again for your report.

                 

                Xavier