Skip to content

Metrics View in CodeChecker #4638

@dkrupp

Description

@dkrupp

CodeChecker will have a metrics view, where different scalar metrics can be stored per run and run history event (storage event) for each file and directory.

Metrics stored per run per run history event
In this view a single run and storage event must be selected. the default is the latest storage event. The metrics of of the selected storage version is shown for each file and directory stored in that run. The metrics should be stored for each run history event.

Initially the feature should support at least the following metrics:

  • Lines of Code
  • Effective Lines of Code
  • Number of outstanding reports per severity level (At the time of storing the results, as the report count may change with setting some of the reports resolved. In such case a new storage must be performed.)
  • Report density Number of outstanding reports / effective lines of code

Optionally the following metrics may be stored

  • Cyclomatic complexity (per file)
  • Number of duplicated lines of code
  • Number of unresolved SEI cert violations

Navigation
A directory level navigation should be provided where the metrics are displayed for each file and direcory. When the user clicks a file, the source code view is shown for that specific file and version. When the user clicks a directory, the navigation enters into that folder.

Calculation of Metrics
There can be 2 types of metrics:
a) client calculated metrics (such as test coverage)
b) server calculated metrics (such as number of outstanding reports)

The metrics are only calculated at the store event and are read only (cannot change after store). New metrics value can be stored with a new store.

Aggregation

The metrics should be stored per file, but should possible to be aggregated on the directory level.

The directory level aggregation summary must be supported.

Visualization & Gating (Future work)
The implementation must allow the visualization of trend lines (by time) for each metric and allow the future implementation of gating on the last change of the metric, or the current status of metric.

Open questions

  1. For which files we need to calculate the LOC metrics ? - All text files?
  2. The content of which files need to be stored? - All text files / only the files where we have reports?
  3. Which versions of the source code files need to be stored? - Only the latest version in the run?

Implementation

Client calculated metrics should be uploaded to the server in YAML files along in the store procedure. Exact YAML format to be defined.
Server calculated metrics should be stored at end of the store procedure.

Database Schema
Metrics Tabe:

Metrics ID | File ID | Run History ID | Metrics Value | Metrics Type

Metrics_Type Table

Metrics Type ID | Metrics Name | Metrics measure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions