Skip to content

Conversation

adityasharad
Copy link
Collaborator

@adityasharad adityasharad commented Jun 25, 2021

Some languages have multiple summary queries for lines of code, representing different forms of counting (user written, total, etc). When Code Scanning sees results from multiple such summary queries in a single run, it will need to choose one as the primary LoC count to display in the UI.

By ensuring only one query per language has the lines-of-code tag, in future we can teach Code Scanning to look for this particular tag to identify the primary LoC count.

If a "lines of user code" query is available, use that.
Otherwise use the total "lines of code".

(It is completely fine for multiple queries to be tagged with summary, and for there to be multiple forms of LoC query.)

Some languages have multiple `summary` queries for lines of code,
representing different forms of counting (user written, total, etc).
When Code Scanning sees results from multiple such summary queries in a single run,
it will need to choose one as the primary LoC count to display in the UI.

By ensuring only one query per language has the `lines-of-code` tag,
in future we can teach Code Scanning to look for this particular tag
to identify the primary LoC count.

If a "lines of user code" query is available, use that.
Otherwise use the total "lines of code".

(It is completely fine for multiple queries to be tagged with `summary`.)
@adityasharad adityasharad added the no-change-note-required This PR does not need a change note label Jun 25, 2021
@adityasharad adityasharad requested a review from rneatherway June 25, 2021 23:54
@adityasharad adityasharad requested review from a team as code owners June 25, 2021 23:54
Copy link
Collaborator

@criemen criemen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for C++

@criemen criemen merged commit a1c38b7 into github:main Jun 28, 2021
@geoffw0
Copy link
Contributor

geoffw0 commented Jun 30, 2021

Might be nice to mention lines-of-code and any other related special tags on https://github.com/github/codeql/blob/master/docs/query-metadata-style-guide.md.

@rneatherway
Copy link
Contributor

👍 #6257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ JS no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants