getResults
View all instances of Bug Finder or Code Prover results
Description
returns a table showing all results in a Polyspace® result set, resTable
= getResults(resObj
, content
)resObj
. The results set
resObj
can be a Bug Finder results set denoted by a polyspace.BugFinderResults
object or a Code Prover results set denoted by a
polyspace.CodeProverResults
(Polyspace Code Prover) object. You can manipulate the table to produce
graphs and statistics about your results that you cannot obtain readily from the user
interface.
Examples
Read Existing Bug Finder Results to MATLAB Tables
This example shows how to read Bug Finder analysis results from MATLAB®.
Copy a demo result set to a temporary folder.
resPath = fullfile(polyspaceroot,'polyspace','examples','cxx','Bug_Finder_Example', ... 'Module_1','BF_Result'); userResPath = tempname; copyfile(resPath,userResPath);
Create the results object.
resObj = polyspace.BugFinderResults(userResPath);
Read results to MATLAB tables using the object.
resSummary = getSummary(resObj, 'defects');
resTable = getResults(resObj);
Run Bug Finder Analysis and Read Results to MATLAB Tables
Run a Polyspace
Bug Finder™ analysis on the demo file numerical.c
. Configure these options:
Specify GCC 4.9 as your compiler.
Save the results in a
results
subfolder of the current working folder.
proj = polyspace.Project % Configure analysis proj.Configuration.Sources = {fullfile(polyspaceroot, 'polyspace', ... 'examples', 'cxx', 'Bug_Finder_Example', 'sources', 'numerical.c')}; proj.Configuration.TargetCompiler.Compiler = 'gnu4.9'; proj.Configuration.ResultsDir = fullfile(pwd,'results'); % Run analysis bfStatus = proj.run('bugFinder'); % Read results resObj = proj.Results; bfSummary = getResults(resObj, 'readable');
Read Existing Code Prover Results to MATLAB Tables
This example shows how to read Code Prover analysis results from MATLAB.
Copy a demo result set to a temporary folder.
resPath=fullfile(polyspaceroot,'polyspace','examples','cxx','Code_Prover_Example', ... 'Module_1','CP_Result'); userResPath = tempname; copyfile(resPath,userResPath);
Create the results object.
resObj = polyspace.CodeProverResults(userResPath);
Read results to MATLAB tables using the object.
resSummary = getSummary (resObj); resTable = getResults (resObj);
Run Code Prover Analysis and Read Results to MATLAB Tables
Run a Polyspace
Code Prover™ analysis on the demo file single_file_analysis.c
.
Configure these options:
Specify GCC 4.9 as your compiler.
Save the results in a
results
subfolder of the current working folder.Specify that a
main
function must be generated, if it does not exist in the source code.
proj = polyspace.Project % Configure analysis proj.Configuration.Sources = {fullfile(polyspaceroot, 'polyspace', 'examples',... 'cxx', 'Code_Prover_Example', 'sources', 'single_file_analysis.c')}; proj.Configuration.TargetCompiler.Compiler = 'gnu4.9'; proj.Configuration.ResultsDir = fullfile(pwd,'results'); proj.Configuration.CodeProverVerification.MainGenerator = true; % Run analysis cpStatus = proj.run('codeProver'); % Read results resObj = proj.Results; cpSummary = getResults(resObj, 'readable');
Input Arguments
resObj
— Bug Finder or Code Prover results
polyspace.BugFinderResults
or
polyspace.CodeProverResults
object
Bug Finder or Code Prover results set, specified as a polyspace.BugFinderResults
or polyspace.CodeProverResults
(Polyspace Code Prover) object respectively.
content
— Result information to include
''
(default) | 'readable'
Amount of information to be included for each result. If you specify
''
, all information is included. If you specify
'readable'
, the following information is not included:
ID: Unique number for a result for the current analysis.
Group: Defect groups, Check groups (Polyspace Code Prover), MISRA C:2012 groups, etc.
Status, Severity, Comment: Information that you enter about a result.
If you do not specify this argument, the full table is included.
Output Arguments
resTable
— Results of a Bug Finder or Code Prover analysis
table
Table showing all results from a single Bug
Finder or Code Prover analysis. For each result, the table has information such as file,
family, and so on. If a particular information is not available for a result, the entry
in the table states <undefined>
.
For more information on:
The columns of the table, see Export Polyspace Analysis Results.
MATLAB tables, see Tables.
Version History
Introduced in R2017a
See Also
polyspace.BugFinderResults
| polyspace.CodeProverResults
(Polyspace Code Prover)
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)