Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

kwconan

The kwconan command is a tool that allows you to run analysis through a CI system.

kwconan is installed as part of the Klocwork Server package.

Synopsis

kwconan <subcommand> [<common_options>] 

where

  • <subcommand> is either 'run', 'promote' or 'import'. Run performs a continuous build analysis from the previous baseline. Promote allows you to update the analysis baseline with results from the last build analysis. Import allows you to use existing system tables for continuous integration analysis.
  • <common_options> are any of the options found in the 'Options' tables below.
You can also specify an arguments file for kwconan:
kwconan <subcommand> @<arguments_file>

Options for 'kwconan run'

Name  Short  Description
--help   display the command-line help.
--version   show version.
--tables-directory -t tables directory created by kwbuildproject; this is a mandatory option.
--url http(s)://<host>:<port>/<project>   URL for the Klocwork Server. Use https:// if a secure Klocwork Server connection has been configured; this is a mandatory option.
  • <host> specifies the host machine running the Klocwork Server you want to connect to.
  • <port> specifies the port used by the Klocwork Server you want to connect to. The default is 8080
  • <project> specifies the project name you want to work with.
--license-host   specifies the host machine running the license server you want to connect to.
--license-port   specifies the port used by the license server you want to connect to.
--reset-baseline   reset the defect reporting baseline.
--agent <string>   agent name used to indicate which custom agent performed the build; will use authenticated user name if not provided.
--json   outputs full analysis results in JSON format when specified. This option requires that a 'kwconan' license is available.
--output-file -o ouputs the results to a specified file instead of the standard output location

Options for 'kwconan promote'

Name  Short  Description
--help   display the command-line help
--version   show version
--tables-directory -t tables directory created by kwbuildproject; this is a mandatory option
--url http(s)://<host>:<port>/<project>   URL for the Klocwork Server. Use https:// if a secure Klocwork Server connection has been configured; this is a mandatory option.
  • <host> specifies the host machine running the Klocwork Server you want to connect to.
  • <port> specifies the port used by the Klocwork Server you want to connect to. The default is 8080
  • <project> specifies the project name you want to work with.
--license-host   specifies the host machine running the license server you want to connect to.
--license-port   specifies the port used by the license server you want to connect to.

Options for 'kwconan import'

Name  Short  Description
--help   display the command-line help
--tables-directory -t tables directory created by kwbuildproject; this is a mandatory option
--url http(s)://<host>:<port>/<project>   URL for the Klocwork Server. Use https:// if a secure Klocwork Server connection has been configured; this is a mandatory option.
  • <host> specifies the host machine running the Klocwork Server you want to connect to.
  • <port> specifies the port used by the Klocwork Server you want to connect to. The default is 8080
  • <project> specifies the project name you want to work with.
--license-host   specifies the host machine running the license server you want to connect to.
--license-port   specifies the port used by the license server you want to connect to.
Note: Specifying one of 'promote', 'run' or 'import' is mandatory when running kwconan.

Example 1

The following example shows you what a 'run' command might look like:

kwconan run --tables-directory mytables --url http://jsmith02:8080/myproject

In this example:

  • mytables is the path to the tables directory created by kwbuildproject.
  • http://jsmith02:8080/myproject is the path to your Klocwork Server and the project name.

'kwconan' run detects new and fixed issues relative to the baseline build.

Example 2

The following example shows you what a 'promote' command might look like:

kwconan promote --tables-directory mytables --url http://jsmith02:8080/my_project

In this example:

  • mytables is the path to the tables directory created by kwbuildproject.

'kwconan promote' adds the most recently detected new and fixed issues to the baseline (they will not be reported again unless re-introduced or fixed in another commit)

Example 3

The following example shows you what an 'import' command might look like:

kwconan import --tables-directory mytables --url http://jsmith02:8080/my_project
Note: In order to import your existing tables, the location of your source and build environment(s) must be identical between the original system build and the continuous integration build.

In this example:

  • mytables is the path to the tables directory created by kwbuildproject.

Once the import is performed, system tables are converted to continuous integration mode tables. This step also sets a baseline build, so that defects added after the import are considered new and are shown in the JSON report until 'kwconan promote' is run to set a new baseline.

For more information, see Importing your build tables for use with Continuous Integration