Main Content

Generate Reports of Bug Finder or Code Prover Results in Polyspace Platform User Interface

This topic describes how to generate a report from analysis results in the Polyspace Platform user interface. If you are using the standard Polyspace user interface, see Generate Reports from Polyspace Results.

To generate reports from Polyspace Platform user interface, you must first run a Polyspace® analysis. You can then create a report from the analysis results or export the results to CSV format.

  • If you are running a report for a result that is uploaded to Polyspace Access™, you have the option to enter a project path or run ID to identify which result from Polyspace Access you want to create a report for. These fields are automatically prefilled with the currently selected result information.

To generate reports from Polyspace results, you can do one of the following:

  • Run a Polyspace analysis and create a report from the analysis results. See the workflow described here.

  • Specify that a report will be automatically generated after analysis. For more information on the options, see Reporting. Report generation immediately after analysis is supported for both desktop and server products.

  • Export your results to a text file and generate graphs and statistics. See Export Polyspace Analysis Results.

Depending on the template you use, the report contains information about certain types of results from the Results List pane. You can see the following information about a result:

  • ID: Unique number for a result for the current analysis

    To identify the result in your source code, you can use the ID in the Results List pane of the Polyspace user interface or in your IDE if you are using a Polyspace plugin.

  • Check: Defect names, MISRA C™:2012 coding rule number, and so on.

  • File and function

  • Status, Severity, Comment: Information that you enter about a result.1

Use the report for archiving, gathering statistics and checking whether results have been reviewed and addressed (for certification purposes or otherwise). To review a result in your source code, use the Polyspace user interface or your IDE if you are using a Polyspace plugin.

Generate Reports

You can generate a report for your locally open results or any results uploaded to Polyspace Access. Local results and results in Polyspace Access can contain differences.

Generate a Report from Local Results

To generate a report from your current analysis results:

  1. Open your results file in Polyspace Platform user interface.

  2. In the toolstrip, select Report > Run Report. The Run Report dialog box opens.

  3. Specify the options for generating the report:

    • In the Select Report Template section, select a report template to use for report generation. You can select only one report at a time.

      The default templates are BugFinderSummary.rpt for Polyspace Bug Finder™ and Developer.rpt for Polyspace Code Prover™.

    • Select Report for all files if you are creating a report for a unit-by-unit analysis. Otherwise, the report will contain only the results of the currently selected unit. To create a report for all results of a unit-by-unit analysis, analysis for all units must successfully complete.

    • Select the Output folder in which to save the report.

    • Select an Output format for the report.

    Run Report dialog box

  4. Click Run Report.

Generate a Report from Polyspace Access Results

To generate a report from results uploaded to Polyspace Access:

  1. Open your results file in Polyspace Platform user interface

  2. Select Access > Run Report for Access Results from the toolstrip. The Run Report dialog box opens.

  3. Specify the options for generating the report:

    • Enter your Polyspace Access login credentials for the server listed. The Server field is populated with the server information you set in Polyspace Platform. See Integrate Polyspace User Interface with Polyspace Access (Polyspace Access).

    • Enter a project path or run ID for the set of results. If the results you currently have open in the Polyspace Platform user interface are uploaded to Polyspace Access, these fields are automatically populated with the project information. Alternatively, click Open Web Interface to open the Polyspace Access web interface to determine your project path or specific run ID.

    • In the Select Report Template section, select a report template to use for report generation. You can select only one report at a time.

      The default templates are BugFinderSummary.rpt for Polyspace Bug Finder and Developer.rpt for Polyspace Code Prover.

    • Select Report for all files if you are creating a report for a unit-by-unit analysis. If you do not select Report for all files, the report will contain only the results of the currently selected unit. To create a report for all results of a unit-by-unit analysis, analysis for all units must successfully complete.

    • Select the Output folder in which to save the report.

    • Select an Output format for the report.

    Run Report for a Polyspace Access result

  4. Click Run Report.

The software creates the specified report and shows the status of the report generation in the Run Report window. Once the software finishes creating your report, it opens the report. Alternatively, you can open any report by selecting Report > Open from the toolstrip.

Export Results

You can export your analysis results to a TSV, JSON, or CSV file. Using the exported content, you can:

  • Generate graphs or statistics about your results that you cannot readily obtain from the user interface by using software such as Microsoft® Excel®. For instance, for each Code Prover check type (Division by zeroOverflow), you can calculate how many checks are red, orange, or green.

  • Integrate the analysis results with other checks you perform on your code.

To export results to a tab delimited text file (TSV) from the Polyspace Platform user interface:

  1. Open your analysis results.

  2. Export all results or all variable access information.

    • To export all results, select Report > Export All Results.

    • To export all variable access information, select Report > Export Variable Access. For more information about variable access, see Variable Access in Polyspace Desktop User Interface (Polyspace Code Prover).

    Export All Results and Export Variable Access options in Report menu of Polyspace

  3. Select a location to save the text file. You can save your file in CSV, JSON, or TSV format by selecting file type All Files (*.*) and manually editing the file extension. Click Save.

Generate Reports from Command Line

You can script the generation of reports using the polyspace-report-generator command.

To generate BugFinder and CodeMetrics HTMLreports for results in C:\Users\johndoe\Documents\Polyspace\Examples\Bug_Finder_Example\Module_1\BF_Result, use the following options with the command:

SET template_path=^
"C:\Program Files\MATLAB\R2018a\toolbox\polyspace\psrptgen\templates\bug_finder"
SET bf_templates=^
%template_path%\BugFinder.rpt,%template_path%\CodingMetrics.rpt
SET results_dir=^
"C:\Users\johndoe\Documents\Polyspace\Examples\Bug_Finder_Example\Module_1\BF_Result"

polyspace-report-generator ^
-results-dir %results_dir% ^
-template %bf_templates% ^
-format html

See Also

| |

Related Topics


1 Reports generated from Polyspace results are typically meant for archiving and certification. Therefore, the reports contain all Polyspace results, justified or otherwise. Justified results show the justification status, for instance, No Action Planned, along with comments supporting the justification. These reports allow standards committees such as certification authorities to verify if a Polyspace result was justified for approved reasons.