Skip navigation
jacornwell
Currently Being Moderated

Is there a way to suppress warnings in FlexPMD?

Sep 22, 2009 2:25 PM

In PMD there is the @SuppressWarnings java annotation that can be used to suppress all or individual warnings in a class. Is there anything similar that can be added in an AS or MXML file with FlexPMD?

 
Replies
  • Currently Being Moderated
    Sep 22, 2009 11:24 PM   in reply to jacornwell

    So there is a way to suppress one or all violations in a given line by appending // NO PMD or // NO PMD ruleName

    There is no way at the moment to ignore every violation at a class level, or function level using metadata.

     

    Feel free to add a feature request if you think it is needed.

     

    Xavier

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 23, 2009 7:45 AM   in reply to jacornwell

    Glad to hear that.

     

    To be more accurate, // NO PMD ruleName has been added in Rc4, that has been released today

     

    Cheers,

     

    Xavier

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 14, 2009 2:32 PM   in reply to Xavier Agnetti

    FlexPMD is giving me a warning "adobe.ac.pmd.rules.performance.CreationPolicySetToAll" in an <mxml:Application> declaration. Is there a way to suppress this warning, or am I out of luck?

     

    Thanks -

    Marc

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 15, 2009 2:41 AM   in reply to Marc Kubischta

    Can you attach an example?

     

    Xavier

     
    |
    Mark as:
  • Currently Being Moderated
    May 6, 2010 7:56 AM   in reply to Xavier Agnetti

    Xavier,

     

    I am seeing tons of warning messages as under. I am using ANT target to invoke FlexPMD. Can you suggest a way I can hide these messages ? I did //NO PMD for all our rules ...

     

    [flexPmd] WARNING: Open quote is expected for attribute "type" associated with an  element type  "node". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un known Source)
      [flexPmd] org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
      [flexPmd] org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      [flexPmd] May 6, 2010 10:49:44 AM de.bokelberg.flex.parser.AS3Scanner$XMLVerifier verify
      [flexPmd] WARNING: The markup in the document preceding the root element must be well-formed. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un known Source)
      [flexPmd] org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
      [flexPmd] org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      [flexPmd] May 6, 2010 10:49:44 AM de.bokelberg.flex.parser.AS3Scanner$XMLVerifier verify
      [flexPmd] WARNING: Open quote is expected for attribute "label" associated with an  element type  "workItems". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un known Source)
      [flexPmd] org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
      [flexPmd] org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      [flexPmd] May 6, 2010 10:49:44 AM de.bokelberg.flex.parser.AS3Scanner$XMLVerifier verify
      [flexPmd] WARNING: Open quote is expected for attribute "type" associated with an  element type  "nodes". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un known Source)
      [flexPmd] org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
      [flexPmd] org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      [flexPmd] May 6, 2010 10:49:44 AM de.bokelberg.flex.parser.AS3Scanner$XMLVerifier verify
      [flexPmd] WARNING: Open quote is expected for attribute "type" associated with an  element type  "nodes". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un known Source)
      [flexPmd] org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
      [flexPmd] org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      [flexPmd] May 6, 2010 10:49:44 AM de.bokelberg.flex.parser.AS3Scanner$XMLVerifier verify
      [flexPmd] WARNING: Open quote is expected for attribute "type" associated with an  element type  "nodes". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un known Source)
      [flexPmd] org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
      [flexPmd] org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2010 1:14 AM   in reply to MSheth

    This warning has been removed.

     

    Cheers,

     

    Xavier

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 24, 2011 4:44 AM   in reply to Xavier Agnetti

    In the current release of FlexPMD is there a way to suppress errors/warnings on the class level yet?

     

    Thanks,

    Borek

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points