Suppressed Warnings

47 views Asked by At

When using PMD on some code sets I noticed that some code files had @SuppressWarnings annotations. I am using "pmd-bin-7.0.0-rc4", and noticed that the documentation mentioned a --show-suppressed option. However, when I specify that option using the TEXT report format, I only see several lines similar to the below

<RULE NAME> rule violation suppressed by @SuppressWarnings in <FILE PATH>

How do I see the results of the violation itself, without going into the code to remove the @SuppressWarnings annotations first? It's not enough for me to just see that the violation was suppressed. I'd like to see the actual violation results. Is there a way to do that?

1

There are 1 answers

0
magentarose On

I've figured out the issue I was having. It looks like each kind of PMD report format provides varying levels of details for suppressed violations. The TEXT report format only displays which rule violations were suppressed, but doesn't provide any details. The HTML report shows line numbers, but still no details. The XML report shows the detailed violation message I was looking for, but no line numbers. The JSON report shows both detailed violation message and line numbers.