Generate Report Containing Polyspace Bug Finder and Polyspace Code Prover Results
To obtain a report that contains the Code Prover results, all code metrics, and coding
            rule violations, run the command polyspace-report-generator. Generate a combined report containing
            these results: 
- MISRA C:2012. See MISRA C:2012 Directives and Rules. 
- Code metrics. See Code Metrics. 
- Stack usage metrics. See Stack Usage Metrics (Polyspace Code Prover). 
- Run-time checks. See Run-Time Checks (Polyspace Code Prover). 
For more information, see polyspace-report-generator.
Code Prover does not check for violations of coding standards, such as MISRA C:2012. Use Bug Finder to check for coding rule violations. Code Prover computes the stack usage code metrics only. The other code metrics are calculated by Bug Finder.
Prerequisite
- Before generating the report, confirm that your installed Polyspace® version is R2021b or later. 
- To use the C source file used in this example, navigate to - polyspaceroot\polyspace\examples\cxx\Bug_Finder_Example\sources\numerical.c- polyspacerootwith your Polyspace installation path, for instance,- C:\Program Files\Polyspace\R2025b. See also Installation Folder.
Obtain Code Metrics and Coding Rules Results by Using Bug Finder
Run a Bug Finder analysis and store the results.
- Run Bug Finder on - numerical.cto check for coding rule standard violations, and then store the results in a folder named- BFResults. For instance, at the command line, enter:The command runs Bug Finder on- polyspace-bug-finder -sources “polyspaceroot\polyspace\examples\cxx\Bug_Finder_Example\sources\numerical.c” -results-dir BFResults -code-metrics -misra3 all-rules -lang c -checkers none - numerical.cand stores the results in a folder named BFResults. Bug Finder checks for violations of MISRA C:2012 coding rules and computes the code metrics.- In the next steps, Code Prover performs an exhaustive check for run-time errors and other issues. In such a case, activating the Bug Finder defects might be redundant. Polyspace Report Generator does not support putting Code Prover run-time errors and Bug Finder defects in the same report. The defect checkers are deactivated in this step. 
- Navigate to - Current Folder\BFResults- ps_results.psbf. Verify that the results contain MISRA C;2012 violations and code metrics results. 
Obtain Run Time Check and Stack Usage Results by Using Code Prover
Run a Code Prover analysis and store the results.
- Run Code Prover on - numerical.cto check for run-time issues and to calculate stack usage metrics. Store the results in a folder named- CPResults. For instance, at the command line, enter:The command runs Code Prover on- polyspace-code-prover -sources “polyspaceroot\polyspace\examples\cxx\Bug_Finder_Example\sources\numerical.c” -results-dir CPResults -stack-usage -lang c -main-generator - numerical.cand stores the results in a folder named- CPResults. Because- numerical.cdoes not have a- main()function, specify the option- Verify module or library (-main-generator)(Polyspace Code Prover).
- Navigate to - Current Folder\CPResults- ps_results.pscp. Verify that the results contain run-time checks and stack usage results. 
Generate a Combined Report
After generating the Bug Finder and Code Prover results, summarize the results
                into a single report. To generate the report, specify an appropriate template and
                the results folders as inputs to the command
                    polyspace-report-generator.
- Before executing the report generation command, select an appropriate template. For this example, the report must contain a chapter each for code metrics, Code Prover runtime checks, and MISRA C:2012 violations. The template - Developer.rptaccommodates all of these results.- To include additional chapters about coding standards such as AUTOSAR C++14 or CERT C/C++, modify the existing templates. See Customize Existing Bug Finder Report Template. 
- Start the report generation by using the command - polyspace-report-generator. Specify the template- Developer.rptas the input to- -template. Provide the folders containing the Bug Finder and Code Prover results as inputs to- -results-dir. At the command line, enter:- polyspace-report-generator -template "polyspaceroot\toolbox\polyspace\psrptgen\templates\Developer.rpt" -results-dir “CPResults”,”BFResults” -output-name combined_report -format PDF 
The file combined_report.pdf is saved in your
                current folder. Open the file and verify that the report contains code metrics, Code
                Prover run-time checks, and MISRA C:2012 violations.

See Also
polyspace-report-generator | polyspace-bug-finder