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

"warning" and "performance" not counted

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      There are entries in the report table with severity of "warning" and "performance", but they are not included in the totals or the graph.

        Attachments

          Issue Links

            Activity

            Hide
            jameshowe James Howe added a comment -

            Yes, switching to --xml-version=2 solves the problems.

            Show
            jameshowe James Howe added a comment - Yes, switching to --xml-version=2 solves the problems.
            Hide
            mixalturek Michal Turek added a comment -

            Oh, I understand now. Legacy XML v1 format uses severities that are not compatible with new XML v2. There is the following mapping in the plugin code.

                        if ("possible error".equals(cppcheckFile.getSeverity())) {
                            warningSeverityList.add(cppcheckFile);
                        } else if ("style".equals(cppcheckFile.getSeverity())) {
                            styleSeverityList.add(cppcheckFile);
                        } else if ("possible style".equals(cppcheckFile.getSeverity())) {
                            performanceSeverityList.add(cppcheckFile);
                        } else if ("error".equals(cppcheckFile.getSeverity())) {
                            errorSeverityList.add(cppcheckFile);
                        } else {
                            noCategorySeverityList.add(cppcheckFile);
                        }
                        allErrors.add(cppcheckFile);
            

            You should always use XML v2. Cppcheck for example reports less issues with XML v1 than with XML v2 for the same analyzed code.

            Show
            mixalturek Michal Turek added a comment - Oh, I understand now. Legacy XML v1 format uses severities that are not compatible with new XML v2. There is the following mapping in the plugin code. if ("possible error".equals(cppcheckFile.getSeverity())) { warningSeverityList.add(cppcheckFile); } else if ("style".equals(cppcheckFile.getSeverity())) { styleSeverityList.add(cppcheckFile); } else if ("possible style".equals(cppcheckFile.getSeverity())) { performanceSeverityList.add(cppcheckFile); } else if ("error".equals(cppcheckFile.getSeverity())) { errorSeverityList.add(cppcheckFile); } else { noCategorySeverityList.add(cppcheckFile); } allErrors.add(cppcheckFile); You should always use XML v2. Cppcheck for example reports less issues with XML v1 than with XML v2 for the same analyzed code.
            Hide
            mixalturek Michal Turek added a comment -

            Rejected, the issue can't occur without manual modification of the input report.

            Show
            mixalturek Michal Turek added a comment - Rejected, the issue can't occur without manual modification of the input report.
            Hide
            jameshowe James Howe added a comment -

            Maybe add a warning if the plugin detects the v1 format, but that'll be a separate ticket.

            Show
            jameshowe James Howe added a comment - Maybe add a warning if the plugin detects the v1 format, but that'll be a separate ticket.
            Hide
            mixalturek Michal Turek added a comment -

            Simple but great idea, JENKINS-24007 created, thanks

            Show
            mixalturek Michal Turek added a comment - Simple but great idea, JENKINS-24007 created, thanks

              People

              • Assignee:
                mixalturek Michal Turek
                Reporter:
                jameshowe James Howe
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: