6945 Commits

Author SHA1 Message Date
Andreas Dangel
d1dfc93eb4 pmd/cpd: adding documentation and switches for suppressing ability and new ignore_annotations switch. 2012-11-23 22:12:04 +01:00
Andreas Dangel
b2f3c070f5 Merge pull request #6 into tacitknowledge-master 2012-11-22 21:30:50 +01:00
Andreas Dangel
62ec54b152 pmd: added unit test for CsTokenizer
* behaves similar like Java, e.g. ignoring semicolons and comments
2012-11-22 20:18:07 +01:00
Andreas Dangel
c563d8c4ce Merge remote-tracking branch 'tiobe/master' into tiobe-master 2012-11-20 22:53:47 +01:00
Andreas Dangel
b0c2721c22 pmd (build): ignore rule definitions without a name in our documentation
This basically adds the question, how to deal with deprecated rule definitions.
We should document this, maybe in an own section per ruleset.
2012-11-20 18:12:42 +01:00
Andreas Dangel
bed009c779 pmd site: fix broken links 2012-11-19 22:46:34 +01:00
Andreas Dangel
dd283b27a5 pmd: updating TODOs in changelog.txt
* test framework: This is done AFAIK - we have tests in different languages.
* RuleViolations without Nodes: Created bug to follow up: https://sourceforge.net/p/pmd/bugs/1040/
* XPath functions doc: Created bug to follow up: https://sourceforge.net/p/pmd/bugs/1041/
* RuleSetReferenceId: Created bug to follow up: https://sourceforge.net/p/pmd/bugs/1042/
2012-11-18 18:15:49 +01:00
Andreas Dangel
0262776074 pmd: re-enable PMDCoverageTest 2012-11-17 17:22:06 +01:00
Andreas Dangel
68cc44b374 add a basic README.md file for github 2012-11-17 17:00:27 +01:00
Andreas Dangel
cc17820ec2 pmd: add a parent pom file to help buildhive identify the maven build 2012-11-17 16:56:05 +01:00
Andreas Dangel
fe0df04363 pmd website: update links, add a proper rewrite rule, add a nicer 404 error page 2012-11-17 16:25:32 +01:00
Romain PELISSE
3545b58820 Merge with remote 2012-11-14 22:55:39 +01:00
Romain PELISSE
5059c75b47 Merge with master 2012-11-14 22:46:12 +01:00
Romain PELISSE
7bc5810f7a pmd: adding changes suggested by Ryan Gustavson 2012-11-14 22:06:32 +01:00
Romain PELISSE
a887700c8f pmd: Fix broken docs regarding new CLI tool usage 2012-11-14 22:06:24 +01:00
Romain PELISSE
1de9f7cd49 pmd: Reindent and whitespaces 2012-11-14 22:06:19 +01:00
Romain PELISSE
412322567e pmd: removes invalid call to System.exit() 2012-11-14 21:29:15 +01:00
Andreas Dangel
d4ff29d2f7 Merge remote-tracking branch 'rpelisse/master' 2012-11-14 20:57:06 +01:00
Pelisse Romain
4a5afbcf75 Merge pull request #8 from adangel/property-renderer
Great job on Property renderer ! Thanks !
2012-11-14 11:30:33 -08:00
Andreas Dangel
a72c4f293c pmd: refactor renderers to use PropertyDescriptors 2012-10-26 20:13:20 +02:00
Andreas Dangel
940d5e36a8 pmd: make the old style properties deprecated for Renderer
* Provides also a default fall back to StringProperty
 * Use the new PropertyDescriptor for PMD command line help text
2012-10-26 19:31:26 +02:00
Andreas Dangel
db22a424c4 pmd: remove old-style properties for renderers, where the properties were not used 2012-10-24 21:45:01 +02:00
Andreas Dangel
4304c8c455 pmd: updating tracker urls (bug 1025) 2012-10-22 20:21:54 +02:00
Andreas Dangel
be6d551ba2 pmd (build): adjust release docu for git 2012-10-22 20:11:52 +02:00
Andreas Dangel
97b92fbf56 pmd: correct tracker url 2012-10-22 19:29:21 +02:00
Andreas Dangel
110fd248ca pmd: Merge pull request #7 2012-10-22 18:57:58 +02:00
Andreas Dangel
d3d31968d5 pmd: #1034 UseConcurrentHashMap flags calls to methods that return Map 2012-10-21 19:59:32 +02:00
Andreas Dangel
ce8a166a11 pmd: #1031 false DontImportJavaLang 2012-10-21 19:57:51 +02:00
Andreas Dangel
d1d4fca5d5 pmd: #1035 UseObjectForClearerAPI has misspelled message 2012-10-21 19:24:01 +02:00
Andreas Dangel
3d2ff17d83 pmd: update bug ids 2012-10-21 17:04:45 +02:00
Andreas Dangel
86015e5277 pmd: using new pmd-build to fix bug 1036 - documentation of properties 2012-10-21 16:36:21 +02:00
Andreas Dangel
3941103714 pmd (build): add a RuntimeRulePropertiesAnalyzer to get the properties a rule supports for documentation (bug 1036)
* added maven plugin testing for a mojo test case
2012-10-21 16:32:30 +02:00
Andreas Dangel
fefdc27c01 pmd (build): make sure the rulesets are sorted alphabetically
* fix TODO - use compiled regex pattern
2012-10-13 18:18:47 +02:00
Andreas Dangel
d126d9b0b8 pmd: bugfix 3546093 performance improving by caching not found classes 2012-10-07 10:38:52 +02:00
Andreas Dangel
60c2af73fd pmd: reintroducing check whether multi threading is support (bugfix for 3565001)
* created SystemUtils to check for multi-threading permission
Revert "pmd: Remove hack related to multithreading in jdk5 with Eclipse - no longer relevant today"

This reverts commit 720bb3d3b41e2590d6f0e4b8542244192a56e022.
2012-10-06 20:58:13 +02:00
Andreas Dangel
54cfe41206 pmd: improve javacc build with eclipse - add incremental build and only build if necessary 2012-10-06 19:24:32 +02:00
Andreas Dangel
99daea42a5 pmd: cleanup redundant test classes
* the two test suites are already integrated in DesignRulesTest and CouplingRulesTest
2012-10-06 19:20:25 +02:00
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