Monitor Code Quality Using Quality Objectives Dashboard in Polyspace Access
This example shows how to monitor the quality of your code against predefined (Polyspace Bug Finder) software quality thresholds or user-defined thresholds by using the Quality Objectives dashboard. You can use the thresholds as pass or fail criteria during the various stages of your project. From the dashboard, you can:
Apply the default (Polyspace Bug Finder) Polyspace® Access™ quality objectives or create custom software quality objectives (SQO) that suit your requirements. See Customize Software Quality Objectives.
View a snapshot of your code quality against all levels of the currently applied quality objectives definition.
To manage the thresholds that you assign to projects, see Manage Software Quality Objectives in Polyspace Access.
Monitor Code Quality Against Software Quality Objectives
In the Project Overview dashboard, use the Quality Objectives card to get a quick overview of your progress in achieving a quality objective threshold. The card shows:
The percentage of findings already addressed to achieve the selected threshold.
One of these labels:
(Pass) — All findings for this threshold have been addressed.
(In progress) — Some findings for this threshold are still open. A finding is open if it has a review status of
Unreviewed
,To fix
,To investigate
, orOther
.(Incomplete) — Some checkers required for this threshold were not activated in the analysis. For instance, if a threshold requires that you address all Polyspace Bug Finder™ defects, but the analysis includes only Numerical defects, the level is incomplete, even if you address all findings. To see a list of checkers you must activate, click .
Note
This label applies only to SQO thresholds 1 through 6. If you select the Exhaustive software quality threshold and you address all the findings, the threshold is labeled as (Pass) even if all required checkers for this threshold were not activated in the analysis.
(Not computed) — No quality objective results were computed.
After you apply a new quality objectives definition to a project, you see the not computed label until you upload a new run to the project.
The assigned Threshold. To select a different threshold or quality objectives definition, click . You must be an Administrator or project Owner to assign quality objective definitions or thresholds to a project. You can also assign quality objectives by right-clicking a project in the Project Explorer.
The Remaining number of findings that you need to address to reach the threshold. Click the number to open the Review perspective and see these findings in the Results List pane.
For a more comprehensive view, open the Quality Objectives dashboard. In the Summary section, click in the card on the left side to pick a threshold and see the remaining open issues, including a breakdown for each category, such as code metrics or coding rules.
In this Quality Objectives dashboard, 7% of the findings
required to achieve the threshold Exhaustive
have been
addressed, 38% of which are Defects. There are 1983 open
issues, which are split between Code Metrics (55), Coding Rule (1676), and Defects
(252).
This table shows the current progress of code quality for all quality objective thresholds. To view the Results List pane for a set of open issues, click the corresponding value in the table.
When you review a Polyspace Code Prover™ result, the Progress pane shows these additional columns:
Proven Run-time Errors
Proven Unreachable Code
Potential Run-time Errors
Global Variables
Additionally, you can view aggregated SQO statistics by selecting an entire project folder in the Project Explorer pane. Note these differences between viewing SQO information at the folder level and the project level.
For folders, the Progress and Details sections do not contain links to filtered results in the tables.
You cannot assign quality objective levels to all projects in the folder at once.
The Quality Objectives card for folders does not show Pass, In progress, or Incomplete labels.
Polyspace Access aggregates SQO statistics even if the quality objectives configuration levels are not homogeneous. While individual projects might contain separate definitions of each SQO level, Polyspace Access does not separate the statistics by level details when aggregating the statistics. All SQO1 level projects are aggregated together, as are SQO2 and so forth.
Customize Software Quality Objectives
To customize the thresholds that you use as pass or fail criteria to track the quality of your code, create or edit quality objective definitions and apply these definitions to specific projects. For instance, you might have a project where you want to check the quality of your code against only the MISRA C™:2012 coding standard.
To open the quality objectives settings, click Quality Objectives Settings on the Quality Objectives dashboard.
Create Quality Objectives Definition
To create a quality objectives definition, click New and enter a name for the new definition. You can optionally provide a description for the quality objectives definition and for the different SQO levels of that definition. Go to the Information tab to view or make additional edits to the descriptions.
After you assign this definition to a project, the name of the definition is displayed on the card in the summary section of the Quality Objectives dashboard for that project.
Edit Quality Objectives Definition
You can edit quality objective definitions only if you have a Polyspace Access role of Administrator or Owner. To set user roles, see Manage Project Permissions.
This table lists the different Polyspace Access roles and their corresponding write permissions for the quality object definitions. You cannot edit the default Polyspace Software Quality Objectives, no matter your role.
Project Role | Write Permission |
---|---|
Administrator | You can edit any quality objective definition. |
Owner | You can edit the quality objective definitions that you created. |
Contributor | You have a read-only view of the quality objective settings and cannot make edits. |
To edit the thresholds selection for a quality objectives definition:
Select the definition in the left side pane of the Configuration tab.
Click a findings family, for instance, MISRA C:2004.
To choose individual results, select or expand the nodes. For each family of results, you can view the nodes by group, or by category when available.
When you select nodes in the leftmost part of the table:
indicates that all entries under the node are enabled.
indicates that some entries under the node are not enabled.
For the quality objective thresholds under the SQO columns:
indicates that all the entries that are enabled under the node on that row apply to the threshold.
indicates that some of the entries that are enabled under the node on that row do not apply to the threshold.
For example, in the previous figure, in the Language extensions node:
The leftmost part of the table is marked as because rule 2.1 is not enabled.
The SQO5 and SQO6 entries along the row of the node are marked as because all the rules that are enabled under the node apply to these SQO thresholds.
The SQO4 entry along the row of the node is marked as because rule 2.2 is enabled, but does not apply to this SQO threshold.
These results are customizable by specifying numerical inputs:
Run-time Checks — Customize the percentage of findings that you must address or justify for each threshold. Enter a value between 0 and 100. To disable the selection, leave the entry blank.
Code Metrics — Customize the value of the different metrics for each threshold. To disable the selection, leave the entry blank.
When you make a selection for a threshold, all higher thresholds inherit that selection. For instance, if you select a coding rule for SQO3, the rule is also selected for SQO4, SQO5, and SQO6. By default, when you first select a node or an individual result, the selection applies only to SQO6.
To save your changes, click Save. You can also edit a quality objective definition by creating a copy of the definition using the Save as button and making edits to that copy. You might want to create a copy if:
You do not have write permissions for a quality objective definition.
You want to edit a quality objective definition but apply the changes to only your project.
You want to use an existing definition as a template.
If you make changes to a quality objectives definition that applies to multiple projects, Polyspace Access displays a warning with a link to the Project Assignment tab on the Quality Objectives Settings window. Open the tab to determine which projects are affected by your changes and inform users that have access to those projects of your changes.
Related Topics
- Evaluate Polyspace Bug Finder Results Against Bug Finder Quality Objectives (Polyspace Bug Finder)
- Code Metrics (Polyspace Bug Finder)