pmd / pmd

An extensible multilanguage static code analyzer.

Home Page:https://pmd.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PMD "broke" when use 'as user'

pablogomez2197 opened this issue · comments

[apex]
Affects PMD Version:
v7.0.0.rc4
Rule:
All
Please provide the rule name and a link to the rule documentation:
https://docs.pmd-code.org/latest/pmd_rules_XXX_XXX.html#XXX

Description:
I have an apex class where I have a lot apex warning/problems, but when i put 'as user' in the code all of them dissapears.
Code Sample demonstrating the issue:
image
and then:
image

Expected outcome:
The expeted outcome it's the warning and problems, all of them.
PMD should report a violation at line ..., but doesn't. This is a false-negative.

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]

This is fixed in PMD 7.0.0, see #3973

We have that version installed and it keeps happening to us.
Sorry I have already seen it. Thank you

@pablogomez2197 From the screenshots, you are using vscode-apex-pmd, aren't you?
This extension by default uses 7.0.0-rc3, which doesn't support #3973, which was only fixed in 7.0.0-rc4 (or later).

You would need to configure the "PmdBinPath" of the extension to point to a PMD 7.0.0 installation, see configuration in order to use the new version.

You will also need to provide your own ruleset, as the default ruleset by the extension is not compatible with PMD 7.0.0 anymore (see ChuckJonas/vscode-apex-pmd#158).