CodeQLAliases.

CodeQLAnalyzeDatabase(ICakeContext, CodeQLAnalyzeDatabaseToolSettings) Method

Summary

Analyzes a CodeQL database for vunerabilities and summarizes the results in a SARIF file. Assumes the codeQL cli is installed on the host and available in the terminal path.
Assembly
Cake.CodeQL.Cli.dll
Namespace
Cake.CodeQL.Cli
Containing Type
CodeQLAliases

Syntax

public static void CodeQLAnalyzeDatabase(this ICakeContext context, CodeQLAnalyzeDatabaseToolSettings settings)

Examples

Analyzes a CodeQL database and produces an output SARIF file

 //Example of C# compiled language

  CodeQLAnalyzeDatabase(new CodeQLAnalyzeDatabaseToolSettings
  {
     DatabaseDir = "./tools/codeql-db",
     WorkingDirectory = "./",
     OutputFile = "./results/example-repo.sarif",
     Threads = 1,
     SarifCategory = "csharp",
     Format = "sarifv2.1.0",
     Verbose = true
   });

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute

Parameters

Name Type Description
context ICakeContext The context.
settings CodeQLAnalyzeDatabaseToolSettings The settings.

Return Value

Type Description
void