Skip to content

Improve metrics output #1036

Open
Open
@Marcono1234

Description

@Marcono1234

Version

CodeQL CLI: 2.8.5
CodeQL action: 1.1.8 (according to CODEQL_ACTION_VERSION environment variable)

Description

Currently (at least for Java projects) the metrics table printed at the end of github/codeql-action/analyze contains the same metric name multiple times, e.g.:

|                          Metric                          | Value |
+----------------------------------------------------------+-------+
| Total lines of code in the database                      |  9668 |
| External libraries                                       |  1458 |
| External libraries                                       |    28 |
| External libraries                                       |     9 |
| External libraries                                       |     7 |
| External libraries                                       |     6 |
| External libraries                                       |     1 |
| Supported sinks in external libraries                    |     7 |
| Supported sinks in external libraries                    |     6 |
| Supported sinks in external libraries                    |     4 |
| Supported sinks in external libraries                    |     2 |
| Supported sinks in external libraries                    |     1 |
| Supported sinks in external libraries                    |     1 |
| Supported sinks in external libraries                    |     1 |
| Supported sinks in external libraries                    |     1 |
| Supported flow steps in external libraries               |    82 |
| Supported flow steps in external libraries               |    42 |
| Supported flow steps in external libraries               |    36 |
| Supported flow steps in external libraries               |    30 |
| Supported flow steps in external libraries               |    25 |
...

(workflow run)

The issue might be that these queries have multiple result columns, but the table here only seems to contain the usages count, discarding the other columns. Maybe the underlying issue is therefore caused by CodeQL CLI or by the Java queries.

Additionally it might be good to add an empty line in front of "Analysis produced the following metric data:" (to separate it more clearly from the previous table). And also the "Counted a baseline of ..." sentence seems to be printed twice (workflow run).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions