Skip to content

Commit 2c14c98

Browse files
Apply suggestions from code review
Co-authored-by: Aditya Sharad <[email protected]>
1 parent 5d849a9 commit 2c14c98

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/query-metadata-style-guide.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,14 @@ When you tag a query like this, the associated CWE pages from [MITRE.org](http:/
159159

160160
#### Metric/summary `@tags`
161161

162-
Queries with the `summary` tag represent metrics or other pieces of summary information. If SARIF output is used, the results of these queries can be found at `run[].properties.metricResults`.
162+
Queries with `@kind metric` and the `summary` tag represent metrics or other pieces of summary information. If SARIF output is used, the results of these queries can be found at `run[].properties.metricResults`.
163163

164164
Code Scanning may use tags to identify queries with specific meanings across languages. Currently, there is only one such tag: `lines-of-code`. The sum of the results for queries with this tag that return a single integer column ([example for JavaScript](https://github.com/github/codeql/blob/c47d680d65f09a851e41d4edad58ffa7486b5431/java/ql/src/Metrics/Summaries/LinesOfCode.ql)) is assumed by Code Scanning to be the lines of code under the source root present in the database. Each language should have exactly one query of this form.
165-
165+
The `select` clause of a summary metric query must have one of the following result patterns:
166+
- Just a `number`
167+
- This indicates a metric without a specific location in the codebase, for example the total lines of code in a codebase.
168+
- A code `entity` followed by a `number`
169+
- This indicates a metric with a specific location in the codebase, for example the lines of code within a file. The `entity` here must have a valid location in the source code.
166170
## QL area
167171

168172
### Alert messages

0 commit comments

Comments
 (0)