Skip to content

Ensure only one query per language is tagged lines-of-code#6163

Merged
criemen merged 1 commit intogithub:mainfrom
adityasharad:lines-of-code-make-unique
Jun 28, 2021
Merged

Ensure only one query per language is tagged lines-of-code#6163
criemen merged 1 commit intogithub:mainfrom
adityasharad:lines-of-code-make-unique

Conversation

@adityasharad
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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