在CodeQL CLI中执行分析的命令如下
codeql database analyze <database> <queries> --format=<format> --output=<output>
eg,
codeql database analyze <javascript-database> ../ql/javascript/ql/src/Declarations/UnusedVariable.ql --format=csv --output=js-analysis/js-results.csv
codeql database analyze <cpp-database> cpp-lgtm.qls --format=sarif-latest --output=cpp-analysis/cpp-results.sarif
运行某个文件夹下所有的查询:
codeql database analyze <python-database> ../ql/python/ql/src/Functions/ --format=sarif-latest --output=python-analysis/python-results.sarif
References
https://help.semmle.com/codeql/codeql-cli/procedures/analyze-codeql-database.html