Main Content

Import Review Information from Previous Polyspace Analysis

This topic describes how to import review information from previous results that are not already uploaded to Polyspace® Access™. For information on importing from results uploaded to Polyspace Access, see Import Review Information from Existing Polyspace Access Projects (Polyspace Access).

After you have reviewed analysis results, you can reuse information from the review for subsequent analyses. If you specify a result status or severity or add notes in your results file, they carry over to the results of the next analysis on the same project. If you add the same information as comments to your code (annotate), they carry over to any subsequent analysis of the code, whether in the same project or not. You can also hide results using code annotations. For more information on commenting, see Address Polyspace Results Through Bug Fixes or Justifications.

This topic shows how to import review information from one result file to another. Importing the review information saves you from reviewing already justified results. After you import the information, you can use the filter on the Results List to filter out the results that have already been justified.

Automatic Import from Last Analysis

The Polyspace Platform user interface automatically imports review information from the last analysis.

If you run analysis at the command line (and do not upload results to the Polyspace Access web interface), you have to explicitly import from another set of results. See Command Line.

Import from Another Analysis Result

You can import review information directly from another Polyspace result to the current result.

If a result is found in both a Bug Finder and Code Prover analysis, you can add review information to the Bug Finder result and import to the Code Prover result. For instance, most coding rule checkers are common to Bug Finder and Code Prover. You can add review information to coding rule violations in Bug Finder and import to the same violations in Code Prover.

Polyspace Platform User Interface

To import review information from another set of results:

  1. Open the current analysis results.

  2. Select Import Comments from the toolstrip.

  3. Navigate to the folder containing your previous results.

  4. Select the other results file (with extension .psbf or .pscp) and then click Open.

    The review information from the previous results are imported into the current results.

Command Line

Use the option -import-comments during analysis to import comments from a previous verification.

To import review information from multiple results, use the polyspace-comments-import command.

Import Algorithm

You can directly import review information from another set of results into the current results. However, it is possible that part of your review information is not imported to a subsequent analysis because:

  • You have changed your source code so that the line with a previous result is not exactly identical to the line in the current run.

    The comment import tool accounts for additional code that simply shifts an existing line. For instance, the tool recognizes that line 10 in Run 1 and line 12 in Run 2 have the same statement. If a division by zero occurs on line 10 in Run 1 and you have not fixed the issue in Run 2, the result along with associated review information are imported to line 12 in Run 2.

    • Run 1:

      10 baseLine = min/numRecipients;
      11 
      12 
    • Run 2:

      10 /* Calculate a baseline per recipient
      11    based on minimum available resources */
      12 baseLine = min/numRecipients;

    However, if you change the line content itself, for instance, change numRecipient to numReceiver, the result and review information is partially imported and the status is set to unreviewed. Revisit the imported review information to determine if the comment still applies to the changed content.

  • You changed your source code so that the Code Prover result color has changed. When the Code Prover check color changes, Polyspace imports the Comment field but not the Status field. In addition, Polyspace imports the Severity and Justified fields depending on the color change.

    Color ChangeSeverityJustified
    Orange or red to greenNot importedImported
    Gray to greenNot importedImported, if the Severity was set to High, Medium or Low.
    Red to orange or vice versaImportedImported
    Green to red/orange/grayNot importedNot imported
  • You entered new review information for the same result.

  • You removed a source file that had review information associated with it. When you remove a file from a project and run an analysis, Polyspace does not import the review information associated with the file in subsequent runs. Even if you add the file back to the project, Polyspace treats the file as a new file and does not import review information from old runs.

If the content of a line does not change and shows the same result as the previous analysis, the review information is imported. In unlikely scenarios, you might get the same result on the same line despite changing previous lines that lead to the result. Your review information from a previous analysis is then imported to the new result. If you justified the previous result with a status such as Not a defect, it is likely that you want to continue this justification with the new result. For instance, if you accepted an overflow previously because you accounted for a wrap-around behavior after the overflow, you are likely to accept the overflow whatever the cause. In a few cases, you might want to review the result again and might not be aware that the result merits another review. To avoid this situation:

  • When justifying nonlocal results that are related to previous events, use careful judgement.

  • For critical components, conduct periodic assessments of justified results to see if the justifications still apply. Such assessments are useful specially for the Code Prover run-time checks.

See Also

|

Topics