Creating a configuration YAML for Coverity on Polaris

Introduction

To get the best results from Coverity on Polaris when it is invoked from Synopsys Detect, Synopsys recommends that first, you create a special Coverity YAML configuration file that gives Coverity extra information about your project and the artifacts that you want to analyze.

For information about this YAML setup file, refer to the Polaris community article, or, refer to the Polaris User and Admin Guide. To access the Admin Guide, do the following steps:

  1. Log in to your organization's instance of Polaris.
  2. Select Help on the Sidebar.
  3. Find the Initial Configuration section under Static Analysis.

Note: If no YAML configuration file is specified, then Synopsys Detect will create a configuration YAML with default values, but artifacts might not be optimally captured.

Sample Polaris YAML

For those familiar with the Polaris YAML structure looking for a quick and easy way to add this to your project, use the sample Polaris YAML below:

Sample Polaris YAML
version: "1"
project: # Settings for how Project shows in the Polaris UI
  name: ${scm.git.repo} # Name displayed in the Polaris UI
  branch: ${scm.git.branch} # Project Branch displayed in the Polaris UI
  revision:
    name: ${scm.git.commit}
    date: ${scm.git.commit.date}
    modified: ${scm.git.modified}
capture:
  build: # Commands related to your application build.
    cleanCommands: #Clean Commands
    - shell: [mvn, -f, pom.xml, clean] # Maven Sample Clean Commands
    buildCommands: #Build Commands
    - shell: [mvn, -f, pom.xml, install] # Maven Sample Build Commands
  fileSystem: # Location of compiled or non-compiled build artifacts
    ears:
      extensions: [ear]
      files:
      - directory: ${project.projectDir}
    javascript:
      extensions: [js]
      files:
      - directory: ${project.projectDir}
      - excludeRegex: node_modules|bower_components|vendor
    php:
      extensions: [php]
      files:
      - directory: ${project.projectDir}
    python:
      extensions: [py]
      files:
      - directory: ${project.projectDir}
    ruby:
      extensions: [rb]
      files:
      - directory: ${project.projectDir}
    wars:
      extensions: [war]
      files:
      - directory: ${project.projectDir}
install: # Version settings for tools to use
  coverity:
    version: latest

©2020 Synopsys, Inc. All Rights Reserved