polyspace-access
(DOS/UNIX) Manage Polyspace Access results and users at the command line
Syntax
Description
Manage and View Projects
Note
This Polyspace® command is available in
. Here,
polyspaceroot
\polyspace\bin
is the Polyspace Server installation folder, for instance, polyspaceroot
C:\Program Files\Polyspace Server\R2024b
(see also Installation Folder). To avoid typing the full path to this command, add
this location to the PATH
environment variable in your operating
system.
polyspace-access -create-project
creates a project folder in the Polyspace
Access™ web interface. The folder can be at the top of the project hierarchy or a
subfolder under an existing project folder.folderPath
-host hostname
[login options
]
polyspace-access -move-project
moves or renames a project or folder. The projectPath
-to-project-path destinationPath
-host hostname
[login options
] sourcePath
and
destinationPath
must be absolute paths of the source and destination
projects or folders. You cannot move or rename a project or folder if the path you specify
for the destination already exists.
polyspace-access -delete-project
deletes specified project or folder from the Polyspace
Access
Project Explorer. The project or folder is moved to the
ProjectsWaitingForDeletion folder, which is visible only to users
with a role of Administrator. If the project is already in the
ProjectsWaitingForDeletion folder, the command deletes the project
entirely from the database. See also Delete Project Runs or Entire Projects (Polyspace Access).projectPath
-host hostname
[login options
]
polyspace-access -set-deletion-policy
sets or edits project run deletion policy for specified project. After you set the policy
Polyspace applies that policy on each subsequent upload to the project and deletes
project runs from the database based on these thresholds:projectPath
-max-days MAX_DAYS
-max-runs MAX_RUNS
-host hostname
[login options
]
Age of project run in days (MAX_DAYS) — If the number of days since a run was uploaded to the project exceeds MAX_DAYS, Polyspace deletes the run.
Number of runs in a project (MAX_RUNS) — If a project already contains MAX_RUNS and you upload a new run, Polyspace deletes the oldest run in the project.
When you set the policy you can specify either threshold or both of them. When you specify both thresholds, Polyspace deletes a project run if that run meets either threshold. See also Delete Project Runs or Entire Projects (Polyspace Access).
polyspace-access -unset-deletion-policy
unsets the project run deletion policy for the specified project. When a project has no
deletion policy, all the runs that you upload to that project remain in the database until
you manually delete them. See also Delete Project Runs or Entire Projects (Polyspace Access).projectPath
-host hostname
[login options
]
polyspace-access -get-deletion-policy
shows deletion policy for specified project. See also Delete Project Runs or Entire Projects (Polyspace Access).projectPath
-host hostname
[login options
]
polyspace-access -list-project [
without the optional argument projectPath
] -host hostname
[login options
] projectPath
lists the paths to all
projects in the Polyspace
Access database and their last run IDs. If you specify the full path to a project
with the argument projectPath
, the command lists the last run ID for
only that project.
polyspace-access -list-runs
shows all the runs that were uploaded to the specified project. For each run, you see the
run ID and any labels associated with that run.projectPath
-host hostname
[login options
]
polyspace-access -set-project-information
displays the text you specify in bannerText within a banner in the Polyspace
Access user interface. The banner is shown when you select the folder or project
that you specified with projectPath. See Add Project Banners to Results in Polyspace Access (Polyspace Access).projectPath
-banner bannerText
-host hostname
[login options
]
polyspace-access -unset-project-information
removes an existing project banner from the specified project.projectPath
-host hostname
[login options
]
Upload, Download, or Export Results
polyspace-access -upload
uploads Polyspace
Bug Finder™, Code Prover, or Polyspace
Test™ results to the Polyspace
Access database from the file (recommended), folder, or zipped file that you
specify. You can upload Bug Finder or Code Prover results using this command only if those
results were generated with Polyspace
Bug Finder
Server™ or Polyspace
Code Prover™
Server. You can upload results to an existing Polyspace
Access project only if those results were generated by the same type of analysis.
For instance, you cannot upload results of a Bug Finder analysis to a project that
contains Code Prover results. To upload results generated with the Polyspace desktop interface, see Upload Results from Polyspace Desktop Client. Use the upload options to specify a project parent
folder or to rename a project. pathToFileOrFolderOrZipFile
[upload options
] -host hostname
[login options
]
Note
You can upload up to 2GB of results per upload to Polyspace Access.
Polyspace Access does not support user defined coding standards. If you upload analysis results that contain violations of a user defined coding standards, Polyspace Access ignores those violations. For more on user-defined coding standards, see Check for Violations of User-Defined Coding Standard Using Polyspace Bug Finder.
polyspace-access -export
exports project results from the Polyspace
Access database to a text file whose location you specify with
findingsToExport
-output filePath
[export options
] -host hostname
[login options
] filePath
. You can specify filters when you export the results or
export a comparison between two projects. You specify the project using either the full
path in Polyspace
Access or the run ID. Use this command to export findings to other tools that you
use for custom reports. To get the paths to projects and their last run IDs, use
polyspace-access
with the -list-project
command.
polyspace-access -download
downloads results from Polyspace
Access project findingsToDownload
-output-folder-path outputFolderPath
-host hostname
[login options
] findingsToDownload
to a folder whose location you
specify with outputFolderPath
. You specify the project using either the
full path in Polyspace
Access or the run ID.
You cannot open the downloaded results in the Polyspace desktop interface or the Polyspace as You Code IDE extensions. Use this command as part of the workflow to merge review information between projects, or to create a baseline for subsequent Polyspace analyses.
To merge review information between projects, see Import Review Information from Existing Polyspace Access Projects (Polyspace Access).
To create a baseline for Polyspace as You Code results at the command-line, see Set Baseline Polyspace as You Code Results on Command Line (Polyspace Access).
To get the paths to projects and their last run IDs, use
polyspace-access
with the -list-project
command.
Manage Review Information for Findings
polyspace-access -review
edits the information in the review fields of the findings in the project
fileOrFindingID
-project-path projectToReview
review options
-host hostname
[login options
] projectToReview
. To review a single finding, pass a finding ID to the
-review
command. To perform a batch review, pass the path of a file
where you store the finding IDs of multiple findings to the -review
command. In this file, list one finding ID per line. You must specify at least one review
field with review options
, such as status, severity, comment, owner, or
a bug tracking tool (BTT) ticket number.
You cannot assign a review field to a finding if that review field is set with a code annotation.
polyspace-access -import-reviews
imports review information from source project sourceProjectPath
-to-project-path targetProjectPath
[-import-strategy never-overwrite-target | always-overwrite-target] -host hostname
[login options
] sourceProjectPath
to
target project targetProjectPath
. Use this option if you have already
reviewed findings in the source project and you reuse the code that contains those
findings in the target project.
You can optionally specify one of these import strategies:
never-overwrite-target
(default) — If a review field in the target project already has content, do not overwrite that review field with the content from the source projectalways-overwrite-target
— Always overwrite the content of the review fields in the target project with the content from the source project, even if the target review fields already have content.
See also Import Review Information from Existing Polyspace Access Projects (Polyspace Access).
Manage Software Quality Objectives (SQO)
polyspace-access -set-sqo
assigns an SQO level to the specified project for the SQO definition that is currently
applied to the project. You can optionally apply a different SQO definition to the project
by specifying the name of that SQO definition with option projectPathWithSQO
-level sqoLevel
[-name sqoName
] -host hostname
[login options
] -name
. See
also Manage Software Quality Objectives in Polyspace Access (Polyspace Access). You can run this command only on single projects but not on
project folders.
polyspace-access -get-sqo
shows the currently assigned SQO definition and SQO level for the specified project. See
also Manage Software Quality Objectives in Polyspace Access (Polyspace Access). You can run this command only on single projects but not on
project folders.projectPathWithSQO
-host hostname
[login options
]
polyspace-access -list-sqo -host
lists the name of all the available SQO. See also Manage Software Quality Objectives in Polyspace Access (Polyspace Access).hostname
[login options
]
Manage Project Run Labels and Unassigned Findings
polyspace-access -add-label
adds a label to the project run specified with label
-run-id runID
-host hostname
[login options
] runID
. Use labels to
identify project runs of interest more easily, or to associate a run with a specific
branch or continuous integration build job. See also Manage Labels at the Command Line (Polyspace Access).
polyspace-access -remove-label
removes the specified label from the project run with run ID label
-run-id runID
-host hostname
[login options
] runID
. If
the specified label does not match any of the project run labels, the command is ignored.
See also Manage Labels at the Command Line (Polyspace Access).
polyspace-access -set-unassigned-findings
assigns owners to unassigned results in a project in the Polyspace
Access database. You specify the project using either the full path in Polyspace
Access or the run ID. Use the findingsToAssign
-owner userToAssign
-source-contains pattern
[set unassigned findings options
] -host hostname
[login options
] set unassigned findings options
to
assign findings from different source files or different groups of source files to
different owners. To get the paths to projects and their last run IDs, use
polyspace-access
with the -list-project
command.
Manage User Permissions
polyspace-access -set-role
assigns a role role
-user username
-group groupname
-project-path folderPathOrProjectPath
-host hostname
[login options
] role
to username
or
groupname
for the specified project or project folder. A user or
group role set for a project folder applies to all project findings under that folder. All
users in a group inherit the role assigned to their parent group. You specify the project
using either the full path in Polyspace
Access or the last run ID. To get the paths to projects and their last run IDs, use
polyspace-access
command with the -list-project
command.
polyspace-access -unset-role -user
removes any role previously assigned to username
-group groupname
-project-path folderPathOrProjectPath
-host hostname
[login options
] username
or
groupname
for the specified project or project folder. Unassigning a
role for a group unassigns that role for all the users in that group. You specify the
project using either the full path in Polyspace
Access or the last run ID. To get the paths to projects and their last run IDs, use
polyspace-access
with the -list-project
command.
Migrate Results from Polyspace Web Metrics
polyspace-access -generate-migration-commands
generates scripts to migrate projects from the path metrics_dir
-output-folder-path dir
[generate migration commands options
]metrics_dir
in
Polyspace Metrics to Polyspace
Access. The command stores the scripts in dir
. To specify which
project findings to migrate, use generate migration commands
options
.
polyspace-access -migrate -option-file-path
migrates projects from Polyspace Metrics to Polyspace
Access using the scripts generated with the
dir
[-dryrun] -host hostname
[login options
] -generate-migration-commands
command. To view which projects are
migrated without actually migrating the projects, use the -dryrun
option.
Other Commands
polyspace-access -ver -host
displays the version and license number of the Polyspace
Access instance that you specify with hostname
[login options
]hostname
, and the version
of the polyspace-access
binary. You can run this command only with
Polyspace
Access instances for which you have login credentials.
polyspace-access -encrypt-password
encrypts the password you use
to log into Polyspace
Access. Use the output of this command as the argument of the
-encrypted-password
option when you write automation scripts to
interact with Polyspace
Access.
If your username or password contain non-ASCII characters, check that you run the
-encrypt-password
command from a UTF-8 encoded terminal.