diff --git a/README.md b/README.md index 00416b7619..6672937aa6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # PMD +[![Build Status](https://travis-ci.org/pmd/pmd.svg?branch=master)](https://travis-ci.org/pmd/pmd) + +## About + PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It supports Java, JavaScript, Salesforce.com Apex, XML, XSL. Additionally it includes CPD, the copy-paste-detector. CPD finds duplicated code in diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DesignRulesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DesignRulesTest.java index 659b6722af..119f833a73 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DesignRulesTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DesignRulesTest.java @@ -71,7 +71,7 @@ public class DesignRulesTest extends SimpleAggregatorTst { addRule(RULESET, "UseCollectionIsEmpty"); addRule(RULESET, "UseLocaleWithCaseConversions"); addRule(RULESET, "UseNotifyAllInsteadOfNotify"); - //addRule(RULESET, "UseUtilityClass"); + addRule(RULESET, "UseUtilityClass"); addRule(RULESET, "UseVarargs"); } } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codesize/xml/ExcessiveClassLength.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codesize/xml/ExcessiveClassLength.xml index cb42c83a5b..bc1bbdabc1 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codesize/xml/ExcessiveClassLength.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codesize/xml/ExcessiveClassLength.xml @@ -8,7 +8,7 @@ short 0 0 0 1 0 0 0 0 testObject = new ArrayList(); // These ones are flagged @@ -228,7 +228,7 @@ public class TestIsEmpty { import java.util.ArrayList; public class IsEmptyTest { - public void foo() { + public static void main(String args[]) { ArrayList testObject = new ArrayList(); // these should be flagged (as they are equivalent to == 0) and are diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/UseUtilityClass.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/UseUtilityClass.xml index 6673abb66c..3261b6a9be 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/UseUtilityClass.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/design/xml/UseUtilityClass.xml @@ -9,7 +9,7 @@ should be utility class since all static, public constructor public class Foo { public Foo() { } public static void doSomething() {} - public void foo() { + public static void main(String args[]) { doSomething(); } } @@ -24,7 +24,7 @@ ok, uses non-static public class Foo { public Foo() { } public void doSomething() { } - public void foo() { } + public static void main(String args[]) { } } ]]> @@ -175,7 +175,7 @@ NPE in incorrect implementation... public class Foo { public Foo() { } public void doSomething() { } - public void foo() { } + public static void main(String args[]) { } ; } ]]> @@ -190,7 +190,7 @@ public class Foo { public Foo() { } @Override public void doSomething() { } - public void foo() { } + public static void main(String args[]) { } } ]]> diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/loggingjava/xml/SystemPrintln.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/loggingjava/xml/SystemPrintln.xml index 315ff7c278..195bdc15da 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/loggingjava/xml/SystemPrintln.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/loggingjava/xml/SystemPrintln.xml @@ -62,7 +62,7 @@ public class Foo { 0 0 ()) { // facetious but simple example System.out.println(test); } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/unusedcode/xml/UnusedPrivateMethod.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/unusedcode/xml/UnusedPrivateMethod.xml index e7564734c0..f13f5cfd81 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/unusedcode/xml/UnusedPrivateMethod.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/unusedcode/xml/UnusedPrivateMethod.xml @@ -602,7 +602,7 @@ import java.util.Locale; public class Test { - public void foo() { + public static void main(String args[]) { Test t = new Test(); t.baz(); }