4314 Commits

Author SHA1 Message Date
Andreas Dangel
f963f76fd4 Update changelog, improve test for new CommentDefaultAccessModifier rule 2015-07-26 19:20:47 +02:00
Andreas Dangel
e299dffc2f Merge branch 'pmd/5.3.x' 2015-07-25 20:11:45 +02:00
Andreas Dangel
e93e9224ae #1381 CPD Cannot use CSV/VS Renderers because they don't support encoding property 2015-07-19 22:34:57 +02:00
Andreas Dangel
df14ea9c95 #1379 PMD CLI: Cannot specify multiple properties 2015-07-13 19:50:40 +02:00
Andreas Dangel
82c6e4f602 Update changelog 2015-05-09 15:11:20 +02:00
Andreas Dangel
a2526cc87a Update changelog and add a small test for new rule ProjectVersionAsDependencyVersion 2015-04-30 19:54:03 +02:00
Andreas Dangel
d885267e6c Update changelog, add license headers, add externalInfoUrl for new rules 2015-04-16 20:12:22 +02:00
Andreas Dangel
4ad83be724 #1326 PMD 5.3.0-SNAPSHOT doesn't compile under Windows 2015-03-27 19:15:36 +01:00
Andreas Dangel
63017dbf08 pmd-core: convert util/database to junit 4 tests, indentation fixes 2015-03-26 20:48:45 +01:00
Andreas Dangel
e57007e1be dogfood, whitespaces 2015-03-25 20:16:55 +01:00
Andreas Dangel
61e8412afe dogfood, whitespaces 2015-03-24 22:48:01 +01:00
Andreas Dangel
056b2fbaea dogfood, whitespaces 2015-03-23 22:11:23 +01:00
Andreas Dangel
b7bf3fbb8c dogfood, whitespaces 2015-03-22 00:15:08 +01:00
Andreas Dangel
0c69ed6f8b PMD exit with status 4 if violations have been found. 2015-03-21 19:03:03 +01:00
Andreas Dangel
07e641f20a Merge branch 'tiobe/fix-error-handling' of https://github.com/tiobe/pmd into tiobe-tiobe/fix-error-handling 2015-03-21 18:16:16 +01:00
Andreas Dangel
fb1e1ba1aa doc: Improve PMD command line documentation 2015-03-21 17:55:50 +01:00
Andreas Dangel
415eed32c5 doc: Improve helptext of CPD command line 2015-03-21 16:38:21 +01:00
Andreas Dangel
28dfbeabf8 #1321 CPD format XML fails with NullPointer 2015-03-15 19:39:09 +01:00
Andreas Dangel
a52d0dcc6f Make sure, a deprecated and renamed rule is not executed twice. 2015-03-09 22:14:37 +01:00
Andreas Dangel
c30b0be663 Merge branch 'bugfix/improves-jdk8-support' of https://github.com/bric3/pmd into bric3-bugfix/improves-jdk8-support 2015-03-07 19:13:56 +01:00
Andreas Dangel
74708fa69e RuleProperties: Further refactoring - making the delimiters configurable 2015-03-07 19:01:52 +01:00
Jan van Nunen
e2cc67c591 Fixed exit status of PMD when error occurs
When an error occured the exit status of PMD was 0. The error occured
because the logic of 'NO_EXIT_AFTER_RUN' was incorrect/inverted. A
'System.exit()' was performed when 'NO_EXIT_AFTER_RUN' was set while it
should be skipped. I copied the fix from the CPDCommandLineInterface
class.

Furthermore I made sure all error messages are printed to System.err
instead of System.out, so they can easily extracted/found when PMD is
invoked by external tools.
2015-03-05 12:22:56 +01:00
Andreas Dangel
99f735cc3b RuleProperties: Whitespaces, reformat 2015-03-02 21:40:14 +01:00
Andreas Dangel
8ca4a57c13 RuleProperties: get rid of AbstractDelimitedProperty
Just using AbstractProperty now, it can do both.
2015-03-02 20:45:53 +01:00
Andreas Dangel
df423b373c RuleProperties: Add more tests and fix some multi property issues.
Add missing BooleanMultiProperty.FACTORY
2015-03-02 20:15:04 +01:00
Brice Dutheil
28d1764428 Improves pmd jdk8 readiness
* Upgrade asm so that it understands default method and static methods in interfaces jdk8 class files
* see 9b91690f218408ba1c65e633a824660e18080b00 for ASM4 support
2015-03-01 22:09:33 +01:00
Brice Dutheil
c50d84ff24 Replaces with spaces only (was mixed whitespaces) 2015-03-01 22:04:17 +01:00
Andreas Dangel
fcad3925cd #1316 Multi Rule Properties with delimiter not possible 2015-02-28 14:12:53 +01:00
Andreas Dangel
21d7ebb809 Fixes for java9 2015-02-20 19:19:16 +01:00
Andreas Dangel
563fc4ed5a Merge branch 'no-class-def-found-error' of https://github.com/rsalvador/pmd into rsalvador-no-class-def-found-error 2015-02-19 20:40:15 +01:00
Andreas Dangel
0f0984af3c #1312 Rule reference must not override rule name of referenced rule
The RuleSetWriter used the wrong name, too
2015-02-19 18:29:03 +01:00
Andreas Dangel
d5d6118f12 #1312 Rule reference must not override rule name of referenced rule
otherwise the rule reference is broken
2015-02-18 20:07:44 +01:00
Roman
1f6421ec88 Handle NoClassDefFoundError along ClassNotFoundException 2015-02-15 11:34:32 -08:00
Andreas Dangel
12d6d71242 Update changelog 2015-01-28 21:34:49 +01:00
Andreas Dangel
1159350e91 Merge branch 'tiobe/csv_linenumber_per_file' of https://github.com/tiobe/pmd into tiobe-tiobe/csv_linenumber_per_file 2015-01-24 18:34:21 +01:00
Andreas Dangel
4be14adebb #1308 PMD runs endlessly on some generated files 2015-01-24 10:03:46 +01:00
Andreas Dangel
9522ab3cd4 #1306 False positive on duplicate when using static imports 2015-01-22 19:30:20 +01:00
Andreas Dangel
57beb7ed13 #914 False +ve from UnusedImports with wildcard static imports 2015-01-21 21:56:43 +01:00
Jan van Nunen
b1769846e5 Created extra CSV output format 'csv_with_linecount_per_file' which outputs the correct line count per file.
Some of the tokenizers ignore comments and therefore the line count of a
duplication can differ per file. Take for example the following files:

