Main Content

Import Review Information from Existing Polyspace Access Projects

This topic describes how to import review information from previous results in Polyspace® Access™ . For information on importing from results that are not uploaded to Polyspace Access, see Import Review Information from Previous Polyspace Analysis (Polyspace Bug Finder).

If you review findings in a Polyspace Access project and you reuse the same source code that contains those findings in another project, you can import the existing review information to the other project. You do not need to review the findings again in the other project. The project you import from is the source project. The project you import to is the target project.

For instance, suppose your team has reviewed all findings for the file customClass.cpp in the Polyspace Access project components/oldProject (BF). If you use customClass.cpp in a different project, you can import review information such as Status and Severity from components/oldProject (BF) into the other project.

During import, Polyspace Access compares each filename in the target project results with filenames in the source project results. For each file in the target project results, Polyspace attempts to find a case-sensitive best match in the source project results. If no case-sensitive match exists, Polyspace attempts to find a best match.

A best match is a file that shares the same filename. If multiple files share a case-insensitive filename, the file with the longest common file path (during time of analysis) is selected for import. Polyspace compares file paths starting from the end of the path. Polyspace selects only one best match.

For example, suppose you are importing to the file C:\Project1\example1\filename.cpp. Polyspace parses the file path in reverse order: filename.cpp, example1, Project1, C:.

In this example, suppose the two following matches are found:

  • C:\Project2\example1\FileName.cpp

  • C:\Project2\example1\extraFiles\FileName.cpp

The first file path shares two elements in order: FileName.cpp (case-insensitive) and example1. The second file path shares only one element in order: FileName.cpp (case-insensitive). The folder extraFiles is not shared between both paths. Polyspace therefore chooses the first file.

Note that when you upload a run to a project, Polyspace Access automatically imports the review information from previous runs of that project to the newly uploaded run.

These values are imported when you merge review information between projects:

  • Status

  • Severity

  • Assigned to

  • Comments

  • Ticket Key

Import Review Information from Source Project to Target Project in Polyspace Access

Import review information from a source project to a target project.

  1. In the Project Explorer, right-click your target project and select Import Reviews from Another Project.

  2. Locate and select the source project. You can only import from one source at a time.

  3. Select one of these import policies:

    • Write review when there is no review on target finding

      Import non-empty source project review information only if all the review fields of the target finding are empty.

    • Source reviews always replace target

      Import non-empty source project review information and replace target fields, even if the target review already contains review information.

  4. Click OK. A dialog box appears at the top of the Dashboard when the import begins and when it completes. Imports for larger projects can take several minutes to complete.

View and Select Imported Reviews

Click Open Results in the Project Overview dashboard to view the Results List. Project results with imported review information have an icon next to them in the Familycolumn. The icon indicates the current state of the imported review. This table describes the states of imported reviews.

IconStatusStatus Description

not applied icon

Not Applied

Review information from the source project is not applied to the target project findings.

overwritten icon

Overwritten

Review information from the source project is applied to the target project finding. The source overwrites the original target review information.

written icon

WrittenReview information from the source project is applied to previously empty target project findings.

You can switch between original and imported review information. To decide what review information to use, view imported and original result information side-by-side. Use the Imported Review Selection window to view result information in this way. To access this pane:

  • Right-click the result you want to review in the Results List.

  • Select Show Imported Review Selection.

In the Imported Review Selection panel, three columns represent the Review Fields, the Original Values, and the Imported Values. A radio button next to Original Values and Imported Values enables you to quickly select which values to apply to the findings.

Confirm Imported Review Information

Imported review information is considered unconfirmed until you manually confirm it. You can confirm result information individually or as a group.

  1. Expand the Filters list and select the Unconfirmed Imports filter.

    unconfirmed imports icon

  2. Select a result. To select multiple results, click those results while holding the Ctrl key. To select a range of adjacent results, click the first and last result in that range while holding the Shift key.

  3. Right-click the selected result, go to Confirm imported reviews in the context menu and choose one of these options.

    OptionOption Description
    Use original valuesKeep the original review information in the target finding for all selected results. If this option is grayed out, the target finding already uses the original review information.
    Use imported valuesApply the imported review information to the target finding for all selected results. If this option is grayed out, the target finding already uses the imported review information.
    Confirm current selectionConfirm review information as it currently is set. If this option is grayed out, the target finding is already confirmed.

In some instances, it is useful to know the review history of a result. To open the Review History pane, from the Result Details pane, click the show review history icon icon. The Review History shows information about changes to individual result details including the name of the editor and time of the edit. See Review History in Polyspace Access Web Interface.

Import Review Information at the Command-Line

To import review information from an existing project to another project that reuses the code that contains the reviewed finding, use command polyspace-access -import-reviews and specify:

  • The full path of the project that you want to import the review information from (source project).

  • The full path of the project that you want to import the review information to (target project).

  • Optionally, you can specify one of these import strategies:

    • never-overwrite-target (default) — If a review field in the target project is already filled, do not overwrite it with the content from the source project

    • always-overwrite-target — Always overwrite the content of the review fields in the target project, even if they are already filled.

For example, if you have already reviewed findings in project public/example/branchA, and you reuse the reviewed code in project public/example/branchB, use this command to import the review information from branchA to branchB:

polyspace-access $login -import-reviews public/example/branchA \
 -to-project-path public/example/branchB
Here, $login is a variable that stores the login credentials and other connection information. To configure this variable, see Encrypt Password and Store Login Options in a Variable.

After you complete the import, you might want to examine the result of the import operation. Use the polyspace-access -export command with option -imported-reviews and filter by one of these values:

  • Not applied — Review information was imported from the source project but the review fields in the target project kept the original values.

  • Written — The Review information from the source project was written to the target project only if the review fields in the target project were previously empty.

  • Overwritten — The Review information from the source project was written to the target project even if the review fields in the target project were not previously empty.

  • Unconfirmed — Use this filter to select findings that where the result of the import operation has not been confirmed by a reviewer. You confirm the result of the import operation in the Polyspace Access interface. See Confirm Imported Review Information.

For example, to get a list of findings from the target project whose review information was overwritten, enter this command:

polyspace-access $login -export public/example/branchB \
 -imported-reviews Overwritten -output overWrittenReviews.txt 
The command output tab-separated values (TSV) file overWrittenReviews.txt which contains only findings that had their review information overwritten in the target project.

See Also

| (Polyspace Bug Finder)

Related Topics