Hi,
On the Polyspace Metrics interface, there is a New Findings Only check box. You can specify two versions to compare, and using that check box, see only new results compared to the previous version. See details in the documentation topic View Trends in Code Quality Metrics. Since you are uploading to Polyspace Metrics, it might be easier to see new findings there. If you just want statistics about the new results (and not the details), there is a command polyspace-comments-import that can compare two results. Enter polyspace-comments-import -h to see the syntax. Use the option -print-new-results to get statistics about the new results (how many new, how many removed, and so on) and parse the output. The item Number of new Defect results gives you the number of new findings. Since the command takes two result folders as input, you have to keep the result folder from one run before and compare with the current one (alternatively download the last run with polyspace-results-repository -download and compare).
If your intent is to get all details of new results at the command line (or even get the overall statistics at the command line after uploading to Polyspace Metrics), that is not possible. But, as I said, after upload, with one click, you can get to new results on the Polyspace Metrics interface.
Can I also take this opportunity to suggest migrating to Polyspace Access? Polyspace Metrics is an older interface and might not provide all the functionalities you want. With respect to your specific question, in Polyspace Access:
- With one click, again, you can see new results compared to the previous analysis. But unlike Polyspace Metrics, in Polyspace Access, you can see not just how many results are new, but which results are new. Polyspace Access allows you to see an overview and details both on the web browser. With Polyspace Metrics, to see details, you have to download the results and open them in the Polyspace desktop user interface.
- But more importantly, there is a command-line tool polyspace-access that provides exactly what you need. You can use the option -export with the option -new-findings to export new findings only.
For more information on Polyspace Access, see the documentation. However, I understand that migrating to a new workflow takes time, so let us know if polyspace-comments-import is sufficient for your needs.
Best Answer