Skip to main content
Inspiring
November 27, 2009
Question

Cannot suppress a specific violation

  • November 27, 2009
  • 1 reply
  • 797 views

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

This topic has been closed for replies.

1 reply

Adobe Employee
November 27, 2009

I reopened the issue.

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

Thanks

Xavier

Adobe Employee
November 27, 2009

Are you using Maven or Ant?

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

Xavier

Inspiring
November 27, 2009

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!