FileA.java:

1: public class FileA {
2:  pulbic String Foo() {
3:    return "Foo";
4:   }
5:  }

FileB.java:

1: public class FileB {
2:   pulbic String Foo() {
3:     // This is a comment
4:     return "Foo";
5:   }
6: }

When comments are ignored and not tokenized, the duplication consist of
the following tokens:

'{', 'public', 'String', 'Foo', '(', ')', '{', 'return', 'Foo', ';',
'}', '}'

For 'FileA.java' the duplication is 5 lines long, it starts at line 1
and ends at line 5. For 'FileB.java' the duplication is 6 lines long, it
starts at line 1 and ends at line 6.

Note that this is just 1 example, because for most tokenizers comments
and white spaces are not significant. For example the following file
contains the same duplication all on 1 line:

FileC.java

1: public class FileC { public String Foo() { return "Foo"; } }

For us the correct line count per file is important, because we
highlight the duplications in an annotated source view and show the
percentage of duplicated code the file contains. The current output
formats only contain 1 line count per duplication and file set. For the
above example CPD would output the following:

Found a 4 line (12 tokens) duplication in the following files:
Starting at line 1 of FileA.java
Starting at line 1 of FileB.java

For FileB.java this is not correct and would lead to incorrect
percentage of duplicated code. (66% (4 of 6 lines) instead of the
correct 83% (5 of 6 lines)).

To fix the problem, I created an extra output format
'csv_with_linecount_per_file' which outputs the correct line count per
file. The format contains the following:

tokens,occurrences
<nr of tokens>,<nr of occurrences>(,<begin line>,<line count>,<file
name>)+

For the above example the output would be

tokens,occurrences
12,2,1,4,FileA.java,1,5,FileB.java
2015-01-21 13:55:49 +01:00
Andreas Dangel
be6a422860 Merge branch 'tiobe/pmd-core-cpdcmdlineoptfix' of https://github.com/tiobe/pmd into tiobe-tiobe/pmd-core-cpdcmdlineoptfix 2015-01-18 12:13:09 +01:00
Jan van Nunen
110184e542 Made exceptions of the Scala tokenizer non-fatal when CPD is executed with the '--skipLexicalErrors' command line option. 2015-01-15 15:32:19 +01:00
Jan van Nunen
a376da0d9e Fixed '--files' command line option of CPD, so it also works for files and not only for directories.
The '--files' command line option of CPD lets you specify which
directories and files should be scanned for duplicated code.
Unfortunately it didn't work when you specified files instead of
directories, for example: '--files foo.c bar.c'. In this example CPD
executed successful, but the files 'foo.c' and 'bar.c' are completely
ignored.
2015-01-14 17:34:17 +01:00
Andreas Dangel
8fb2f0a09f Add a timeout for retrieving a ruleset from a URL
By default, timeout is 5 seconds
2014-12-10 22:00:05 +01:00
Andreas Dangel
dd8c5f2d1a Implement possibility to specify a Single Rule from a Ruleset via http 2014-12-10 21:54:17 +01:00
msiemczyk
8d0f8080f4 #1290 RuleSetReferenceId does not process HTTP(S) correctly.
Fixed the bug and added one unit test.
2014-12-05 17:56:04 -05:00
Andreas Dangel
ce1e6b418c Fix dogfood ruleset 2014-11-30 21:23:04 +01:00
Andreas Dangel
944771c626 Fix javadoc for suppress marker 2014-11-30 20:24:22 +01:00
Andreas Dangel
c8887de5ff #1090 cpp parser exception with inline asm 2014-11-28 21:32:32 +01:00
Andreas Dangel
a9352d4d4c Update --encoding paramter description for CPD.
Thanks to Michael Osipov.
2014-11-25 21:49:58 +01:00
Andreas Dangel
d0980bd30d Add back the old getRendererFromString method for compatibility 2014-11-24 20:30:17 +01:00