Main Content

polyspace-access -set-unassigned-findings

Assign owners to unassigned results

    Description

    The system command polyspace-access -set-unassigned-findings assigns owners to unassigned results in the specified Polyspace® Access™ project.

    polyspace-access -set-unassigned-findings <results> -owner <user> -source-contains <pattern>... -owner <userN> -source-contains <patternN> [unassigned findings options] -host <hostname> [login options] [output options] assigns owners to unassigned results in a project in the Polyspace Access database. You specify the project results using either the full path in Polyspace Access or the run ID. Use the unassigned findings options to assign results 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 the polyspace-access -list-project command.

    example

    Examples

    collapse all

    If you follow a component-based development approach, you can assign analysis results by component to their respective owners.

    Get a list of projects currently stored on the Polyspace Access database.

    polyspace-access -list-project -host myAccessServer
    
    Connecting to https://example-access-server:9443
    Connecting as jsmith
    
    Get project list with the last Run Id
    Restricted/Code_Prover_Example (Code Prover) RUN_ID 14
    multimodule/vxWorks_demo (Code Prover) RUN_ID 16
    public/Bug_Finder_Example (Bug Finder) RUN_ID 24
    public/CP/Code_Prover_Example (Polyspace Code Prover) RUN_ID 8
    public/Polyspace (Code Prover) RUN_ID 28
    Command Completed

    Assign all red and orange run-time error results to the owner of all the files in Component_A of project vxWorks_demo. Perform the same assignment for the owner of Component_B. To specify the vxWorks_demo project, use the run ID.

    polyspace-access -set-unassigned-findings 16 ^
    -owner A_owner -source-contains Component_A ^
    -owner B_owner -source-contains Component_B ^
    -rte Red -rte Orange ^
    -host myAccessServer
    Using the option -source-contains Component_A matches all files with a file path that contains the string Component_A.

    Using the option -source-contains Component_B matches all files with a file path that contains the string Component_B, but excludes files with a file path that contains the string Component_A.

    Export the results and generate .csv files for each owner that contain the results assigned to them.

    polyspace-access -export 16 ^
    -output C:\Polyspace_Workspace\myResults.csv ^
    -output-per-owner ^
    -host myAccessServer ^
    The command generates file myResults.csv containing all results from the project with run ID 16. The command also generates files myResults.csv.A_owner.csv and myResults.csv.B_owner.csv on the same file path.

    Input Arguments

    collapse all

    Manage Project Run Labels

    Path or run ID of the project results that you assign to a user, specified as a string. Polyspace assigns a unique run ID to each analysis run you upload. If the path name includes spaces, use double quotes. To get the project results path or last run ID, use polyspace-access -list-project.

    Example: "public/Examples/Bug_Finder_Example (Bug Finder)"

    Example: 4

    Username of user you assign as owner of unassigned results, specified as a string. To assign multiple owners, call the option for each user.

    Each use of the -owner option must be paired with the option -source-contains.

    Example: -owner jsmith

    Pattern to match against file path of project source files, specified as a string. To match file paths for all source files, use "-source-contains /".

    Enter a substring from the file path. You cannot use regular expressions.

    When you use this option more than once, each instance excludes patterns from previous instances. For example, -source-contains foo -source-contains bar matches all file paths that contain foo, then all file paths that contain bar excluding paths that contain foo.

    When you assign results to multiple owners, call this option for each call to -owner.

    Example: -source-contains main

    Options to assign all results or only a subset based on component or individual source files. To make an assignment, specify a pattern to match against the folder or file paths to assign.

    OptionDescription

    -rte All | Red | Gray | Orange | Green

    Type of run-time error result to assign, specified as All, Red, Gray, Orange, or Green.

    To specify more than one type of result, use the option for each type.

    Example: -rte Red -rte Orange

    -defects All | High | Medium | Low

    Impact of defect results to assign, specified as All, High, Medium, or Low.

    To specify more than one defect type, use the option for each type.

    Example: -defects Medium -defects Low

    -custom-coding-rules

    Assign owner to all unassigned custom coding rules results.

    -coding-rules

    Assign owner to all unassigned coding rules results.

    -code-metrics

    Assign owner to all unassigned code metrics results.

    -global-variables

    Assign owner to all unassigned global variables results.

    -resolution New

    Assign owner to unassigned results that are new compared to the previous analysis run. If the project contains only one run, all results are new and you can omit this option.

    -status Unreviewed | "To investigate" | "To fix" | Justified | "No action planned" | "Not a defect" | Other

    Review status of the results to assign, specified as Unreviewed, "To investigate", "To fix", Justified, "No actionp lanned", "Not a defect", or Other.

    To specify more than one status, use the option for each status.

    Example: -status "To fix" -status "To investigate"

    -severity All | High | Medium | Low

    Severity of the results to assign. Specify All, High, Medium, or Low.

    To specify more than one severity, use the option for each severity.

    Example: -severity High -severity Low

    -dryrun

    Display command output without making any assignment. Use this option to check that your assignments are correct.

    Connection Configuration

    Polyspace Access machine hostname that you specify in the URL of the Polyspace Access interface, such as https://hostname:portNumber/metrics/index.html. If you are unsure about which hostname to use, contact your Polyspace Access administrator.

    You must specify a hostname with all polyspace-access commands, except the -generate-migration-commands and -encrypt-password commands.

    Example: -host myAccessServer

    Port number that you specify in the URL of the Polyspace Access interface, such as https://hostname:portNumber/metrics/index.html. If you are unsure about which port number to use, contact your Polyspace Access administrator.

    HTTP protocol used to access Polyspace Access, specified as http or https.

    Full path to the text file where you store your login credentials. Use this option if you use a command that requires your Polyspace Access credentials in a script but you do not want to store your credentials in that script. While the script runs, someone inspecting currently running processes cannot see your credentials.

    You can store only one set of credentials in the file, either as -login and -encrypted-password entries on separate lines, for instance:

    -login jsmith
    -encrypted-password LAMMMEACDMKEFELKMNDCONEAPECEEKPL
    You can also store credentials as an -api-key entry:
    -api-key keyValue123
    Make sure that the file where you store your credentials is UTF-8 encoded and that you restrict the read and write permissions on the file. For example, to restrict read and write permissions on file login.txt in Linux®, use this command:
    chmod go-rwx login.txt

    API key you use as a login credential instead of providing your login and encrypted password. To assign an API key to a user, see Configure User Manager or contact your Polyspace Access administrator.

    Use the API key if you use a command that requires your Polyspace Access login credentials as part of an automation script with a CI tool such as Jenkins®. If a user updates their password, you do not need to update the API key associated with that user in your scripts.

    It is recommended that you store the API key in a text file and pass that file to the command by using the -credentials-file option.

    Login username that you use to interact with Polyspace Access.

    Use the options -login and -encryped-password together. If you do not use these two options together, you are prompted to enter your credentials at the command line, unless you use -api-key.

    Login password you use to interact with Polyspace Access. <ENCRYPTED_PASSWORD> is the output of the polyspace-access -encrypt-password command.

    Use the options -login and -encryped-password together. If you do not use these two options together, you are prompted to enter your credentials at the command line, unless you use the -api-key option.

    Number of times the polyspace-access command retries to upload results when you upload from a client machine to the server machine that hosts Polyspace Access before failing. Specify this option to retry the upload command in the event of sporadic network outages. The command waits 10 seconds between retries.

    Full path to command outputs.

    Path to the folder for storing temporary files generated by polyspace-access commands. The default folder path depends on your platform:

    • Windows — C:\Users\%username%\AppData\Local\Temp\ps_results_server

    • Linux — tmp/ps_results_server

    File path where you store the command output log. By default the command does not generate a log file.

    Version History

    Introduced in R2019a