You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve warning message: Warning: Did not find any lines of code in database #5838
We have recently introduced a baseline lines of code counter for the source code in your scan. We're using this as part of a larger feature to gather metrics about the repository being scanned.
In your case, for some reason, code scanning did not find any lines of code (it doesn't mean that your repository wasn't scanned, just that our LoC counter found nothing). It could be a bug. Though, it's hard to track this down without knowing a bit more about your repository. Is it public? If not, can you share a (sanitized) version of your code scanning workflow?
I had to use configs in order to do path filtering since this is a mono-repo and thats the only way I was able to specify paths to scan, but I don't think its relevant for the warning since the warning message first appeared in builds 3 days ago, and I didn't use config files in those builds. I've looked at builds from 6 days old and the error message is not there.
I just very quickly looked at the code, and I guess it can't be this simple, but I noticed that the values (which are the keys in the reversemap) doesn't match the languages. Could this be a bug?
analyze.ts:
const locPromise = countLoc(
path.resolve(),
// config.paths specifies external directories. the current
// directory is included in the analysis by default. Replicate
// that here.
config.paths,
config.pathsIgnore,
config.languages,
logger
);
// All the languages supported by CodeQL
export enum Language {
csharp = "csharp",
cpp = "cpp",
go = "go",
java = "java",
javascript = "javascript",
python = "python",
}
countLoc (definition) appears to be typed incorrectly based on how it is used in analyze.ts; specifically, dbLanguages is widened from Language[] to string[].
Activity
mariusingjer commentedon May 5, 2021
The error message stems from this file:
https://github.com/github/codeql-action/blob/1585462c63bbf1fe66558b776baebdf15cea0f3a/src/count-loc.ts
..still gets me wondering though
aeisenberg commentedon May 5, 2021
We have recently introduced a baseline lines of code counter for the source code in your scan. We're using this as part of a larger feature to gather metrics about the repository being scanned.
In your case, for some reason, code scanning did not find any lines of code (it doesn't mean that your repository wasn't scanned, just that our LoC counter found nothing). It could be a bug. Though, it's hard to track this down without knowing a bit more about your repository. Is it public? If not, can you share a (sanitized) version of your code scanning workflow?
mariusingjer commentedon May 5, 2021
I had to use configs in order to do path filtering since this is a mono-repo and thats the only way I was able to specify paths to scan, but I don't think its relevant for the warning since the warning message first appeared in builds 3 days ago, and I didn't use config files in those builds. I've looked at builds from 6 days old and the error message is not there.
and
aeisenberg commentedon May 5, 2021
Thanks. This is useful. I'll see if I can get some way to reproduce.
mariusingjer commentedon May 6, 2021
I just very quickly looked at the code, and I guess it can't be this simple, but I noticed that the values (which are the keys in the reversemap) doesn't match the languages. Could this be a bug?
analyze.ts:
count-loc.ts
languages.ts:
aeisenberg commentedon May 6, 2021
Thanks for taking a deeper look into this. I'm not able to verify at this moment, but it's possible you've found the problem.
tschaub commentedon May 7, 2021
Perhaps this is a totally unrelated project, but Googling for this "Did not find any lines of code in database" turns up examples like this: https://github.com/github/codeql-action/actions/runs/797613079
RA80533 commentedon May 7, 2021
countLoc(definition) appears to be typed incorrectly based on how it is used in analyze.ts; specifically,dbLanguagesis widened fromLanguage[]tostring[].aeisenberg commentedon May 7, 2021
Thanks all for pointing this out. This will be fixed next time we release.