6958 Commits

Author SHA1 Message Date
Andreas Dangel
28b37d6767 pmd: bugfix for 3574133: False+ : SingularField 2012-10-06 19:19:57 +02:00
Andreas Dangel
da6e8fc05e pmd: updated changelog with bugfixes 2012-10-04 20:06:24 +02:00
Andreas Dangel
803e51f56b pmd: improve eclipse/maven integration 2012-10-03 21:51:58 +02:00
Andreas Dangel
5b7273bd47 pmd: delete the files that are generated by javacc from the repository
* the generated files are now located under target/generated-sources/javacc
 * Note: The files that are left in
   src/main/java/net/sourceforge/pmd/lang/java/ast
   were initially generated by javacc, but were modified
   (e.g. every AST*.java class)
2012-10-03 21:51:17 +02:00
Andreas Dangel
05b805b92c whitespaces / reformat 2012-10-03 21:48:52 +02:00
Andreas Dangel
97899e8b04 pmd website: make the site more friendly for smartphones. 2012-09-10 19:08:16 +02:00
Andreas Dangel
ea6285dbf2 pmd (site): update release process with git specific commands. 2012-09-10 19:08:16 +02:00
Matthew Short
179ab9d708 First, I read this comment in the main tree and thought I'd put in some objects:
/*
	I'm doing a sort of State pattern thing here where
	this goes into "discarding" mode when it hits an import or package
	keyword and goes back into "accumulate mode" when it hits a semicolon.
	This could probably be turned into some objects.
	*/

