codeql-cli-binaries
codeql-cli-binaries copied to clipboard
Provide tools to analyze the files in a database.
Recently, I tried to use CodeQL to analyze my project, and all the steps succeeded without any warnings. However, after running some queries I realized that it was missing most of the files.
As a user, it would be nice to be able to list the files that are included in the database with just a command.
After talking with @adityasharad , he suggested using a simple query that just lists all the files:
/**
* @description "List all the files"
* @id debug.listfiles
* @kind problem
* @name list-files
* @tags maintanability
* @problem.severity recommendation
**/
import cpp
from File f
select f, "This file is in the repo"
It would be nice to have something like that built into the application.
Note that having this query would be fine, but having a native tool to get this same information might be faster. Running this query on my project takes more than 10 minutes.
Does select any(File f).getAbsolutePath() give you the information you need quicker?
[Context: The query as written will trigger a (cached) computation of the toString representation of all program elements, which is a cost you do not need to pay for your use case.]