pmd Questions
5
Solved
Why does the main Spring Boot application always trigger PMD's HideUtilityClassConstructorCheck?
The standard Spring Boot application has some main method class file, say SampleApplication.java, that looks like this:
@SpringBootApplication
@RestController
public class SampleApplication {
pu...
Hypophosphite asked 13/5, 2016 at 21:17
5
Solved
I have a big Maven project that uses the PMD plugin for code quality checks.
since I started using the PMD plugin i get the following warning message:
[WARNING] Unable to locate Source XRef to link...
3
Solved
I have the following structure
public class parent {
int value ;
}
public class child extends parent {
int childValue;
public child(){}
public child (int value){
this.childValue = value ; ...
3
Solved
When I run a PMD analysis I receive violation:
Each class should declare at least one constructor
This violation is on a Spring controller. This controller is instantiated by Spring, so I shouldn...
3
Solved
I am using PMD plugin (version 4.0.2) for Eclipse (Eclipse Kepler Java EE). I have configured a naming rule: ShortVariable.
This works fine except for parameters like "id" and "e". I want PMD to i...
2
Solved
I am working on a long running multi-module Maven Java project. I tried to update the PMD plugin from 3.17.0 to 3.18.0, but I get a java.lang.NoSuchMethodError from PMD almost immediately. The 3.17...
We asked 31/8, 2022 at 0:48
7
Solved
I have a doubt, I have a class in which I'm using different static import for import constants, my issue is that I'm getting the error message: Too many static imports may lead to messy code. But i...
Aguirre asked 4/10, 2019 at 18:45
2
Solved
I would like to use the gradle PMD plugin in an enterprise project which is built with gradle.
I have a pmd_rules.xml file which already works, but I can't add own java rules (I get a class not fo...
3
Solved
I'm attempting to create some exclude patterns for a PMD task in Gradle.
My task is generated in the next way:
/* Allows generation of pmd config */
allprojects {
apply plugin: 'pmd'
}
gradle.pr...
4
Is there a way to tell PMD to ignore checking parts of code for duplication?
For example, can I do something like this:
// CPD-Ignore-On
...
// CPD-Ignore-Off
Currently I have PMD set up like t...
Vasos asked 23/4, 2011 at 23:53
5
Solved
When defining a PMD ruleset is it possible to exclude a source file from a specific rule?
I want to do something like the following:
<rule ref=rulesets/java/logging-java.xml>
<exclude n...
5
Can anybody tell me how to install PMD in Eclipse. I have downloaded PMD 5.0.4 from the following link:
http://sourceforge.net/projects/pmd/files/latest/download?source=files
When I add this arch...
Nesta asked 16/7, 2013 at 9:20
3
Solved
I would like to migrate from Checkstyle + PMD + Findbugs to SonarQube. I´ve read that SonarQube replaces all 3 plugins (and have some new rules in addition). But in my project we have some custom c...
Dunagan asked 26/2, 2020 at 13:56
5
Solved
On line:
private boolean someFlag;
I get the following PMD warning:
Found non-transient, non-static member. Please mark as transient or provide accessors.
Can someone please explain why thi...
Disjoint asked 26/2, 2009 at 9:45
4
Solved
I have following code. I am getting "Avoid using Literals in Conditional Statements." warning in PMD on line number 5.
List<Object> listObj = getData();
if (listObj.isEmpty()) {
throw new ...
Seldun asked 10/8, 2016 at 7:40
2
Solved
I recently upgraded to Eclipse Version: 2020-06 (4.16.0) on Windows 10.
My java version is "14.0.1" 2020-04-14
After the upgrade, I attempted to install Eclipse-PMD 2.0 from the Marketplace ( he...
Dividers asked 17/6, 2020 at 22:5
1
Solved
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.5:pmd (pmd) on project my_project: Execution pmd of goal org.apache.maven.plugins:maven-pmd-plugin:3.5:pmd failed: org.apa...
1
I am trying to have a pom.xml file with PMD plugin integrated into build stage.
PMD version 3.13.0
Oracle JDK 14
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3...
6
Solved
try {
// code which throws exception.
} catch (SQLException sqlex) {
logger.error("Custom message", sqlex);
**throw new CustomApplicationException("Custom message", sqlex);**
}
In the above ex...
9
Solved
Checkstyle says:
Class should define a constructor.
PMD says:
Avoid unnecessary constructors - the compiler will generate these for you.
Who is right? Or let's put it this way - what ar...
Dillion asked 26/10, 2010 at 13:8
1
Solved
PMD Failure: ... Rule:UnusedPrivateMethod Priority:3 Avoid unused private methods such as 'printMyString(String)'
private void anyMethod() {
var myString = "a String";
printMyString(myString);
}...
3
Solved
How can I avoid the PMD error in my Java code?
public enum testEnum {
TEST1(1L, "TEST", "random1");
TEST2(2L, "TEST", "random2");
TEST3(3L, "TEST", "random3");
TEST4(4L, "TEST", "random4");
...
2
Solved
Whenever you hit 'the check for update' button, IntelliJ checks for IDE update and starts by checking and updating all your active plugins.
The point is that I use a pretty crooked plugin which on...
Rhodie asked 11/6, 2013 at 8:25
7
Solved
In my application, I am running my code through PMD.It shows me this message:
Avoid printStackTrace(); use a logger call instead.
What does that mean?
Cartelize asked 7/5, 2012 at 6:23
3
I'm installing Eclipse Juno for Java Developers for a class, and we've been asked to install the PMD plugin. We have our own xml file with the rules and we have to replace the default rules for the...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.