Questions tagged [pmd]

PMD scans source code and looks for potential problems like possible bugs, dead code, suboptimal code, overcomplicated expressions, and duplicate code. PMD supports Java, JavaScript, XML, and many more.

PMD scans source code and looks for potential problems like possible bugs, dead code, suboptimal code, overcomplicated expressions, and .

857 questions
0
votes
1 answer

Which are the “Must Follow” rules of PMD?

I´m starting to use PMD and I really want to know which are the most important rules or the rules that anybody can´t miss when using this tool. I´m looking for some article or page with a list of rules that must be used in PMD, this tool has a lot…
Ocepeda
  • 37
  • 5
0
votes
1 answer

How to integrate PMD, Maven and Hudson?

I tries one scenario to integrate these tools, but it giving unbelievable output. What I did: I did not configure or install PMD in Hudson. I configured PMD in my parent pom. I run goals (clean site) the in Hudson job, but it running only last sub…
Sun
  • 3,444
  • 7
  • 53
  • 83
0
votes
1 answer

how can I achieve in Maven 'fan out complexity' rule with PMD static analysis tool

I am new to PMD tool with Maven, I have to define rules for some Cyclic Complexity, Fan Out Complexity, and Depth in method. I found solution for Cyclic Complexity, and Depth in method but i am not able to find direct rule class for Fan Out…
Sun
  • 3,444
  • 7
  • 53
  • 83
0
votes
1 answer

Best list of static analysis rules

How to achieve better code in-terms of style, practical issues, logical issues, duplicate code, cyclic issues. Could i know your best list of static analysis rules for 1. Java 2. JSP or JSF 3. JavaScript, JQuery... 4. css How to…
Sun
  • 3,444
  • 7
  • 53
  • 83
0
votes
0 answers

How to write new rules of PMD for eclipse using

i followed the PMD official docs to create a new rule of PMD.(actually, the docs is out of date and had misled me ) neverTheless,the new rule which i created can only use by pmd.bat.it can not worke in eclipse pmd plugin.who can tell me how to do ?…
MiddleBen
  • 22
  • 2
0
votes
1 answer

Disable maven checkstyle, pmd for groovy sources in multimodule project

I have a multimodule maven project and I can't find a way to disable pmd, checktyle for groovy sources. I do run a command from the top level: mvn clean install pmd:pmd checktyle:checkstyle The structure of my project is: pom.xml -module1 src …
Capacytron
  • 3,425
  • 6
  • 47
  • 80
0
votes
3 answers

PMD Issues in Code - Are they critical?

We have a number of issues that PMD has identified for us - a lot of which seems nit picky. I have a list below - may I ask the hive mind - if you had to pick the top 5 crticial rules out of below list what would they be? I am trying to balance…
ved
  • 313
  • 1
  • 3
  • 10
0
votes
1 answer

Different behaviour of Sonar for slightly two similar scenarios

Consider following case public void setRules(MyRule[] rules) { this.rules=rules; } Sonar complain and says, Constructors and methods receiving arrays should clone objects and store the copy. This prevents that future changes from the user…
Ruchira Gayan Ranaweera
  • 34,993
  • 17
  • 75
  • 115
0
votes
1 answer

Where will the result will be stored? after executing PMD

I am using PMD to do code-review for my application. I am able to do the review, but I don't have a clue where the report will be stored. I am using this cmd: "C:\PMD test\Source>java -jar pmd-4.2.5/lib/pmd-4.2.5.jar JavaSource\com\ex\app html…
micheal
  • 81
  • 3
  • 8
0
votes
3 answers

Avoid instantiating new objects inside loops in java

I would like to avoid crating the new instance of SelectItem in side the loop. Could you please help me how can i avoid it. public List createLocales() { final List enabledLocales = new ArrayList(); final…
Vijay Kumar
  • 81
  • 2
  • 10
0
votes
1 answer

Error using PHP_Depend and PHP_PMD

I have a problem using php Depend and PMD. When I use: pdepend --summary-xml=/home//.sonar/pdepend.xml --suffix=php,php3,php4,php5,phtml,inc /home/ this is the result: Parsing... …
gopeca
  • 1,601
  • 12
  • 12
0
votes
1 answer

Generate a summary with the Maven PMD plugin

I am using the Maven PMD plugin as a part of the Maven Site Plugin to generate a PMD report. This works in general, but when I did my PMD reports with Ant, there was always a violation summary at the top of the report, listing the number of files…
Haf
  • 65
  • 1
  • 5
0
votes
1 answer

PMD-Maven: can't find pmd custom format yyyyMMddhhmm

When I use pmd to analyse my maven project, i met a problem. It tells me 'can't find pmd custom format YYYYmmddhhmm' here is part of my pom.xml
Esct
  • 133
  • 1
  • 2
  • 13
0
votes
2 answers

PMD: the chosen operation is not currently available

I had installed PMD in my local system, I use to run PMD. But, recently I have observed that when I right on project/package in STS->pmd->check code with PMD, then getting following error: the chosen operation is not currently available. Java:…
AKB
  • 5,918
  • 10
  • 53
  • 90
0
votes
1 answer

The constructor RuleViolation(ParameterNameConvention, int, String, RuleContext) is undefined

Thanks. public class ParameterNameConvention extends AbstractJavaRule { private final static String PATTERN = "[p][a-zA-Z]+"; public Object visit(ASTMethodDeclaration node, Object data) { RuleContext result = (RuleContext) data; String…
Esct
  • 133
  • 1
  • 2
  • 13