Commit Graph

948 Commits

Author SHA1 Message Date
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
1f6421ec88 Handle NoClassDefFoundError along ClassNotFoundException 2015-02-15 11:34:32 -08:00
12d6d71242 Update changelog 2015-01-28 21:34:49 +01:00
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
4be14adebb #1308 PMD runs endlessly on some generated files 2015-01-24 10:03:46 +01:00
9522ab3cd4 #1306 False positive on duplicate when using static imports 2015-01-22 19:30:20 +01:00
57beb7ed13 #914 False +ve from UnusedImports with wildcard static imports 2015-01-21 21:56:43 +01:00
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
5ae01d2d3e Up version to 5.3.0-SNAPSHOT 2015-01-18 12:19:52 +01:00
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
d69624e823 Update changelog for scala pull request; update license infos 2015-01-18 11:45:26 +01:00
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
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
0e6a5db426 [maven-release-plugin] prepare for next development iteration 2014-12-21 11:46:02 +01:00
6c316e9375 [maven-release-plugin] prepare release pmd_releases/5.2.3 2014-12-21 11:46:02 +01:00
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
dd8c5f2d1a Implement possibility to specify a Single Rule from a Ruleset via http 2014-12-10 21:54:17 +01:00
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
ac0181f017 [maven-release-plugin] prepare for next development iteration 2014-12-03 19:22:19 +01:00
c577dc8aac [maven-release-plugin] prepare release pmd_releases/5.2.2 2014-12-03 19:22:19 +01:00
ce1e6b418c Fix dogfood ruleset 2014-11-30 21:23:04 +01:00
944771c626 Fix javadoc for suppress marker 2014-11-30 20:24:22 +01:00
c8887de5ff #1090 cpp parser exception with inline asm 2014-11-28 21:32:32 +01:00
a9352d4d4c Update --encoding paramter description for CPD.
Thanks to Michael Osipov.
2014-11-25 21:49:58 +01:00
d0980bd30d Add back the old getRendererFromString method for compatibility 2014-11-24 20:30:17 +01:00
afc13b29a2 #1285 Prevent to modify the System environment 2014-11-24 20:18:44 +01:00
7d262036c6 Exclude LawOfDemeter rule from dogfood ruleset 2014-11-17 21:56:01 +01:00
e86341bf8e Checkstyle fixes 2014-11-17 21:55:57 +01:00
f7f89f2921 Fix PMD dogfood issues in pmd-core 2014-11-15 23:57:03 +01:00
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
f5db63b374 Exclude generated sources from checkstyle 2014-11-15 19:53:34 +01:00
a2e6088faa Fix duplicated code in DBMSMetadata 2014-11-15 19:09:51 +01:00
4da773b7fc Add ruleset factory tests for all languages 2014-11-09 11:20:54 +01:00
a97e9fc532 [maven-release-plugin] prepare for next development iteration 2014-11-03 19:59:01 +01:00
22d22382f6 [maven-release-plugin] prepare release pmd_releases/5.2.1 2014-11-03 19:59:00 +01:00
61b11beda7 Another jdk9 fix for Swing's JTree TreeNode 2014-11-02 12:18:45 +01:00
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
4660855609 delete Java grammer from pmd-core - it's now in pmd-java 2014-10-18 10:56:53 +02:00
4a7be51c70 [maven-release-plugin] prepare for next development iteration 2014-10-17 20:15:46 +02:00
118d1c5d30 [maven-release-plugin] prepare release pmd_releases/5.2.0 2014-10-17 20:15:45 +02:00
64f9b04811 Update release docu, rename releases ruleset 514->520 2014-10-12 19:33:58 +02:00
9ade75a621 Refactor CPDGui to detect available languages dynamically 2014-10-12 10:43:53 +02:00
694258d7df Cleanup dependencies 2014-10-12 09:39:43 +02:00
f839ff43d5 Cleanup dependencies 2014-10-11 13:26:10 +02:00
464b0bcef8 Rework CPD's LanguageFactory to use ServiceLoader, too 2014-10-11 12:16:28 +02:00
72719bd0c3 Move C# into own sub-module 2014-10-11 11:23:07 +02:00
7deb1ac596 Bump version to 5.2.0-SNAPSHOT 2014-10-08 22:57:04 +02:00
f748539c45 Rename pmd -> pmd-core and pmd-aggregate -> pmd 2014-10-08 22:52:25 +02:00