I created a Discarder interface, and a couple implementations.  One handles keywords/tokens like import and package.  Another discards annotation blocks.  Another turns CPD on and off based on Strings within an annotation e.g. @SuppressWarnings("CPD-START") and @SuppressWarnings("CPD-END).

There have been two features desired by myself and my colleagues strongly.
1. Ability to ignore sections of source code, such as switch/case statements or parameterized factories.
2. Ability to ignore annotations.  More and more modern frameworks use annotations on classes and methods, which can be very redundant and trigger CPD matches.

Just to illustrate, here is a parametrized factory  example that can cause a false positive if you ignore literals (String and int values):

if ("A".equals(input)) return new A(1);
if ("B".equals(input)) return new A(2);
if ("C".equals(input)) return new A(3);
if ("D".equals(input)) return new A(4);
if ("E".equals(input)) return new A(5);
False positives cause the CPD reports to be a burden to review and read.  Many people start ignoring them when the first 20 entries are 'acceptable'.

For annotations, with J2EE (CDI, Transaction Handling, etc) and Spring (everything) become very redundant.  Often classes or methods have the same 5-6 lines of annotations.  This causes false positives.

For CPD-START and CPD-END, it would be much more desirable to use comments rather than annotations.  However, the parser drops comments and they can not be processed by the JavaTokenizer.  The current approach forces entire methods or classes to be skipped, rather than some blocks.  However, I feel its an improvement in cases like parameterized factories or case/switch statements where I don't want them polluting my results.
2012-09-03 20:25:21 -07:00
ryan-gustafson
051824beb8 Remove stray System.out. 2012-08-25 12:20:46 -05:00
ryan-gustafson
6419c3d6f5 Fixed bug 3560464: c/c++ \ as a continuation character not supported
Add ContinuationReader which entirely omits \\n and \\r\n from the
underlying Reader before anything reaches the parser.
2012-08-24 01:16:43 -05:00
TIOBE Software
3ceb80d7ac Added missing files for patch 2996539 : Add support for C# to CPD (simple parser) 2012-08-22 14:18:41 +02:00
ryan-gustafson
98c18554df Add ecmascript AvoidTrailingComma rule. 2012-08-15 05:42:50 -05:00
Romain PELISSE
37ec2f505b Add supported languages to generate usage/help text for CLI 2012-08-06 20:25:22 +02:00
Romain PELISSE
8709ade69f Add a positive value validator for the threads option 2012-08-06 19:54:57 +02:00
Romain PELISSE
a66133e053 Remove now useless classes 2012-08-04 17:41:36 +02:00
Romain PELISSE
a0236ee67f Move all CLI related logic into a class in the subpackage 'cli' - mostly to simplify and clarifiy PMD main class code. 2012-08-04 17:41:27 +02:00
Romain PELISSE
f0b17e35ce Add a new Parameters class to hold all the parameters of PMD CLI 2012-08-04 17:37:02 +02:00
Romain PELISSE
bd23033a82 Add jcommander as a dependency, in order to rework PMD CLI with it 2012-08-04 17:36:12 +02:00
Romain PELISSE
5d3f5f3ff4 Move XPathCLI to appropriate CLI subpackage 2012-08-04 17:35:17 +02:00
Romain PELISSE
a248ca7da3 Whitespaces 2012-08-04 17:33:54 +02:00
Romain PELISSE
e5083d3f59 Fix tests data directory, to ensure all files are properly generated inside the directory 2012-08-04 12:01:13 +02:00
Pelisse Romain
76b61e3054 Merge pull request #2 from rpelisse/master
Unit Test for CLI
2012-08-03 13:13:52 -07:00
Romain PELISSE
094e1bd490 Add unit test for CLI 2012-08-03 15:49:08 +02:00
Romain PELISSE
969678015d Modify PMD run to allow unit test to workaround the call to exit() - and retrieve the status code (using env's properties 2012-08-03 15:49:08 +02:00
Romain PELISSE
42ba8815b4 Add an handy public method to search for a pattern in a file 2012-08-03 15:49:08 +02:00
Romain PELISSE
30281b78af Add a handy class to iterate over a file, line by line (to be used in unit test, while checking result file) 2012-08-03 15:49:08 +02:00
Romain PELISSE
baf4a9d903 Fix 3539117 - jnlp link for CPD is wrong. Thanks to Marcin Milkowski for spotting and reporting this. 2012-08-02 22:44:52 +02:00
Andreas Dangel
2b7bc6d300 Repository move to github 2012-07-29 16:43:36 +02:00
Andreas Dangel
094291e8ed pmd/bgastviewer: Moved the strings to the resources directory.
* removed accidentally added eclipse .project file, added .gitignore.
2012-07-26 20:19:25 +02:00
Andreas Dangel
2d9b4b400f Merge branch 'master' of https://github.com/victorbucutea/pmd into victorbucutea-master 2012-07-23 20:17:06 +02:00
Victor Bucutea
2b21c3e060 removed unwanted orig file 2012-07-23 19:00:38 +03:00
Victor Bucutea
1a8e374fbb Commit improved JSP parser + fix for ./bgastviewer 2012-07-23 18:52:40 +03:00
Andreas Dangel
8d2c08d5cb pmd: bugfix for 3484404 (Invalid NPath calculation in return statement)
Thanks to Prabhjot Singh for the patch.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7706 51baf565-9d33-0410-a72c-fc3788e3496d
2012-07-19 16:48:18 +00:00
Andreas Dangel
6926ba0647 pmd: added test for bug 3484404 (NPathComplexity and return statements)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7705 51baf565-9d33-0410-a72c-fc3788e3496d
2012-07-19 16:47:43 +00:00
Dinesh Bolkensteyn
c629e28711 Delete the empty lib folder
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7704 51baf565-9d33-0410-a72c-fc3788e3496d
2012-07-03 08:07:45 +00:00
Dinesh Bolkensteyn
7e9ef50cfe Clean up some empty folders
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7703 51baf565-9d33-0410-a72c-fc3788e3496d
2012-07-03 08:02:30 +00:00
Dinesh Bolkensteyn
58ae0344ff 3539585 AvoidLiteralsInIfCondition must NOT consider null
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7702 51baf565-9d33-0410-a72c-fc3788e3496d
2012-07-03 07:29:40 +00:00
Romain Pelisse
faedbdd9b3 Site: Add link to a Gregorian translation recently contributed
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7701 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-12 15:56:35 +00:00
Romain Pelisse
eab43fee83 Site: add documentation for new run.sh script (unices only)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7700 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-12 15:56:12 +00:00
Andreas Dangel
732bb2de1f pmd: add test for bug 3524607 (annotated package)
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7699 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-11 17:47:36 +00:00
Andreas Dangel
ad2017a073 pmd (site): renamed cpd.xml to cpd-usage.xml so that we can have a cpd report of PMD.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7698 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-11 17:47:11 +00:00
Andreas Dangel
8b586a5375 pmd: fix developer info in pom.xml
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7697 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-11 17:46:45 +00:00
Andreas Dangel
f89c68a3bf pmd: added another test case for the parser
* see: http://jira.codehaus.org/browse/MPMD-126

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7696 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-11 17:46:25 +00:00
Brian Remedios
bdb16fb1b5 minor cleanup
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7695 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-02 17:59:07 +00:00
Brian Remedios
d447509c16 This class is quasi-obsolete, we should be transforming the XML renderer output instead, tagged with a FIXME.
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7694 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-02 17:43:15 +00:00
Brian Remedios
38a959d939 minor tweak
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7693 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-02 17:26:23 +00:00
Brian Remedios
eefb81a056 rm redundant methods
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7692 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-02 17:14:31 +00:00
Andreas Dangel
c61a4f1543 pmd: configuring maven site
* removing the broken dependency icu4j - seems not to be needed
 * adding pmd report

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7691 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-02 12:11:03 +00:00
Andreas Dangel
b5614ce718 pmd: added sourceforge tracking icons to the website
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7690 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-02 12:10:47 +00:00
Andreas Dangel
0e86ee33a4 pmd: make the output encoding of XMLRenderer of CPD and PMD more
easily configurable

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7689 51baf565-9d33-0410-a72c-fc3788e3496d
2012-06-02 12:10:25 +00:00