codeql-cli-binaries
codeql-cli-binaries copied to clipboard
show error message NO_KIND_SPECIFIED
i use codeql database analyze .\demo2 ..\vscode-codeql-starter\ql\javascript\ql\src\code_test.ql --format=csv --output=a/js-results.csv, but a error happen
E:\code analysis\test2> codeql database analyze .\demo2 ..\vscode-codeql-starter\ql\javascript\ql\src\code_test.ql --format=csv --output=a/js-results.csv
Running queries.
Compiling query plan for E:\code analysis\vscode-codeql-starter\ql\javascript\ql\src\code_test.ql.
[1/1 comp 10.1s] Compiled E:\code analysis\vscode-codeql-starter\ql\javascript\ql\src\code_test.ql.
Starting evaluation of codeql-javascript\code_test.ql.
[1/1 eval 474ms] Evaluation done; writing results to codeql-javascript\code_test.bqrs.
Shutting down query evaluator.
Interpreting results.
A fatal error occurred: Could not process query metadata for E:\code analysis\vscode-codeql-starter\ql\javascript\ql\src\code_test.ql.
Error was: No query kind specified [NO_KIND_SPECIFIED]
code_test.ql:
import javascript
from DataFlow::CallNode call
where call.getCalleeName() = "open"
select call
The analysis code is as follows:
I have already specified the ql file,but this is still an error... Can someone help me..... I really appreciate this!
This error message simply means that there was not a kind property defined in the query metadata, as described here: https://codeql.github.com/docs/writing-codeql-queries/metadata-for-codeql-queries/ for an example of valid metadata, see https://github.com/github/codeql/blob/6d7b95c15db07a649bff8ef446ec6fcda5896fa8/python/ql/src/Expressions/UseofInput.ql#L1-L11
I would strongly recommend using VS Code when learning/developing with CodeQL, as also described here: https://github.com/github/vscode-codeql-starter -- that makes the experience of writing and running queries much better :muscle:
If you by some reason can't use VS Code, it is possible to use a combination of codeql query run and codeql bqrs decode to view the raw results without proper metadata, but I would not recommend this way of working :wink: