- Apply a filter when exporting results to filter results that have the status "Unreviewed" (see the connection between "To do" and result statuses here)
- Add up the number of results in the exported file using $ps_helper report_count_findings
Is there an API to retrieve metrics from polyspace access
6 views (last 30 days)
Show older comments
Hello,
I have a polyspace server like url:9443
Inside it, with jenkins, I created a folder structure that looks like Public/project_name/branch_name.
I can access the server with my access license, and I see all the history and metrics from my jenkins builds in there (polyspace being triggered by jenkins).
For reporting, I have to recover the metrics of a specific project_name/branch_name. Is there an API to access it?
The url of the page where I see the metrics is like : url:9443/metrics/index.html?a=metrics&p=44&r=13
The other way I see is dumping the html page and analyzing it, but this is not a very "easy" way.
Thanks
Olivier
0 Comments
Accepted Answer
Anirban
on 12 Feb 2021
Edited: Anirban
on 12 Feb 2021
Hi Olivier,
You definitely have options besides dumping the full html page.
Just to clarify, when you say "metrics", do you mean "code complexity metrics" that Polyspace calculates or all the information that you see on a page like this:
url:9443/metrics/index.html?a=metrics&p=44&r=13
Either way, you have to use the polyspace-access command with the -export option.
If you want the code complexity metrics, you have to use:
polyspace-access ... -export ...-code-metrics
This would export only the code complexity metrics to a tab-delimited text file and you can perform the calculations on the text file.
If you want all the info on the Polyspace Access dashboard exported, you have to first export results from a project to a text file with whatever filter you want and perform the computations on the text file. The polyspace-access command does not directly give out all the information that is on the Polyspace Access dashboard.
If you use the Polyspace plugin in Jenkins, you can use some additional helper commands that does some of the computations. For instance, to get the number of results that are "To do" on the Polyspace Access dashboard, you can:
That way, you can compute all the numbers that you see on the Polyspace Access dashboard without any heavy scripting. You can see an example script in Sample Scripts for Polyspace Analysis with Jenkins.
1 Comment
Ashray
on 19 Oct 2023
Hello Anirban,
Is there any way to retrive the line number as well for a given warning?
Also , it would be helpful if i can export one line suggestion which is present in "Result Details" Tab.
PS: it has been highlighted in red what i need to retrive/export in the polyspace report.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1515464/image.png)
More Answers (1)
See Also
Categories
Find more on Generate Reports in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!