Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9727

CPP Check should support new xml output format

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: cppcheck-plugin
    • Labels:
      None

      Description

      Since release 1.47, Cppcheck has supported a new output version format that is more expressive and does a better job of categorizing issues as error/warning/performance/style/information.

      The cppcheck plugin does not appear to work with output format 2.

      --xml-version=2

      1. testCppCheckVersion1.xml
        3 kB
        Andrew Wallen
      2. testCppCheckVersion2.xml
        4 kB
        Andrew Wallen

        Issue Links

          Activity

          Hide
          gbois Gregory Boissinot added a comment -

          I was not aware about this new format.
          Could you attach some samples?
          I'll upgrade the plugin to the new cppcheck output.

          Show
          gbois Gregory Boissinot added a comment - I was not aware about this new format. Could you attach some samples? I'll upgrade the plugin to the new cppcheck output.
          Hide
          anwallen Andrew Wallen added a comment -

          Sample output files from CPP Check for the same set of files using xml-version=1 and xml-version=2.

          Show
          anwallen Andrew Wallen added a comment - Sample output files from CPP Check for the same set of files using xml-version=1 and xml-version=2.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          pom.xml
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckResult.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/parser/CppcheckParser.java
          src/main/resources/org/jenkinsci/plugins/cppcheck/cppcheck-2.0.xsd
          src/test/java/org/jenkinsci/plugins/cppcheck/CppcheckParserTest.java
          src/test/resources/org/jenkinsci/plugins/cppcheck/version2/testCppcheck.xml
          http://jenkins-ci.org/commit/cppcheck-plugin/31a2a1d3aa2c1e41c2f3ee52b0104a3550231a79
          Log:
          Fix JENKINS-9727

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: pom.xml src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckResult.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/parser/CppcheckParser.java src/main/resources/org/jenkinsci/plugins/cppcheck/cppcheck-2.0.xsd src/test/java/org/jenkinsci/plugins/cppcheck/CppcheckParserTest.java src/test/resources/org/jenkinsci/plugins/cppcheck/version2/testCppcheck.xml http://jenkins-ci.org/commit/cppcheck-plugin/31a2a1d3aa2c1e41c2f3ee52b0104a3550231a79 Log: Fix JENKINS-9727
          Hide
          gbois Gregory Boissinot added a comment -

          Fixed.
          Please download 0.17

          Show
          gbois Gregory Boissinot added a comment - Fixed. Please download 0.17
          Hide
          reynoldss Sean Reynolds added a comment -

          The cppcheck plugin does not expect the "warning" or "information" error types in the version 2 xml output, which correspond to "possible error" and "possible style" in the plugin's graphs. As a result, the plugin considers these types to be uncategorized, and those two lines on the graph are always at 0.

          Show
          reynoldss Sean Reynolds added a comment - The cppcheck plugin does not expect the "warning" or "information" error types in the version 2 xml output, which correspond to "possible error" and "possible style" in the plugin's graphs. As a result, the plugin considers these types to be uncategorized, and those two lines on the graph are always at 0.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/parser/CppcheckParser.java
          http://jenkins-ci.org/commit/cppcheck-plugin/b4543d6568d9c510ec0f5bedb68dcf8bf6877570
          Log:
          FIXED JENKINS-9727

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/com/thalesgroup/hudson/plugins/cppcheck/parser/CppcheckParser.java http://jenkins-ci.org/commit/cppcheck-plugin/b4543d6568d9c510ec0f5bedb68dcf8bf6877570 Log: FIXED JENKINS-9727
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/test/java/org/jenkinsci/plugins/cppcheck/CppcheckParserTest.java
          src/test/resources/org/jenkinsci/plugins/cppcheck/version2/testCppcheck.xml
          http://jenkins-ci.org/commit/cppcheck-plugin/43b17b974695a3b379c3b83f81d906e5785c94cd
          Log:
          Updated to Fix JENKINS-9727

          Compare: https://github.com/jenkinsci/cppcheck-plugin/compare/1fcc8bf...43b17b9

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/test/java/org/jenkinsci/plugins/cppcheck/CppcheckParserTest.java src/test/resources/org/jenkinsci/plugins/cppcheck/version2/testCppcheck.xml http://jenkins-ci.org/commit/cppcheck-plugin/43b17b974695a3b379c3b83f81d906e5785c94cd Log: Updated to Fix JENKINS-9727 Compare: https://github.com/jenkinsci/cppcheck-plugin/compare/1fcc8bf...43b17b9
          Hide
          gbois Gregory Boissinot added a comment -

          I fixed it with your mapping (warning --> possible error and information --> possible style).
          Does this mapping suit you or would you like add categories in the graph?

          Show
          gbois Gregory Boissinot added a comment - I fixed it with your mapping (warning --> possible error and information --> possible style). Does this mapping suit you or would you like add categories in the graph?
          Hide
          gbois Gregory Boissinot added a comment -

          Waiting validation with the new mapping

          Show
          gbois Gregory Boissinot added a comment - Waiting validation with the new mapping
          Hide
          reynoldss Sean Reynolds added a comment -

          According to the cppcheck manual, the only possible levels are: error, warning, style, performance, information. I haven't seen "possible error" or "possible style" so they may be old names for some of the current categories. If there is any potential issue with old graphs, though, I would say that the current mapping is perfectly fine, perhaps adding "performance" as another way to map into "possible style".

          Show
          reynoldss Sean Reynolds added a comment - According to the cppcheck manual , the only possible levels are: error, warning, style, performance, information. I haven't seen "possible error" or "possible style" so they may be old names for some of the current categories. If there is any potential issue with old graphs, though, I would say that the current mapping is perfectly fine, perhaps adding "performance" as another way to map into "possible style".
          Hide
          anwallen Andrew Wallen added a comment -

          Here is categories list from the CppCheck manual in textual form:

          • error--used when bugs are found
          • warning--suggestions about defensive programming to prevent bugs
          • style--stylistic issues related to code cleanup (unused functions, redundant code, constness, and such)
          • performance--suggestions for making the code faster
          • information--Informational messages that might be interesting. Ignore these messages unless you really agree

          I would personally vote for new categories, but if we could get a 1:1 mapping, it doesn't really make that much of a difference to me. If you opt for keeping the original categories, I'd recommend leaving information-level messages uncategorized as they are typically things like unavailable library headers rather than real analysis flags. This would leave you with the following mapping:

          New Category Old Category
          error error
          warning possible error
          style style
          performance possible style
          information no category
          Show
          anwallen Andrew Wallen added a comment - Here is categories list from the CppCheck manual in textual form: error--used when bugs are found warning--suggestions about defensive programming to prevent bugs style--stylistic issues related to code cleanup (unused functions, redundant code, constness, and such) performance--suggestions for making the code faster information--Informational messages that might be interesting. Ignore these messages unless you really agree I would personally vote for new categories, but if we could get a 1:1 mapping, it doesn't really make that much of a difference to me. If you opt for keeping the original categories, I'd recommend leaving information-level messages uncategorized as they are typically things like unavailable library headers rather than real analysis flags. This would leave you with the following mapping: New Category Old Category error error warning possible error style style performance possible style information no category
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckAreaRenderer.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckBuildAction.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckMetricUtil.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckProjectAction.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckPublisher.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckReport.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckResult.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckSource.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/config/CppcheckConfig.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/config/CppcheckConfigGraph.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/config/CppcheckConfigSeverityEvaluation.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/graph/CppcheckGraph.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckFile.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckWorkspaceFile.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/parser/CppcheckParser.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/util/AbstractCppcheckBuildAction.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/util/AbstractCppcheckProjectAction.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/util/CppcheckBuildHealthEvaluator.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/util/CppcheckBuildResultEvaluator.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/util/CppcheckLogger.java
          src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckBuildAction.java
          src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckParserResult.java
          src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckProjectAction.java
          src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckPublisher.java
          src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckReport.java
          src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckResult.java
          src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckSummary.java
          src/main/java/org/jenkinsci/plugins/cppcheck/config/CppcheckConfig.java
          src/main/java/org/jenkinsci/plugins/cppcheck/config/CppcheckConfigGraph.java
          src/main/java/org/jenkinsci/plugins/cppcheck/config/CppcheckConfigSeverityEvaluation.java
          src/main/java/org/jenkinsci/plugins/cppcheck/parser/CppcheckParser.java
          src/main/java/org/jenkinsci/plugins/cppcheck/util/AbstractCppcheckProjectAction.java
          src/main/java/org/jenkinsci/plugins/cppcheck/util/CppcheckBuildHealthEvaluator.java
          src/main/java/org/jenkinsci/plugins/cppcheck/util/CppcheckBuildResultEvaluator.java
          src/main/java/org/jenkinsci/plugins/cppcheck/util/CppcheckMetricUtil.java
          src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckBuildAction/summary.jelly
          src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckProjectAction/floatingBox.jelly
          src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckProjectAction/nodata.jelly
          src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckPublisher/config.jelly
          src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckPublisher/config.properties
          src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckResult/index.jelly
          src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckResult/nosourcepermission.jelly
          src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckResult/summary.jelly
          src/main/resources/org/jenkinsci/plugins/cppcheck/cppcheck-2.0.xsd
          src/main/resources/tabview/main.jelly
          src/main/resources/util/thresholds.jelly
          http://jenkins-ci.org/commit/cppcheck-plugin/e41b5804cfc4e799c5ea9f1c91c4abe42533114f
          Log:
          FIx JENKINS-10369 and JENKINS-9727

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckAreaRenderer.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckBuildAction.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckMetricUtil.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckProjectAction.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckPublisher.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckReport.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckResult.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckSource.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/config/CppcheckConfig.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/config/CppcheckConfigGraph.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/config/CppcheckConfigSeverityEvaluation.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/graph/CppcheckGraph.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckFile.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckWorkspaceFile.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/parser/CppcheckParser.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/util/AbstractCppcheckBuildAction.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/util/AbstractCppcheckProjectAction.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/util/CppcheckBuildHealthEvaluator.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/util/CppcheckBuildResultEvaluator.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/util/CppcheckLogger.java src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckBuildAction.java src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckParserResult.java src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckProjectAction.java src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckPublisher.java src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckReport.java src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckResult.java src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckSummary.java src/main/java/org/jenkinsci/plugins/cppcheck/config/CppcheckConfig.java src/main/java/org/jenkinsci/plugins/cppcheck/config/CppcheckConfigGraph.java src/main/java/org/jenkinsci/plugins/cppcheck/config/CppcheckConfigSeverityEvaluation.java src/main/java/org/jenkinsci/plugins/cppcheck/parser/CppcheckParser.java src/main/java/org/jenkinsci/plugins/cppcheck/util/AbstractCppcheckProjectAction.java src/main/java/org/jenkinsci/plugins/cppcheck/util/CppcheckBuildHealthEvaluator.java src/main/java/org/jenkinsci/plugins/cppcheck/util/CppcheckBuildResultEvaluator.java src/main/java/org/jenkinsci/plugins/cppcheck/util/CppcheckMetricUtil.java src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckBuildAction/summary.jelly src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckProjectAction/floatingBox.jelly src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckProjectAction/nodata.jelly src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckPublisher/config.jelly src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckPublisher/config.properties src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckResult/index.jelly src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckResult/nosourcepermission.jelly src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckResult/summary.jelly src/main/resources/org/jenkinsci/plugins/cppcheck/cppcheck-2.0.xsd src/main/resources/tabview/main.jelly src/main/resources/util/thresholds.jelly http://jenkins-ci.org/commit/cppcheck-plugin/e41b5804cfc4e799c5ea9f1c91c4abe42533114f Log: FIx JENKINS-10369 and JENKINS-9727
          Show
          gbois Gregory Boissinot added a comment - Fix available in 1.0.0 http://maven.jenkins-ci.org:8081/content/repositories/releases/org/jenkins-ci/plugins/cppcheck/1.0.0
          Hide
          mixalturek Michal Turek added a comment -

          Closing.

          Show
          mixalturek Michal Turek added a comment - Closing.

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              anwallen Andrew Wallen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: