Configuring Coverity

It is possible to incorporate Coverity results in the TICS output for files.

Prerequisites

For a successful Coverity integration, the following prerequisites must be met:

Basic configuration

To use Coverity one has to set-up the required properties in either the SERVER.txt to apply them for all projects or in PROJECTS.txt to apply them project specific. If the properties are declared in the SERVER file and also in the PROJECT the project specific properties will overwrite the global properties.

Syntax

The following properties have to be declared either on SERVER or PROJECT level:

'TOOLS' => {
  'Coverity' => {
    'USERNAME' => 'Login name',
    'PASSWORD:PLAIN' => 'Password',
    'URL' => 'URL of Coverity Web API, for example: https://coverity.tomtomgroup.com:443',
    ['TIMEOUT' => The time a webservice call may take (in seconds) before it is aborted],
    ['NR_OF_RETRIES' => The number of retries when the data cannot be fetched because of connection timeout ],
    ['CONNECTION_RETRY_TIMEOUT' => The time (in seconds) between retries],
    ['INSTALLDIR' => 'Bin directory of Coverity Analysis'],
    'BUILDCOMMAND' => ['Build commands needed for cov-build'],
    ['LICENSE' => {
       'SECURITY' => 0|1 #Whether your Coverity license includes security analysis.
     }]
  }
}

The following properties have to be applied on PROJECT level:

'VIEWS' => {
  'branch name' => {
    'TOOLS' => {
      'Coverity' => {
        'PROJECT' => 'Project name in Coverity',
        ['STREAM' => 'Stream name in Coverity'],
        ['BRANCHDIR' => 'Branchdir used for the Coverity analysis'],
      },
    },
  },
},

Example for BRANCHDIR:

This section will give a more detailed explanation to clarify how to define the 'BRANCHDIR' property and why it is needed. The screenshot below shows an actual live set-up where the BRANCHDIR is needed to get TICS to work with Coverity. Now for TICS to work with Coverity it is needed to translate the relative path of TICS to the absolute path of Coverity. As seen on the screenshot below the project name of the Coverity project is Maps QA. The prefix that is needed to translate the path is highlighted in the Coverity path (first green box). Note that the BRANCHNAME needs to be removed from the relative path of TICS.

image

The situation above requires the following set-up of properties:

'VIEWS' => {
  'master' => {
    'TOOLS' => {
      'Coverity' => {
        'PROJECT' => 'Maps QA',
        'BRANCHDIR' => '/opt/jenkins/workspace/DARTS-Coverity/'
      },
    },
  },
},

Example for BUILDCOMMAND and LICENSE:

A project can also be configured with BUILDCOMMAND and LICENSE as follows:

'VIEWS' => {
  'master' => {
    'TOOLS' => {
      'Coverity' => {
        'PROJECT' => 'Maps QA',
        'BRANCHDIR' => '/opt/jenkins/workspace/DARTS-Coverity/',
        'BUILDCOMMAND' => ['gradlew'],
        'LICENSE' => {
          'SECURITY' => 1,
        },
      },
    },
  },
},