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

Fix findings from FindBugs static analysis

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      FindBugs reports several issues present in the code.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Michal Turek
          Path:
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckMetricUtil.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckResult.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckSourceContainer.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckWorkspaceFile.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/util/CppcheckMetricUtil.java
          src/test/java/com/thalesgroup/hudson/plugins/cppcheck/AbstractWorkspaceTest.java
          src/test/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckParserTest.java
          src/test/java/org/jenkinsci/plugins/cppcheck/CppcheckParserTest.java
          http://jenkins-ci.org/commit/cppcheck-plugin/1aa01f225235d1763a8523b9c8caf7838c311ec4
          Log:
          JENKINS-22214 Fix findings from FindBugs static analysis

          • CppcheckMetricUtil: A boxed primitive is created from a String, just to extract the unboxed primitive value. It is more efficient to just call the static parseXXX method.
          • CppcheckResult: Private method com.thalesgroup.hudson.plugins.cppcheck.CppcheckResult.getPreviousReport() is never called.
          • CppcheckResult: Class com.thalesgroup.hudson.plugins.cppcheck.CppcheckResult defines non-transient non-serializable instance field cppcheckSourceContainer.
          • CppcheckSource: Class com.thalesgroup.hudson.plugins.cppcheck.CppcheckSource defines non-transient non-serializable instance field cppcheckWorkspaceFile.
          • AbstractWorkspaceTest: AbstractWorkspaceTest.workspace not initialized in constructor and dereferenced in com.thalesgroup.hudson.plugins.cppcheck.AbstractWorkspaceTest.deleteWorkspace().
          • CppcheckParserResultTestCppcheckParserResultTest: AbstractWorkspaceTest.workspace not initialized in constructor and dereferenced in com.thalesgroup.hudson.plugins.cppcheck.CppcheckParserResultTest.testNoMatch().
          • CppcheckParserTest: Usage of GetResource in com.thalesgroup.hudson.plugins.cppcheck.CppcheckParserTest.processCheckstyle(String, int, int, int, int, int, int) may be unsafe if class is extended.
          • serialVersionUID member variables defined in serializable classes.
          • Unneccessary @SuppressWarnings("unused") removed to solve compiler warnings.
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michal Turek Path: src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckMetricUtil.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckResult.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckSourceContainer.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckWorkspaceFile.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/util/CppcheckMetricUtil.java src/test/java/com/thalesgroup/hudson/plugins/cppcheck/AbstractWorkspaceTest.java src/test/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckParserTest.java src/test/java/org/jenkinsci/plugins/cppcheck/CppcheckParserTest.java http://jenkins-ci.org/commit/cppcheck-plugin/1aa01f225235d1763a8523b9c8caf7838c311ec4 Log: JENKINS-22214 Fix findings from FindBugs static analysis CppcheckMetricUtil: A boxed primitive is created from a String, just to extract the unboxed primitive value. It is more efficient to just call the static parseXXX method. CppcheckResult: Private method com.thalesgroup.hudson.plugins.cppcheck.CppcheckResult.getPreviousReport() is never called. CppcheckResult: Class com.thalesgroup.hudson.plugins.cppcheck.CppcheckResult defines non-transient non-serializable instance field cppcheckSourceContainer. CppcheckSource: Class com.thalesgroup.hudson.plugins.cppcheck.CppcheckSource defines non-transient non-serializable instance field cppcheckWorkspaceFile. AbstractWorkspaceTest: AbstractWorkspaceTest.workspace not initialized in constructor and dereferenced in com.thalesgroup.hudson.plugins.cppcheck.AbstractWorkspaceTest.deleteWorkspace(). CppcheckParserResultTestCppcheckParserResultTest: AbstractWorkspaceTest.workspace not initialized in constructor and dereferenced in com.thalesgroup.hudson.plugins.cppcheck.CppcheckParserResultTest.testNoMatch(). CppcheckParserTest: Usage of GetResource in com.thalesgroup.hudson.plugins.cppcheck.CppcheckParserTest.processCheckstyle(String, int, int, int, int, int, int) may be unsafe if class is extended. serialVersionUID member variables defined in serializable classes. Unneccessary @SuppressWarnings("unused") removed to solve compiler warnings.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Michal Turek
          Path:
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckMetricUtil.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckResult.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckSourceContainer.java
          src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckWorkspaceFile.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/util/CppcheckMetricUtil.java
          src/test/java/com/thalesgroup/hudson/plugins/cppcheck/AbstractWorkspaceTest.java
          src/test/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckParserTest.java
          src/test/java/org/jenkinsci/plugins/cppcheck/CppcheckParserTest.java
          http://jenkins-ci.org/commit/cppcheck-plugin/d72781b7ef7e13065dab1862fe5686f60a72037f
          Log:
          Merge pull request #9 from mixalturek/master

          JENKINS-22214 Fix findings from FindBugs static analysis

          Compare: https://github.com/jenkinsci/cppcheck-plugin/compare/08bfa8b03d16...d72781b7ef7e

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michal Turek Path: src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckMetricUtil.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckResult.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckSourceContainer.java src/main/java/com/thalesgroup/hudson/plugins/cppcheck/model/CppcheckWorkspaceFile.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/util/CppcheckMetricUtil.java src/test/java/com/thalesgroup/hudson/plugins/cppcheck/AbstractWorkspaceTest.java src/test/java/com/thalesgroup/hudson/plugins/cppcheck/CppcheckParserTest.java src/test/java/org/jenkinsci/plugins/cppcheck/CppcheckParserTest.java http://jenkins-ci.org/commit/cppcheck-plugin/d72781b7ef7e13065dab1862fe5686f60a72037f Log: Merge pull request #9 from mixalturek/master JENKINS-22214 Fix findings from FindBugs static analysis Compare: https://github.com/jenkinsci/cppcheck-plugin/compare/08bfa8b03d16...d72781b7ef7e
          Hide
          mixalturek Michal Turek added a comment -

          Fixed, will be released in version 1.15.

          Show
          mixalturek Michal Turek added a comment - Fixed, will be released in version 1.15.

            People

            • Assignee:
              mixalturek Michal Turek
              Reporter:
              mixalturek Michal Turek
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: