View Code Quality Metrics

Note

This topic describes a workflow in the Polyspace Metrics web interface.

For easier collaborative reviews, use Polyspace® Code Prover™ Access™ . In addition to a more intuitive web dashboard, with Polyspace Access you can:

  • Review and justify results directly from your web browser.

  • Integrate a defect-tracking tool such as Jira with the web interface and create tickets to track Polyspace findings.

  • Share analysis results using web links.

For more information, see the Polyspace Code Prover Access documentation.

Before you can view software quality metrics, upload your results to the Polyspace Metrics repository. You can upload the results of a local verification or remote verification. For more information, see Generate Code Quality Metrics.

Open Metrics Interface

You can open the metrics interface in one of the following ways:

  • If you have a local installation of Polyspace, select Metrics > Open Metrics.

  • If you do not have a local installation, enter the following URL in a web browser:

    protocol:// ServerName: PortNumber
    
    • protocol is either http (default) or https.

      To use HTTPS, set up the configuration file and the Metrics configuration preferences. For more information, see Configure Web Server for HTTPS.

    • ServerName is the name or IP address of your Polyspace Metrics server.

    • PortNumber is the web server port number (default 8080)

View All Projects and Runs

On the Polyspace Metrics interface, you can view either all projects or all runs.

  • On the Projects tab, view all projects.

    On this tab, you can do the following:

    GoalAction
    See number of project runs.Hover your cursor over the project name.
    Group projects together.Right-click a project. Select Create Project Category. Drag projects to your new category.
    Filter projects from display.In the field below the Project column header, enter the name of the project you want.
    Delete project from the Metrics repository.Right-click the project. Select Delete Project from Repository.
    Assign password to project.Right-click the project. Select Change/Set Password.
    See code quality metrics for all runs of project.Click the project name. For more information, see Review Metrics for Particular Project or Run.

    Tip

    If a new verification has been carried out for a project since your last visit, then on the Projects tab, the icon appears before the project name.

  • If a project has multiple runs, on the Runs tab, view the individual runs. To identify different runs of the same project, use the Project and Version column.

    On this tab, you can do the following:

    GoalAction
    Delete run from repository.Right-click the run. Select Delete Run from Repository.
    Assign password to run.Right-click the run. Select Change/Set Password.
    See runs between two specific dates.Select the starting date in the From field and the end date in the To field.
    See only the last n runs.In the field Maximum number of runs, enter n.
    See code quality metrics for a run. Right-click the run. Select Go to Metrics Page. For more information, see Review Metrics for Particular Project or Run.
    Download results of run to Polyspace user interface.Click the run name.

Review Metrics for Particular Project or Run

If you select a project on the Projects tab or Go to Metrics Page for a run on the Runs tab, you can view the code quality metrics for the project or run. A summary of the metrics appears on the Summary tab.

If you want to compare the code quality metrics against standards you have previously defined, before reviewing your results, you can turn on quality objectives. For more information, see Compare Metrics Against Software Quality Objectives.

Otherwise, review the absolute values of code quality metrics on the Summary tab.

  1. Select an entry on the Summary tab to open another tab with further details.

    • If you select an entry under the group Code Metrics, you can see your code complexity metrics on the Code Metrics tab.

    • If you select an entry under the group Coding Rules, you can see your coding rule violations on the Coding Rules tab.

    • If you select an entry under the group Run-Time Errors, you can see your run-time checks on the Run-Time Checks tab.

    For example, in the following metrics, there are three red checks. Select the entry in the Red column to view the checks on the Run-time Checks tab.

    For details on the columns, see Code Quality Metrics.

  2. On the Code Metrics, Coding Rules or Run-Time Errors tabs, select an entry to download the result to the Polyspace user interface and follow any prompt from your web browser. If the results do not open automatically in the Polyspace interface, check the Web Browser Requirements for Polyspace Metrics.

    The results appear on the Results List pane in the Polyspace user interface. The filter Show > Web checks on this pane indicate that you have downloaded the results from Polyspace Metrics.

  3. In the Polyspace user interface, review the particular result, investigate the root cause in your source code, and assign review comments and justifications.

    You can review the downloaded results or generate reports. If you generate a report, all results in the results file appear in the report (not just the downloaded results). To generate a filtered report, change the scope Web checks to another named filtered set, for instance, All results. Then, apply filters and generate the report. For more information, see Generate Reports.

  4. To upload your comments and justifications to the Polyspace Metrics repository, select Metrics > Upload to Metrics.

    Tip

    To upload automatically your comments and justifications to the Polyspace Metrics repository when you save them:

    1. Select Tools > Preferences.

    2. On the Server Configuration tab, select Save justifications in the Polyspace Metrics repository.

  5. After your review is over, in the Polyspace Metrics interface, click to view updated metrics.

Related Topics