Kwmatch
The kwmatch command matches detected issues across projects in an issue matching group. Identical issues in other projects in the same group are displayed in the issue details in Klocwork Static Code Analysis. This is useful when projects share source code, as in the case of branches. An issue that occurs in multiple projects likely has a high priority.
The projects can be in different projects_root directories, as well as on different Klocwork Server hosts. See Managing project branches for how-to information.
Options that apply to all subcommands
Name (and short name) | Description |
---|---|
--dbhost <string> | specify the Database Server host name (default: localhost) |
--dbname <string> | specify a name for the issue matching database (default: xsync) |
--dbpassword <string> | specify the database password (if set) |
--dbport <int> | specify the Database Server port number (default: 3306) |
--dbuser <string> | specify the name of the user who started the Database Server (default: kw) |
--help | display this help |
--sync-citing |
specifies that this project will synchronize issue citation histories with other projects in this group. Citations will be synced between all projects only after a system build has been run on each project. If project C has been added to a match group using the --sync-citing option, it will receive citations from projects A and B as soon as a system build is run. Similarly, projects A and B will receive citations from project C only after a system build has been run for both projects. Only issues cited after the project was added to the group are available in the portal. Any previous citations (which occurred before this project was added to the group) are not available. |
--version | display version information |
Init
Use the init subcommand to create an issue matching group:
kwmatch [<options>] init [--force]
Example
In this example, we create an issue matching group named "myprojectgroup". Our Database Server is running on the host myserver on the default port, 3306. The user who started the Database Server is the default, kw, and we have not set a password for the database.
kwmatch --dbhost myserver --dbname myprojectgroup init
Options
Name (and short name) | Description |
---|---|
--batch | Batch mode. Use this option to suppress an error exit code when a matching group already exists |
--force (-f) | Force the creation of the specified issue matching group. Use this option to reinitialize the specified issue matching group and erase any information in it. |
Add
Use the add subcommand to add one or more projects to an existing issue matching group.
kwmatch [<options>] add <project_URL> [<project_URL>...]
Example
In this example, we add three projects to "myprojectgroup". Our Database Server is running on the host myserver on the default port, 3306. The user who started the Database Server is the default, kw, and we have not set a password for the database.
kwmatch --dbhost myserver --dbname myprojectgroup add http://myserver:8080/myprojectmain http://myserver:8080/myprojectbranch1 http://myserver:8080/myprojectbranch2
List
Use the list subcommand to print out the list of projects in the matching group:
kwmatch [<options>] list
Remove
Use the remove subcommand to remove the reference to the issue matching group from the project:
kwmatch [<options>] remove <project_URL> [<project_URL>...]
where
- <options> are any of the options from list of options available to all subcommands or from the table below.
- <project_URL> is a URL with the following format: http(s)://<klocwork_server_host>:<klocwork_server_port>/<project_name>
Use http(s):// if a secure Klocwork Server connection has been configured.
Example
In this example, we remove one or more projects from an issue matching group. Our Database Server is running on the host myserver on the default port, 3306. The user who started the Database Server is the default, kw, and we have not set a password for the database.
kwmatch --dbhost myserver --dbname myprojectgroup remove http://myserver:8080/myprojectbranch2
When you run the remove subcommand, if the database is unavailable for any reason or has been deleted, the system will prompt you with a command line message such as, "ERROR: Database does not exist. Try using '--force'".
kwmatch remove --force http://myserver:8080/myprojectbranch2
Options
Name (and short name) | Description |
---|---|
--force (-f) | Force the removal of the reference to the specified project from the issue matching group. |