| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| const statusReport: QueriesStatusReport = {}; | ||
|
|
||
| // count the number of lines in the background | ||
| const locPromise = countLoc( |
There was a problem hiding this comment.
This is clever, so the promise it's only resolved when it's used but is used in potentially multiple places. Worth noting that in practice there will always be some queries to evaluate so we'll always end up using this promise. It's an error for there not to be any queries to analyse and it would have error-ed back in the init step. Up to you if you therefore want to leave this as it is or potentially simplify it.
Sorry, something went wrong.
There was a problem hiding this comment.
The main reason why I'm doing this is so that the line counting can happen in "parallel". On large projects, counting can take 10-20s and there's lots of disk IO, so it's nice to be able to run this while other things are happening.
Sorry, something went wrong.
There was a problem hiding this comment.
Nice and clear. Couple of recommendations based on CodeQL conventions for labelling languages.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM from my point of view. Probably best let @adityasharad also review the recent changes.
Sorry, something went wrong.
This commit uses a third party library to estimate the lines of code in
a database that is to be analyzed by codeql.
The estimate uses the same includes and excludes globs for determining
which files should be counted.
The lines of code count is returned by language and injected into the
SARIF as `baseline` property in the `${language}/summary/lines-of-code`
metric.
| Back | FazBrowse Home | New Git URL |
This commit uses a third party library to estimate the lines of code in
a database that is to be analyzed by codeql.
The estimate uses the same includes and excludes globs for determining
which files should be counted.
The lines of code count is returned by language and injected into the
SARIF as appropriate.
Currently, this PR adds the LoC data in the metricResults property of the sarif in a blob like this:
We haven't agreed on what this will look like, so injecting the metric may change.
We've decided that the lines of code will be injected into metrics with id like this: ${language}/summary/lines-of-code and a new baseline property is added to the metric. Languages that we have a count for, but no metric, will be ignored.
Merge / deployment checklist