• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • pmd-plugin, warnings-plugin
    • Jenkins v. 1.554.2
      PMD Plugin v. 3.38.
      Static Code Analysis Plugins v. 1.58

      Hello.
      I've got a problem with computing new warnings functional.
      When I add a new PMD rule to my ruleset, I get odd results.
      Test case:

      1. Start the first build.
        See summary and full results.
      2. Add a new PMD rule to rule set and start the second build.
        Rule 'LongVariable' was added. The summary contains only 192 new warnings instead of 267 (==3126-2859).
        Moreover, full result contains 267 warning for new 'LongVariable' rule (match against first result).
      3. Go to job configuration, check 'Use delta for new warnings' check box and start the third build.
        The result changed.
        The summary contains both 192 and 267 new warnings on the same page.
        Besides, link '267 new warnings' opens a page with 192 new warnings.
        I suppose that the number of new warning should always be 267 in the example.

        1. new_build_1_sum.png
          new_build_1_sum.png
          6 kB
        2. new_build_2_new.png
          new_build_2_new.png
          4 kB
        3. new_build_2_sum.png
          new_build_2_sum.png
          6 kB
        4. new_build_3_new.png
          new_build_3_new.png
          4 kB
        5. new_build_3_sum.png
          new_build_3_sum.png
          6 kB
        6. tc_1_log.png
          tc_1_log.png
          13 kB
        7. tc_2_log.png
          tc_2_log.png
          14 kB
        8. tc_3_log.png
          tc_3_log.png
          14 kB
        9. build_1_full.png
          build_1_full.png
          56 kB
        10. build_1_sum.png
          build_1_sum.png
          6 kB
        11. build_2_full.png
          build_2_full.png
          57 kB
        12. build_2_sum.png
          build_2_sum.png
          7 kB
        13. build_3_full.png
          build_3_full.png
          57 kB
        14. build_3_sum.png
          build_3_sum.png
          7 kB

          [JENKINS-24873] Wrong number of new warnings

          Ulli Hafner added a comment -

          I see. Seems that some new warnings have the same properties and are therefore marked as duplicates.

          Ulli Hafner added a comment - I see. Seems that some new warnings have the same properties and are therefore marked as duplicates.

          Sergey Ryazantsev added a comment - - edited

          Hello, Ulli.
          What kind of properties are you talking about?

          Sergey Ryazantsev added a comment - - edited Hello, Ulli. What kind of properties are you talking about?

          Ulli Hafner added a comment -

          Same type, filename, line, ... Currently all warnings are collected in a set which does not contain duplicates.

          Ulli Hafner added a comment - Same type, filename, line, ... Currently all warnings are collected in a set which does not contain duplicates.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/core/FilesParser.java
          src/main/java/hudson/plugins/analysis/core/ParserResult.java
          http://jenkins-ci.org/commit/analysis-core-plugin/1d1eb5b17cc4fa21043fe8332599b66ab1e17334
          Log:
          Merge pull request #21 from sschuberth/master

          Fix checking for duplicate annotations. (Maybe related to JENKINS-24873).

          Compare: https://github.com/jenkinsci/analysis-core-plugin/compare/a5cae3ab9dfd...1d1eb5b17cc4

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/core/FilesParser.java src/main/java/hudson/plugins/analysis/core/ParserResult.java http://jenkins-ci.org/commit/analysis-core-plugin/1d1eb5b17cc4fa21043fe8332599b66ab1e17334 Log: Merge pull request #21 from sschuberth/master Fix checking for duplicate annotations. (Maybe related to JENKINS-24873 ). Compare: https://github.com/jenkinsci/analysis-core-plugin/compare/a5cae3ab9dfd...1d1eb5b17cc4

          Ulli Hafner added a comment -

          Do you have some warnings in the same line and column?

          Ulli Hafner added a comment - Do you have some warnings in the same line and column?

          Yes, I have.

          Sergey Ryazantsev added a comment - Yes, I have.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/core/BuildResultEvaluator.java
          http://jenkins-ci.org/commit/analysis-core-plugin/c873a76a22edd958c33578713fc317eec5a3df0e
          Log:
          JENKINS-24873 Fixed priority naming.

          Compare: https://github.com/jenkinsci/analysis-core-plugin/compare/b75554ea6be6...c873a76a22ed

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/core/BuildResultEvaluator.java http://jenkins-ci.org/commit/analysis-core-plugin/c873a76a22edd958c33578713fc317eec5a3df0e Log: JENKINS-24873 Fixed priority naming. Compare: https://github.com/jenkinsci/analysis-core-plugin/compare/b75554ea6be6...c873a76a22ed

          Ulli Hafner added a comment -

          Can you please check if this works with the pull request that is part of new analysis-core 1.61 release?

          Ulli Hafner added a comment - Can you please check if this works with the pull request that is part of new analysis-core 1.61 release?

          Sergey Ryazantsev added a comment - - edited

          I've installed analysis-core v. 1.61, but nothing was changed.

          Sergey Ryazantsev added a comment - - edited I've installed analysis-core v. 1.61, but nothing was changed.

          Ulli Hafner added a comment -

          Did you restart the build? Previous results are persisted and cannot not be changed.

          Ulli Hafner added a comment - Did you restart the build? Previous results are persisted and cannot not be changed.

          Actually, I've created a new job.

          Sergey Ryazantsev added a comment - Actually, I've created a new job.

          Ulli Hafner added a comment - - edited

          Can you please show the log messages from the PMD plugin at the end of the console log of your job? (And did the message in the job change from "warnings of priority Normal Priority" to "warnings of priority Normal"?)

          Ulli Hafner added a comment - - edited Can you please show the log messages from the PMD plugin at the end of the console log of your job? (And did the message in the job change from "warnings of priority Normal Priority" to "warnings of priority Normal"?)

          Can you please show the log messages from the PMD plugin at the end of the console log of your job?

          See 1, 2 and 3 for the same test cases correspondingly.

          And did the message in the job change from "warnings of priority Normal Priority" to "warnings of priority Normal"?

          Yes, it did.
          So, the plugin was really installed

          Sergey Ryazantsev added a comment - Can you please show the log messages from the PMD plugin at the end of the console log of your job? See 1 , 2 and 3 for the same test cases correspondingly. And did the message in the job change from "warnings of priority Normal Priority" to "warnings of priority Normal"? Yes, it did. So, the plugin was really installed

          Ulli Hafner added a comment -

          Sorry, seems that I did not read the bug report carefully. The described behavior is unrelated to the changes of the pull request.

          Currently the algorithm to detect new warnings is not rock-solid. But I think I can improve the algorithm somewhat so that this issue will be fixed. (This is not a general solution, here we need to wait for JENKINS-6675.)

          Ulli Hafner added a comment - Sorry, seems that I did not read the bug report carefully. The described behavior is unrelated to the changes of the pull request. Currently the algorithm to detect new warnings is not rock-solid. But I think I can improve the algorithm somewhat so that this issue will be fixed. (This is not a general solution, here we need to wait for JENKINS-6675 .)

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/pmd/parser/PmdParser.java
          http://jenkins-ci.org/commit/pmd-plugin/c6093bba7feef7a46e56bbb2027db868c763f98d
          Log:
          [FIXED JENKINS-24873] Use warning type in hash code computation.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/pmd/parser/PmdParser.java http://jenkins-ci.org/commit/pmd-plugin/c6093bba7feef7a46e56bbb2027db868c763f98d Log: [FIXED JENKINS-24873] Use warning type in hash code computation.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          .idea/inspectionProfiles/Project_Default.xml
          http://jenkins-ci.org/commit/analysis-suite-plugin/0a6e1b6982b33012fa505f3e91619aebdbb904b7
          Log:
          [FIXED JENKINS-24873] Use warning type in hash code computation.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: .idea/inspectionProfiles/Project_Default.xml http://jenkins-ci.org/commit/analysis-suite-plugin/0a6e1b6982b33012fa505f3e91619aebdbb904b7 Log: [FIXED JENKINS-24873] Use warning type in hash code computation.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/dry/parser/DuplicationParserRegistry.java
          http://jenkins-ci.org/commit/dry-plugin/51a6950bad1d6684a3dac0a11841cc1b017d91ea
          Log:
          [FIXED JENKINS-24873] Use warning type in hash code computation.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/dry/parser/DuplicationParserRegistry.java http://jenkins-ci.org/commit/dry-plugin/51a6950bad1d6684a3dac0a11841cc1b017d91ea Log: [FIXED JENKINS-24873] Use warning type in hash code computation.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/checkstyle/parser/CheckStyleParser.java
          http://jenkins-ci.org/commit/checkstyle-plugin/dff75c9214f32e286c014cb27ab88923bf88c056
          Log:
          [FIXED JENKINS-24873] Use warning type in hash code computation.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/checkstyle/parser/CheckStyleParser.java http://jenkins-ci.org/commit/checkstyle-plugin/dff75c9214f32e286c014cb27ab88923bf88c056 Log: [FIXED JENKINS-24873] Use warning type in hash code computation.

          But I think I can improve the algorithm somewhat so that this issue will be fixed.

          Ulli, how can I test this fix?

          Sergey Ryazantsev added a comment - But I think I can improve the algorithm somewhat so that this issue will be fixed. Ulli, how can I test this fix?

          Ulli Hafner added a comment -

          Sorry, didn't find time to make a new release yet. You can download the latest plugin from our CI server, there is a link in the top of the plugin wiki pages.

          Ulli Hafner added a comment - Sorry, didn't find time to make a new release yet. You can download the latest plugin from our CI server, there is a link in the top of the plugin wiki pages.

          Thank you, Ulli!
          I've tested the 3.39-SNAPSHOT version from your CI server and the problem hasn't reproduced.
          I'm looking forward to plugin release!

          Sergey Ryazantsev added a comment - Thank you, Ulli! I've tested the 3.39-SNAPSHOT version from your CI server and the problem hasn't reproduced. I'm looking forward to plugin release!

          Thank you for your work, Ulli.

          Sergey Ryazantsev added a comment - Thank you for your work, Ulli.

          Sergey Ryazantsev added a comment - - edited

          Hello, Ulli.

          I've faced with related problem on another project.
          Test case:

          1. Start the first build.
            See summary result.
          2. Change source code, check "Use delta for new warnings" check box and start the second build.
            The numbers of new NORMAL priority warnings are different: 2 in sum result and 3 on new warning page.
          3. Uncheck "Use delta for new warnings" check box and start the third build.
            The numbers of new NORMAL priority warnings become the same: 3 in sum result and 3 on new warning page.

          It seems that is case "Use delta for new warnings" check box is checked, another algorithm is used only for build summary page. But for a new warnings page generation is used the same algorithm as in case "Use delta for new warnings" check box is unchecked.

          I suppose that number of new warnings of a particular priority on new warning page should always be the same as on build summary page.

          Sergey Ryazantsev added a comment - - edited Hello, Ulli. I've faced with related problem on another project. Test case: Start the first build. See summary result. Change source code, check "Use delta for new warnings" check box and start the second build. The numbers of new NORMAL priority warnings are different: 2 in sum result and 3 on new warning page . Uncheck "Use delta for new warnings" check box and start the third build. The numbers of new NORMAL priority warnings become the same: 3 in sum result and 3 on new warning page . It seems that is case "Use delta for new warnings" check box is checked, another algorithm is used only for build summary page. But for a new warnings page generation is used the same algorithm as in case "Use delta for new warnings" check box is unchecked. I suppose that number of new warnings of a particular priority on new warning page should always be the same as on build summary page.

          Any updates, Ulli?

          Sergey Ryazantsev added a comment - Any updates, Ulli?

          Ulli Hafner added a comment -

          Actually no, I'm not sure what I can do here. The delta algorithm cannot be used to compute the actual new warnings, since it only subtracts the totals of two builds. Maybe I should remove the flag, seems only to be helpful if the other algorithm is too slow due to a lot of warnings.

          Ulli Hafner added a comment - Actually no, I'm not sure what I can do here. The delta algorithm cannot be used to compute the actual new warnings, since it only subtracts the totals of two builds. Maybe I should remove the flag, seems only to be helpful if the other algorithm is too slow due to a lot of warnings.

          Do you mean that usage of different algorithms on a build summary page and new warnings page while "Use delta for new warnings" is checked is expected plugin behaviour?

          Sergey Ryazantsev added a comment - Do you mean that usage of different algorithms on a build summary page and new warnings page while "Use delta for new warnings" is checked is expected plugin behaviour?

          Ulli Hafner added a comment -

          Well, yes

          Ulli Hafner added a comment - Well, yes

          Actually, we use delta checkbox because the other algorithm too frequently finds false positive new warnings. But, as I've got, this should be fixed in JENKINS-6675.

          Sergey Ryazantsev added a comment - Actually, we use delta checkbox because the other algorithm too frequently finds false positive new warnings. But, as I've got, this should be fixed in JENKINS-6675 .

          Ulli Hafner added a comment -

          One of my students is currently improving the new warning detection using a new algorithm that is based on the Java syntax tree. Hopefully, this will reduce the number of false positives. However, you can easily find an example of a false positive for every algorithm...

          Ulli Hafner added a comment - One of my students is currently improving the new warning detection using a new algorithm that is based on the Java syntax tree. Hopefully, this will reduce the number of false positives. However, you can easily find an example of a false positive for every algorithm...

          dirmeier added a comment -

          Hi Ulli, after updating we now have the warning that all warnings are new (and fixed at the same time). May this problem relates to this issue?

          dirmeier added a comment - Hi Ulli, after updating we now have the warning that all warnings are new (and fixed at the same time). May this problem relates to this issue?

            drulli Ulli Hafner
            xpyctnc Sergey Ryazantsev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: