PMD Apex always returns no suspicious files
Even though I have hundreds of PMD issues in my project.
Using IC2 in IDEA
Comments (13)
-
repo owner -
reporter - attached ideaPMDApexProb.log
Here is the log . Thanks as always for the amazing responsiveness.
-
repo owner It appears to be a bug/internal error in PMD Apex:
java.lang.ClassCastException: net.sourceforge.pmd.lang.apex.ast.ASTFormalComment cannot be cast to net.sourceforge.pmd.lang.apex.ast.ApexNode at net.sourceforge.pmd.lang.apex.rule.design.ExcessiveNodeCountRule.visit(ExcessiveNodeCountRule.java:42) ...
What version of PMD Apex are you using, and where did you get your ruleset?
-
reporter PMD 6.8, ruleset came from the link in the PMD Apex UI
-
repo owner Okay, and does the same error occur if you run PMD from the command-line? My guess is that it will. Here's how IC executes it:
/home/jeff/Downloads/pmd-bin-6.8.0/bin/run.sh pmd -dir /home/jeff/AAIlluminate/btek-probo-devint914/src -language apex -R /home/jeff/AAIlluminate/StartingPMDRuleSet.xml -f xml -no-cache
Assuming it does, you'll probably need to log a case against PMD Apex itself, but let's see what happens first.
-
reporter yep -- same error. Bummer.
-
reporter just tried with PMD 6.4 and got the same error
-
repo owner Okay, if that's the case then I would file an issue here:
https://github.com/pmd/pmd/releases/tag/pmd_releases/6.8.0
and since you can reproduce it via the CLI, you'll likely get the best/quickest response if you lead with that rather than via the IC integration. Otherwise that will be the first thing they ask you to do.
I'll be curious to know what you find. Feel free to at-mention me there to pull me in if you'd like. I'm
SCWells72
on GitHub and have worked with that team on issues like this in the past. -
reporter thanks!
-
reporter Update -- using my old ruleset (instead of the 'starter' ruleset via the link in the IDEA Inspection Settings), and using PMD 6.4 (instead of 6.8) runs successfully. I will post more followup when I hear from the PMD team.
-
repo owner Ah, okay. So perhaps something has changed with one of the rule implementations that's incompatible with a particular ruleset. Hopefully the PMD team will know what's going on. Certainly a
ClassCastException
seems like a bug to me, though. -
reporter Update -- this is being tracked on the PMD Apex Github Issue #[1396]
-
repo owner - changed status to resolved
Okay, thanks for the update. I'm going to resolve this issue since it's a PMD problem and not an IC problem. I'll also subscribe to the PMD issue so I can keep tabs on it. Thanks again!
- Log in to comment
Hi, Jeff. You can enable debug logging for IC's execution of PMD Apex as documented here:
http://www.illuminatedcloud.com/support/debuglogging
and see in your
idea.log
(Help>Show Log in Explorer/Finder/Files) what might be going on. Feel free to attach/email the log for my review if you'd like.