Skip to content

Commit

Permalink
fix: support of the new Code API
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvi3d committed Aug 2, 2021
1 parent b7a190b commit bfa6493
Show file tree
Hide file tree
Showing 3 changed files with 1,550 additions and 4,387 deletions.
13 changes: 5 additions & 8 deletions src/lib/plugins/sast/analysis.ts
Expand Up @@ -49,17 +49,14 @@ async function getCodeAnalysis(root: string, options: Options): Promise<Log> {
const severity = options.severityThreshold
? severityToAnalysisSeverity(options.severityThreshold)
: AnalysisSeverity.info;
const paths: string[] = [root];
const sarif = true;

const result = await analyzeFolders({
baseURL,
sessionToken,
severity,
paths,
sarif,
connection: { baseURL, sessionToken, source: 'snyk-cli' },
analysisOptions: { severity },
fileOptions: { paths: [root] },
});

return result.sarifResults!;
return result?.analysisResults.sarif!;
}

function severityToAnalysisSeverity(severity: SEVERITY): AnalysisSeverity {
Expand Down

0 comments on commit bfa6493

Please sign in to comment.