I am trying to use PMD command line to analyze apex code. After installing PMD 5.8.1, when i run the pmd command using one of the canned apex rulesets, the output just says problem found but does not list any issues.
If I run the command for basic-java let us say, on a java file I can see the exceptions.
Has anyone used the apex rulesets, can you help me figure if I'm doing something wrong?
Here are the command I am using:
pmd -d c:\pmd\pmd-bin-5.8.1\apextest*.zip -f html -R rulesets/apex/security.xml -r c:\pmd\output.html
pmd -d c:\pmd\pmd-bin-5.8.1\apextest*.zip -f html -R rulesets/apex/performance.xml -r c:\pmd\output1.html
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried creating a class file with sample exceptions as below...
public class fooBar{
public fooBar() {
for(Integer i = 0; i < 5; i++){
insert new Account();
}
}
}
public class foo1 {
public void bar(Integer x, Integer y, Integer z) {
if (x>y) {
if (y>z) {
if (z==x) {
if (z<x) { }
// !! too deep
}
}
}
}
}
When i run the PMD command as below, I get a message below, but the oputput file doesnt show me any exception..
c:\pmd\pmd-bin-5.8.1\bin>pmd -d c:\pmd\foo.cls -f html -R
rulesets/apex/complexity.xml -r c:\pmd\op1.html
Aug 22, 2017 4:20:21 PM apex.jorje.parser.impl.BaseApexLexer dedupe
INFO: Deduped array ApexLexer.DFA23_transition. Found 7927114 shorts which is 15
MB not including array overhead. Removed 7204963 shorts which is 13MB not counti
ng array overhead. Took 10ms.
o/p file .. (blank with just the text below).
PMD report
Problems found
File Line Problem
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to use PMD command line to analyze apex code. After installing PMD 5.8.1, when i run the pmd command using one of the canned apex rulesets, the output just says problem found but does not list any issues.
If I run the command for basic-java let us say, on a java file I can see the exceptions.
Has anyone used the apex rulesets, can you help me figure if I'm doing something wrong?
Here are the command I am using:
pmd -d c:\pmd\pmd-bin-5.8.1\apextest*.zip -f html -R rulesets/apex/security.xml -r c:\pmd\output.html
pmd -d c:\pmd\pmd-bin-5.8.1\apextest*.zip -f html -R rulesets/apex/performance.xml -r c:\pmd\output1.html
Thanks
Any help?
I tried creating a class file with sample exceptions as below...
public class fooBar{
public fooBar() {
for(Integer i = 0; i < 5; i++){
insert new Account();
}
}
}
public class foo1 {
public void bar(Integer x, Integer y, Integer z) {
if (x>y) {
if (y>z) {
if (z==x) {
if (z<x) { }
// !! too deep
}
}
}
}
}
When i run the PMD command as below, I get a message below, but the oputput file doesnt show me any exception..
c:\pmd\pmd-bin-5.8.1\bin>pmd -d c:\pmd\foo.cls -f html -R
rulesets/apex/complexity.xml -r c:\pmd\op1.html
Aug 22, 2017 4:20:21 PM apex.jorje.parser.impl.BaseApexLexer dedupe
INFO: Deduped array ApexLexer.DFA23_transition. Found 7927114 shorts which is 15
MB not including array overhead. Removed 7204963 shorts which is 13MB not counti
ng array overhead. Took 10ms.
o/p file .. (blank with just the text below).
PMD report
Problems found
File Line Problem