The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Klocwork Community Plug-in

klocworkBuildSpecGeneration: Klocwork - (step 1 - capture) Capture Build Information

  • buildSpecConfig
      Nested Object
    • buildCommand
      Specify your projects build command. This will be used to compile the project and capture information about the build in a build specification file that Klocwork will use for the analysis.
      • Type: String
    • tool
      The Klocwork tool used to generate the build specification, by default this is set to kwinject.
      Tools Available: kwinject monitors your C/C++ build to create a build specification kwmaven creates a Java build specification based on the information in your maven build file kwant creates a Java build specification based on the information in your ant build file kwvcprojparser provides an alternative when kwinject cannot be used to create a build specification for a Microsoft Visual Studio .NET 2003, 2005, 2008 or 2010 C/C++ project kwcsprojparser creates a build specification for Visual Studio C# projects and solutions create tracefile uses kwinject to create a trace file, mainly used for debugging kwgradle creates a Java build specification based on the information in your gradle build file kwgradlew creates a Java build specification based on the information in your gradle wrapper file
      • Type: String
    • output
      Specify the build specification output filename and or directory. By default this is generated as kwinject.out in the current workspace directory. This path can be absolute or relative to the workspace directory.
      • Type: String
    • additionalOpts
      Any other tool options can be specified here. Options to be separated via whitespace, surround any arguments with whitespace in double quotes.
      • Type: String
    • ignoreErrors
      Ignore any error return codes from this step and continue
      • Type: boolean

klocworkIncremental: Klocwork - Incremental Diff Analysis

  • ciConfig
      Nested Object
    • buildSpec
      Build specification to use for analysis. Path is relative to the workspace
      • Type: String
    • projectDir
      • Type: String
    • cleanupProject
      • Type: boolean
    • reportFile
      XML report file to store Klocwork results in. Optional in case you want to use the XML report for something custom, otherwise a default file is created for the post-build step
      • Type: String
    • additionalOpts
      Additional options added to the kwciagent run command. For example, specify the number of jobs/threads to use (--jobs-num) or which filters you would like to apply (e.g. --severity --taxonomy --system)
      Documentation - look at subsection "kwciagent run"
      • Type: String
    • incrementalAnalysis

      Analyse Changed Files Only

      This feature allows for quick, incremental analyses of changed source files to enable pre/post-checkin/commit like behaviour. The idea is that only changed files are analysed using the Klocwork kwciagent tool to replicate the analysis developers would perform using Visual Studio, Eclipse or the command line utility. To enable this the plugin takes a list of the changed files from the SCM, this enables the ability to analyse only the changed files when the workspace isn’t kept. Leave this unticked to analyse the whole project or if the workspace is kept then a standard incremental analysis.

      Diff File List

      The diff file list is the file to contain the changed source files that Klocwork should analyse. It is required that any analysed files should exist in the build specification generated by kwinject

      IMPORTANT: It is required that any files to be analysed must also exist in the build specification specified

      Using Git

      If using Git, please provide the previous commit that Git should perform a "diff" with. The change list between the current commit and the specified previous commit will then be added to the diff file list for Klocwork to process by automatically calling "git diff <previous_commit>" during the build.

      Manual

      If you are not using Git, or want to manually generate the change list using Git, then please select this option. You will need to generate the diff file list with a custom build-step (or similar). Future support for more SCM tools (such as SVN, perforce) may be added depending on demand. The format of the file should be a changed source file per line

      Future support for more SCM tools (such as SVN, perforce) may be added depending on demand.

      • Type: boolean
    • diffAnalysisConfig
        Nested Object
      • diffType
        • Type: String
      • gitPreviousCommit
        • Type: String
      • diffFileList
        • Type: String
    • ciTool
      • Type: String

klocworkIntegrationStep1: Klocwork - (step 2 - analysis) Full Integration Analysis

  • serverConfig
      Nested Object
    • buildSpec
      Build specification to use for analysis. Path is relative to the workspace
      • Type: String
    • tablesDir
      Specify the location of the tables directory, e.g. ${MY_VAR}/kwtables
      • Type: String
    • incrementalAnalysis
      • Type: boolean
    • ignoreCompileErrors
      Ignore compile errors encountered by kwbuildproject. This will not ignore a return code that indicates that kwbuildproject failed to the extent that no results are generated.
      • Type: boolean
    • importConfig
      Optional, provide config files to import to the project before running the analysis. If you version control the checker configuration (e.g. analysis_profile.pconf) you can provide the file here and it will be automatically imported each build
      Specify multiple files separated by comma (",")
      • Type: String
    • additionalOpts
      • Type: String
    • disableKwdeploy
      By default kwdeploy is run before the analysis to ensure the checkers are up to date. Enabling this setting disables it from running.
      • Type: boolean

klocworkIntegrationStep2: Klocwork - (step 3 - DB load) Full Integration Analysis

  • serverConfig
      Nested Object
    • tablesDir
      • Type: String
    • buildName
      Specify the name of the build for the Klocwork server, e.g. ${MY_VAR}-${GIT_COMMIT}. If empty, Klocwork uses an auto increment to name the builds
      • Type: String
    • additionalOpts
      • Type: String

