4082 Commits

Author SHA1 Message Date
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
Andreas Dangel
afc13b29a2 #1285 Prevent to modify the System environment 2014-11-24 20:18:44 +01:00
Andreas Dangel
7d262036c6 Exclude LawOfDemeter rule from dogfood ruleset 2014-11-17 21:56:01 +01:00
Andreas Dangel
e86341bf8e Checkstyle fixes 2014-11-17 21:55:57 +01:00
Andreas Dangel
f7f89f2921 Fix PMD dogfood issues in pmd-core 2014-11-15 23:57:03 +01:00
Andreas Dangel
6b0ddaeb51 #1254 CPD run that worked in 5.1.2 fails in 5.1.3 with OOM
Removed default heapsize of 512m
reenabled multiple line strings in javascript
2014-11-15 21:44:37 +01:00
Andreas Dangel
a2e6088faa Fix duplicated code in DBMSMetadata 2014-11-15 19:09:51 +01:00
Andreas Dangel
4da773b7fc Add ruleset factory tests for all languages 2014-11-09 11:20:54 +01:00
Andreas Dangel
61b11beda7 Another jdk9 fix for Swing's JTree TreeNode 2014-11-02 12:18:45 +01:00
Andreas Dangel
76af873708 #1274 ant integration broken with pmd-5.2.0
Separate PMDTask and PMDTaskImpl and set the context classloader
when executing PMD
For CPD, the validation of the language is deferred, until
the context class loader has been switched
2014-10-23 20:00:57 +02:00
Andreas Dangel
64f9b04811 Update release docu, rename releases ruleset 514->520 2014-10-12 19:33:58 +02:00
Andreas Dangel
9ade75a621 Refactor CPDGui to detect available languages dynamically 2014-10-12 10:43:53 +02:00
Andreas Dangel
464b0bcef8 Rework CPD's LanguageFactory to use ServiceLoader, too 2014-10-11 12:16:28 +02:00
Andreas Dangel
72719bd0c3 Move C# into own sub-module 2014-10-11 11:23:07 +02:00
Andreas Dangel
f748539c45 Rename pmd -> pmd-core and pmd-aggregate -> pmd 2014-10-08 22:52:25 +02:00