You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mirko Friedenhagen (JIRA)" <ji...@codehaus.org> on 2013/02/19 11:56:14 UTC

[jira] (MPMD-163) PMD issues are reported multiple times

Mirko Friedenhagen created MPMD-163:
---------------------------------------

             Summary: PMD issues are reported multiple times
                 Key: MPMD-163
                 URL: https://jira.codehaus.org/browse/MPMD-163
             Project: Maven 2.x PMD Plugin
          Issue Type: Bug
          Components: PMD
    Affects Versions: 3.0
         Environment: Apache Maven 3.0.4
Sun jdk1.6.0_04 on Debian Lenny
Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
            Reporter: Mirko Friedenhagen
            Priority: Blocker


After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
See below for an example of this dramatic outcome:
{code}
[mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
    3682   44655 1239557
[mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
      92    1120   30832
{code}

The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Reijo Tomperi (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reijo Tomperi updated MPMD-163:
-------------------------------

    Attachment: my-app.zip

Sample project where error occurs
                
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Priority: Blocker
>         Attachments: my-app.zip
>
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Mirko Friedenhagen (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=319978#comment-319978 ] 

Mirko Friedenhagen commented on MPMD-163:
-----------------------------------------

When running the unit-tests, this shows as well:
{code}
Running org.apache.maven.plugin.pmd.PmdViolationCheckMojoTest
[INFO] You have 17 warnings. For more details see:/Users/mifr/workspace/foss/maven-pmd-plugin-3.0/target/test/unit/default-configuration/target/pmd.xml
[INFO] PMD Warning: def.configuration.App:80 Rule:UselessParentheses Priority:4 Useless parentheses..
[INFO] PMD Warning: def/configuration/App2.java:22 Rule:UnusedImports Priority:4 Avoid unused imports such as 'java.io.File'.
[INFO] PMD Warning: def/configuration/App2.java:22 Rule:UnusedImports Priority:4 Avoid unused imports such as 'java.io.File'.
[INFO] PMD Warning: def.configuration.AppSample:58 Rule:UselessParentheses Priority:4 Useless parentheses..
[INFO] PMD Warning: def.configuration.AppSample:58 Rule:UselessParentheses Priority:4 Useless parentheses..
[INFO] PMD Warning: def.configuration.AppSample:58 Rule:UselessParentheses Priority:4 Useless parentheses..
[INFO] PMD Failure: def.configuration.App:31 Rule:UnusedPrivateField Priority:3 Avoid unused private fields such as 'unusedVar2'..
[INFO] PMD Failure: def.configuration.App:56 Rule:EmptyCatchBlock Priority:3 Avoid empty catch blocks.
[INFO] PMD Failure: def.configuration.AppSample:27 Rule:UnusedPrivateField Priority:3 Avoid unused private fields such as 'unusedVar'..
[INFO] PMD Failure: def.configuration.AppSample:27 Rule:UnusedPrivateField Priority:3 Avoid unused private fields such as 'unusedVar'..
[INFO] PMD Failure: def.configuration.AppSample:27 Rule:UnusedPrivateField Priority:3 Avoid unused private fields such as 'unusedVar'..
[INFO] PMD Failure: def.configuration.AppSample:45 Rule:UnusedFormalParameter Priority:3 Avoid unused method parameters such as 'unusedParam'..
[INFO] PMD Failure: def.configuration.AppSample:45 Rule:UnusedFormalParameter Priority:3 Avoid unused method parameters such as 'unusedParam'..
[INFO] PMD Failure: def.configuration.AppSample:45 Rule:UnusedFormalParameter Priority:3 Avoid unused method parameters such as 'unusedParam'..
[INFO] PMD Failure: def.configuration.AppSample:45 Rule:UnusedPrivateMethod Priority:3 Avoid unused private methods such as 'unusedMethod(String)'..
[INFO] PMD Failure: def.configuration.AppSample:45 Rule:UnusedPrivateMethod Priority:3 Avoid unused private methods such as 'unusedMethod(String)'..
[INFO] PMD Failure: def.configuration.AppSample:45 Rule:UnusedPrivateMethod Priority:3 Avoid unused private methods such as 'unusedMethod(String)'..
Caught Expected Message: You have 11 PMD violations and 6 warnings. For more details see:/Users/mifr/workspace/foss/maven-pmd-plugin-3.0/target/test/unit/default-configuration/target/pmd.xml
{code}

                
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Priority: Blocker
>         Attachments: my-app.zip
>
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Mirko Friedenhagen (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=319988#comment-319988 ] 

Mirko Friedenhagen edited comment on MPMD-163 at 2/19/13 8:18 AM:
------------------------------------------------------------------

Fix against https://svn.apache.org/repos/asf/maven/plugins/tags/maven-pmd-plugin-3.0, works against trunk as well, sorry for the svn:ignore.
                
      was (Author: mfriedenhagen):
    Fix against https://svn.apache.org/repos/asf/maven/plugins/tags/maven-pmd-plugin-3.0
                  
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Priority: Blocker
>         Attachments: MPMD-163-against-tag-3.0.patch, my-app.zip
>
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Reijo Tomperi (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=319975#comment-319975 ] 

Reijo Tomperi edited comment on MPMD-163 at 2/19/13 6:24 AM:
-------------------------------------------------------------

I attached my-app.zip, which is a sample project where error occurs.

It reports these two violations for othe same file:
Avoid unused constructor parameters such as 'foo'.	4
Avoid unused constructor parameters such as 'foo'.	4

It should report this violation only once. If you remove App.java or rename the class (and file) e.g. to Gapp, then the duplicate goes away. 

This also causes outofmemory error in our project (requires more than 4 GB of memory because the report size grows so large. This renders the new version not only unusable to us, but we had to fall back to previous version (which was especially difficult, because the two versions use different paths in resultset configuration file. 

And to make things even worse, maven 2 uses the latest version if you use "mvn pmd:pmd", even if you have specified it to use some other version in the pom.xml. Only way to use different version is to use command 'mvn org.apache.maven.plugins:maven-pmd-plugin:2.4:pmd'.
                
      was (Author: dvice):
    I attached my-app.zip, which is a sample project where error occurs.

It reports these two violations for othe same file:
Avoid unused constructor parameters such as 'foo'.	4
Avoid unused constructor parameters such as 'foo'.	4

It should report this violation only once. If you remove App.java or rename the class e.g. to Gapp, then the duplicate goes away. 
                  
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Priority: Blocker
>         Attachments: my-app.zip
>
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy closed MPMD-163.
-----------------------------

    Resolution: Fixed

fixed http://svn.apache.org/r1447809
Thanks !
                
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Assignee: Olivier Lamy
>            Priority: Blocker
>             Fix For: 3.1
>
>         Attachments: MPMD-163-against-tag-3.0.patch, my-app.zip
>
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Mirko Friedenhagen (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mirko Friedenhagen updated MPMD-163:
------------------------------------

    Attachment: MPMD-163-against-tag-3.0.patch

Fix against https://svn.apache.org/repos/asf/maven/plugins/tags/maven-pmd-plugin-3.0
                
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Priority: Blocker
>         Attachments: MPMD-163-against-tag-3.0.patch, my-app.zip
>
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Melloware (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=319984#comment-319984 ] 

Melloware commented on MPMD-163:
--------------------------------

I just upgraded to 3.0 this weekend and I am seeing the exact same error.  Tons of duplicates reported repeatedly in the PMD output.   
                
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Priority: Blocker
>         Attachments: my-app.zip
>
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy updated MPMD-163:
------------------------------

    Fix Version/s: 3.1
         Assignee: Olivier Lamy
    
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Assignee: Olivier Lamy
>            Priority: Blocker
>             Fix For: 3.1
>
>         Attachments: MPMD-163-against-tag-3.0.patch, my-app.zip
>
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Reijo Tomperi (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=319973#comment-319973 ] 

Reijo Tomperi edited comment on MPMD-163 at 2/19/13 6:10 AM:
-------------------------------------------------------------

I see this problem also. You can see the duplicates if you create a project with two files in the same package A.java and B.java. If there is a violation in B.java, then it is reported twice. If the violation is in A.java, it gets reported only once. If you have A, B and C. Then violations in C are reported 3 times etc. Also files in other folders can affect this (but that gets more complicated to follow). I tested this with this file:

import java.util.ArrayList;
public class Foo
{
    public Foo(final ArrayList<String> foo)
    {
    }
}

Also note that I don't see this problem when using standalone PMD, so this seems to be issue in the PMD plugin itself. I'm using Apache Maven 2.2.1. 
                
      was (Author: dvice):
    I see this problem also. You can see the duplicates if you create a project with two files in the same package A.java and B.java. If there is a violation in B.java, then it is reported twice. If the violation is in A.java, it gets reported only once. If you have A, B and C. Then violations in C are reported 3 times etc. Also files in other folders can affect this (but that gets more complicated to follow). I tested this with this file:

import java.util.ArrayList;
public class Foo
{
    public Foo(final ArrayList<String> foo)
    {
    }
}

Also note that I don't see this problem when using standalone PMD, so this seems to be issue in the PMD plugin itself. 
                  
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Priority: Blocker
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Reijo Tomperi (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=319975#comment-319975 ] 

Reijo Tomperi edited comment on MPMD-163 at 2/19/13 6:16 AM:
-------------------------------------------------------------

I attached my-app.zip, which is a sample project where error occurs.

It reports these two violations for othe same file:
Avoid unused constructor parameters such as 'foo'.	4
Avoid unused constructor parameters such as 'foo'.	4

It should report this violation only once. If you remove App.java or rename the class e.g. to Gapp, then the duplicate goes away. 
                
      was (Author: dvice):
    Sample project where error occurs
                  
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Priority: Blocker
>         Attachments: my-app.zip
>
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MPMD-163) PMD issues are reported multiple times

Posted by "Reijo Tomperi (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPMD-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=319973#comment-319973 ] 

Reijo Tomperi commented on MPMD-163:
------------------------------------

I see this problem also. You can see the duplicates if you create a project with two files in the same package A.java and B.java. If there is a violation in B.java, then it is reported twice. If the violation is in A.java, it gets reported only once. If you have A, B and C. Then violations in C are reported 3 times etc. Also files in other folders can affect this (but that gets more complicated to follow). I tested this with this file:

import java.util.ArrayList;
public class Foo
{
    public Foo(final ArrayList<String> foo)
    {
    }
}

Also note that I don't see this problem when using standalone PMD, so this seems to be issue in the PMD plugin itself. 
                
> PMD issues are reported multiple times
> --------------------------------------
>
>                 Key: MPMD-163
>                 URL: https://jira.codehaus.org/browse/MPMD-163
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.0
>         Environment: Apache Maven 3.0.4
> Sun jdk1.6.0_04 on Debian Lenny
> Oracle jdk 1.7.0_13 on Mac OS X (10.8.2)
>            Reporter: Mirko Friedenhagen
>            Priority: Blocker
>
> After updating maven-pmd-plugin from 2.7.1 to 3.0, in some of our projects the number of pmd violations exploded. Some are valid (new rules), however I have a project where the same violation will show up more than 70 times!
> See below for an example of this dramatic outcome:
> {code}
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | wc
>     3682   44655 1239557
> [mifr@host SomeService]$ grep '^<violation' target/pmd.xml | sort | uniq | wc
>       92    1120   30832
> {code}
> The number of source files in this project in total is 96, so a wild guess would be, that the plugin readds already existing violations (the first (unique) violation occurs once, the second 4 times and so on). I will try t take a look at the source code or to get a working testcase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira