Socket
Socket
Sign inDemoInstall

snyk-to-html

Package Overview
Dependencies
21
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.2 to 2.3.0

dist/lib/codeutil.d.ts

32

dist/lib/snyk-to-html.js

@@ -14,2 +14,3 @@ #!/usr/bin/env node

const vuln_1 = require("./vuln");
const codeutil_1 = require("./codeutil");
const debug = debugModule('snyk-to-html');

@@ -69,2 +70,9 @@ const defaultRemediationText = '## Remediation\nThere is no remediation at the moment';

}
else if ((data === null || data === void 0 ? void 0 : data.runs) && (data === null || data === void 0 ? void 0 : data.runs[0].tool.driver.name) === 'SnykCode') {
template =
template === path.join(__dirname, '../../template/test-report.hbs')
? path.join(__dirname, '../../template/code/test-report.hbs')
: template;
return processCodeData(data, template, summary);
}
else {

@@ -185,2 +193,12 @@ return processData(data, remediation, template, summary);

}
async function generateCodeTemplate(data, template) {
await registerPeerPartial(template, 'inline-css');
await registerPeerPartial(template, 'inline-js');
await registerPeerPartial(template, 'header');
await registerPeerPartial(template, 'metatable-css');
await registerPeerPartial(template, 'metatable');
await registerPeerPartial(template, 'code-snip');
const htmlTemplate = await compileTemplate(template);
return htmlTemplate(data);
}
function mergeData(dataArray) {

@@ -230,2 +248,16 @@ const vulnsArrays = dataArray.map(project => project.vulnerabilities || []);

}
async function processCodeData(data, template, summary) {
if (data.error) {
return generateCodeTemplate(data, template);
}
const dataArray = Array.isArray(data) ? data : [data];
const OrderedIssuesArray = await codeutil_1.processSourceCode(dataArray);
const totalIssues = dataArray[0].runs[0].results.length;
const processedData = {
projects: OrderedIssuesArray,
showSummaryOnly: summary,
totalIssues,
};
return generateCodeTemplate(processedData, template);
}
async function readInputFromStdin() {

@@ -232,0 +264,0 @@ return new Promise((resolve, reject) => {

2

package.json

@@ -68,3 +68,3 @@ {

},
"version": "2.2.2"
"version": "2.3.0"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc