Closed ysuLihua closed 1 month ago
You can use the --sarif-add-snippets
or --sarif-add-file-contents
flag for that:
$ codeql database analyze --help
Usage: codeql database analyze [OPTIONS] -- <database> [<query|dir|suite|pack>...]
Analyze a database, producing meaningful results in the context of the source code.
...
--[no-]sarif-add-file-contents
[SARIF formats only] Include the full file contents for all files referenced in at least one result.
--[no-]sarif-add-snippets
[SARIF formats only] Include code snippets for each location mentioned in the results, with two lines of context before and after the reported location.
ok, Thanks!
The result returned by codeql contains only the line number. Is there any way to include the content of the problematic code line?
The returned result contains the line number: