872 questions
0
votes
0
answers
76
views
Using PMD cpd code duplication checker, how to check for duplication for a few files in a bigger repo
At my job we are using the PMD cpd tool to check for code duplication in our C++ repository. This tool runs once every now and then on the entire repository, but this is quite slow. For in between ...
0
votes
0
answers
62
views
Why does WITH SECURITY_ENFORCED throw "Insufficient permissions" when querying EmailTemplate in Salesforce?
I’m trying to query the EmailTemplate object in Salesforce with WITH SECURITY_ENFORCED to respect CRUD/FLS, but I get an error even though the user has access to Email Templates.
List<EmailTemplate&...
1
vote
1
answer
64
views
Cannot resolve rule/ruleset reference 'upstream.xml'. Make sure the resource is a valid file or URL and is on the CLASSPATH
I am confused about where PMD looks for ruleset files. I have some rulesets I am trying to reuse from an old project in a set of mavan projects. In that project the ruleset was referenced through a ...
0
votes
1
answer
44
views
Cyclomatic Complexity between deeply nested if statements and multiple separated if-conditions
I have a code snippet of deeply nested if statements and another code snippet of multiple separated if statements.
These 2 cases have same CC point.
Follow PMD rule (Project Mistake Detector), could ...
0
votes
1
answer
37
views
Running PMD yields empty result
I want to use pmd (v7.11) to calculate the cyclic complexity of a Java file. To this end, I created file ruleset.xml with this content:
<?xml version="1.0"?>
<ruleset name="...
0
votes
1
answer
102
views
How to import PMD reports into SonarQube?
I'm working on creating custom rules for checking PL/SQL in GitLab merge requests. I'm using SonarQube 9.9 (+ PL/SQL Community plugin) for analysis and report generation.
SonarQube does not support ...
0
votes
0
answers
33
views
PMD version: 7.3.0 java.lang.IllegalArgumentException: Unsupported class file major version 67 with Java 23 [duplicate]
I am trying to run PMD with a Java 23 project.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3....
0
votes
1
answer
212
views
PMD Designer. The environment variable JAVAFX_HOME is missing
I installed the PMD using the following command:
brew install pmd
After installation I tried to run the PMD Designer:
pmd designer
And I got the following error: The environment variable JAVAFX_HOME ...
1
vote
1
answer
105
views
PMD Cyclomatic Complexity Causing Problem - Can I Disable?
I'm running a Gradle (Kotlin) build in Java, and overall it's going well. However, the PMD report is set to automatically stop the build if the cyclomatic complexity is 5 or more. This hasn't been too ...
1
vote
2
answers
306
views
PMD Salesforce Code Analyzer error "invalid type" for custom object
I'm trying to comply with Salesforce Code Analyzer, but I found a strange error with an Apex class.
The class was designed to be called from an Apex trigger (originally, the trigger had the logic, but ...
0
votes
1
answer
168
views
How to use "pmd check" to scan for language php?
im sorry its very very newbie question. But I dont know where to find pmd rules for php.
I am properly able to run
pmd check -R rulesets/java/quickstart.xml -f text --dir MyProject
But not for php
...
1
vote
2
answers
161
views
I am getting a DU anomaly(PMD) in my code. I am not sure how to fix this
I have to iterate over the request and create a new Entity List request which I can use in saveAll() method of JPA repository
I am getting DU anomaly
Error I am encountering is from PMD.
DU - Anomaly:...
0
votes
1
answer
161
views
AWS SAM build fails with error: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.3.1
When I build my Spring Boot 3 app (JDK 21),
I get the following error while running the AWS SAM build command:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.3.1:...
0
votes
1
answer
53
views
PMD - Bad hyperlink URL in report
Hi everyone I hope you are doing well.
I'm currently using "PMD" to scan and find bugs/problems in my Salesforce apex code.
The following command is working fine
pmd check -d “C:\...\default\...
0
votes
1
answer
76
views
Can a quality gate be setup in PMD? Like a code coverage gate not meeting a certain percentage of code coverage
I want to setup a quality gate that uses the PMD report. It will not allow the code to be promoted if the code coverage is less than 85% or if the code has 1 critical error or 2 high errors. I have ...