klocworkIssueSync: Klocwork - Cross-Project Issue Sync

  • syncConfig
      Nested Object
    • dryRun
      Running the cross synchronisation means reading and writing to the Klocwork database. Therefore we strongly recommend that you first try a Dry Run of the command (which skips the writing) and verify that the command works as expected.
      • Type: boolean
    • lastSync
      Specify the "last synchronisation" date (i.e. how far back Klocwork should go when synchronising issue citations).
      Format is "DD-MM-YYYY hh:mm:ss"
      For example, "03-00-0000 00:00:00" will go back in time 3 days.
      • Type: String
    • projectRegexp
      A regular expression that is used to retrieve Klocwork projects that should be processed during synchronisation. For all projects leave empty.
      For example, if you prepend projects with "DEPT-" to indicate a particular department the regular expression "^DEPT-" will match all these projects
      • Type: String
    • statusAnalyze
      • Type: boolean
    • statusIgnore
      • Type: boolean
    • statusNotAProblem
      • Type: boolean
    • statusFix
      • Type: boolean
    • statusFixInNextRelease
      • Type: boolean
    • statusFixInLaterRelease
      • Type: boolean
    • statusDefer
      • Type: boolean
    • statusFilter
      • Type: boolean
    • additionalOpts
      Additional options added to the kwxsync command
      • Type: String

klocworkQualityGateway: Klocwork - Quality Gateway

  • gatewayConfig
      Nested Object
    • enableServerGateway (optional)

      Full Integration Analysis Gateway

      Create multiple gateways using queries that are sent to the Klocwork server using the web api.

      Filter issues based on the search query, then provide the status to set the build to, along with the threshold (number of issues to meet this criteria)

      Note: unless specified the query will run with issue grouping turned off (grouping:off)

      • Type: boolean
    • gatewayServerConfigs (optional)
        Array/List
        Nested Object
      • jobResult
        • Type: String
      • query
        • Type: String
      • threshold
        • Type: String
      • conditionName
        • Type: String
      • stopBuild
        • Type: boolean
      • enableHTMLReporting
        • Type: boolean
    • enableCiGateway (optional)
      • Type: boolean
    • enableDesktopGateway (optional)

      Incremental Diff Analysis Gateway

      Set a threshold for the incremental diff analsysis gateway. Pass the build if threshold not exceeded, fail otherwise.

      This checks the XML report generated by the incremental diff analysis build-step. You can filter which issues appear in this report by providing additional options to the incremental diff analysis build-step.

      This gateway simply counts the total number of issues in the XML report.

      • Type: boolean
    • gatewayCiConfig (optional)
        Nested Object
      • threshold (optional)
        • Type: String
      • reportFile (optional)
        • Type: String
      • enableHTMLReporting (optional)
        • Type: boolean
      • enabledSeverites (optional)
          Nested Object
        • critical
          • Type: boolean
        • error
          • Type: boolean
        • warning
          • Type: boolean
        • review
          • Type: boolean
        • fiveToTen
          • Type: boolean
      • enabledStatuses (optional)
          Nested Object
        • analyze
          • Type: boolean
        • ignore
          • Type: boolean
        • notAProblem
          • Type: boolean
        • fix
          • Type: boolean
        • fixInNextRelease
          • Type: boolean
        • fixInLaterRelease
          • Type: boolean
        • defer
          • Type: boolean
        • filter
          • Type: boolean
      • failUnstable (optional)
        • Type: boolean
      • name (optional)
        • Type: String
      • stopBuild (optional)
        • Type: boolean
    • gatewayCiConfigs (optional)
        Array/List
        Nested Object
      • threshold (optional)
        • Type: String
      • reportFile (optional)
        • Type: String
      • enableHTMLReporting (optional)
        • Type: boolean
      • enabledSeverites (optional)
          Nested Object
        • critical
          • Type: boolean
        • error
          • Type: boolean
        • warning
          • Type: boolean
        • review
          • Type: boolean
        • fiveToTen
          • Type: boolean
      • enabledStatuses (optional)
          Nested Object
        • analyze
          • Type: boolean
        • ignore
          • Type: boolean
        • notAProblem
          • Type: boolean
        • fix
          • Type: boolean
        • fixInNextRelease
          • Type: boolean
        • fixInLaterRelease
          • Type: boolean
        • defer
          • Type: boolean
        • filter
          • Type: boolean
      • failUnstable (optional)
        • Type: boolean
      • name (optional)
        • Type: String
      • stopBuild (optional)
        • Type: boolean
    • gatewayDesktopConfig (optional)
        Nested Object
      • threshold (optional)
        • Type: String
      • reportFile (optional)
        • Type: String
      • enableHTMLReporting (optional)
        • Type: boolean
      • enabledSeverites (optional)
          Nested Object
        • critical
          • Type: boolean
        • error
          • Type: boolean
        • warning
          • Type: boolean
        • review
          • Type: boolean
        • fiveToTen
          • Type: boolean
      • enabledStatuses (optional)
          Nested Object
        • analyze
          • Type: boolean
        • ignore
          • Type: boolean
        • notAProblem
          • Type: boolean
        • fix
          • Type: boolean
        • fixInNextRelease
          • Type: boolean
        • fixInLaterRelease
          • Type: boolean
        • defer
          • Type: boolean
        • filter
          • Type: boolean
      • failUnstable (optional)
        • Type: boolean
      • name (optional)
        • Type: String
      • stopBuild (optional)
        • Type: boolean

klocworkWrapper: Klocwork - Build Environment Settings

  • serverConfig
    Server configurations are created on the Configure System page
    • Type: String
  • installConfig
    Install configurations are created on the Configure System page. When used, the specified PATHs are added to the launcher to be used by any build step
    • Type: String
  • serverProject
    The Klocwork server project to run a server build against or to connect a Klocwork CI analysis to
    • Type: String
  • ltoken
    (Optional) Specify a custom ltoken location. The Klocwork ltoken is used to authenticate with the Klocwork server. The default ltoken location is in the user's home directory, that is the user running the process. More information
    • Type: String

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.