codeql-cli-binaries icon indicating copy to clipboard operation
codeql-cli-binaries copied to clipboard

Provide tools to analyze the files in a database.

Open mvanotti opened this issue 5 years ago • 2 comments

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.

mvanotti avatar Jan 24 '20 03:01 mvanotti

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.

mvanotti avatar Jan 24 '20 18:01 mvanotti

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.]

p0 avatar Jan 27 '20 13:01 p0