snyk 1.962.0 → 1.963.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5458,21 +5458,24 @@ function getCodeDisplayedOutput(codeTest, meta, prefix) {
5458
5458
  '\n\n' +
5459
5459
  meta +
5460
5460
  '\n\n' +
5461
- codeIssueSummary);
5461
+ chalk_1.default.bold('Summary:') +
5462
+ '\n\n' +
5463
+ codeIssueSummary +
5464
+ '\n\n');
5462
5465
  }
5463
5466
  exports.getCodeDisplayedOutput = getCodeDisplayedOutput;
5464
5467
  function getCodeIssuesSummary(issues) {
5465
5468
  const lowSeverityText = issues.low.length
5466
- ? common_1.colorTextBySeverity(common_1.SEVERITY.LOW, ` ${issues.low.length} [Low] `)
5469
+ ? common_1.colorTextBySeverity(common_1.SEVERITY.LOW, ` ${issues.low.length} [Low] `)
5467
5470
  : '';
5468
5471
  const mediumSeverityText = issues.medium.length
5469
- ? common_1.colorTextBySeverity(common_1.SEVERITY.MEDIUM, ` ${issues.medium.length} [Medium] `)
5472
+ ? common_1.colorTextBySeverity(common_1.SEVERITY.MEDIUM, ` ${issues.medium.length} [Medium] `)
5470
5473
  : '';
5471
5474
  const highSeverityText = issues.high.length
5472
- ? common_1.colorTextBySeverity(common_1.SEVERITY.HIGH, `${issues.high.length} [High] `)
5475
+ ? common_1.colorTextBySeverity(common_1.SEVERITY.HIGH, ` ${issues.high.length} [High] `)
5473
5476
  : '';
5474
5477
  const codeIssueCount = issues.low.length + issues.medium.length + issues.high.length;
5475
- const codeIssueFound = `${codeIssueCount} Code issue${codeIssueCount > 0 ? 's' : ''} found`;
5478
+ const codeIssueFound = ` ${codeIssueCount} Code issue${codeIssueCount > 0 ? 's' : ''} found`;
5476
5479
  const issuesBySeverityText = highSeverityText + mediumSeverityText + lowSeverityText;
5477
5480
  const vulnPathsText = theme_1.color.status.success(`${theme_1.icon.VALID} Awesome! No issues were found.`);
5478
5481
  return codeIssueCount > 0
@@ -5495,14 +5498,16 @@ function getIssues(results, rulesMap) {
5495
5498
  if (!(ruleId in rulesMap)) {
5496
5499
  debug('Rule ID does not exist in the rules list');
5497
5500
  }
5498
- const ruleName = ((_b = rulesMap[ruleId].shortDescription) === null || _b === void 0 ? void 0 : _b.text) || rulesMap[ruleId].name;
5499
- const ruleIdSeverityText = common_1.colorTextBySeverity(severity, ` ${theme_1.icon.ISSUE} [${severity}] ${ruleName}`);
5501
+ const ruleName = ((_b = rulesMap[ruleId].shortDescription) === null || _b === void 0 ? void 0 : _b.text) ||
5502
+ rulesMap[ruleId].name ||
5503
+ '';
5504
+ const ruleIdSeverityText = common_1.colorTextBySeverity(severity, ` ${theme_1.icon.ISSUE} [${severity}] ${chalk_1.default.bold(ruleName)}`);
5500
5505
  const artifactLocationUri = location.artifactLocation.uri;
5501
5506
  const startLine = location.region.startLine;
5502
5507
  const text = res.message.text;
5503
5508
  const title = ruleIdSeverityText;
5504
- const path = ` Path: ${artifactLocationUri}, line ${startLine}`;
5505
- const info = ` Info: ${text}`;
5509
+ const path = ` Path: ${artifactLocationUri}, line ${startLine}`;
5510
+ const info = ` Info: ${text}`;
5506
5511
  acc[severity.toLowerCase()].push(`${title} \n ${path} \n ${info}\n\n`);
5507
5512
  }
5508
5513
  }
@@ -5527,14 +5532,14 @@ function sarifToSeverityLevel(sarifConfigurationLevel) {
5527
5532
  }
5528
5533
  function getMeta(options, path) {
5529
5534
  const padToLength = 19; // chars to align
5530
- const orgName = options.org;
5535
+ const orgName = options.org || '';
5531
5536
  const projectPath = options.path || path;
5532
5537
  const meta = [
5533
- chalk_1.default.bold(right_pad_1.rightPadWithSpaces('Organization: ', padToLength)) + orgName,
5538
+ right_pad_1.rightPadWithSpaces('Organization: ', padToLength) + chalk_1.default.bold(orgName),
5534
5539
  ];
5535
- meta.push(chalk_1.default.bold(right_pad_1.rightPadWithSpaces('Test type: ', padToLength)) +
5536
- 'Static code analysis');
5537
- meta.push(chalk_1.default.bold(right_pad_1.rightPadWithSpaces('Project path: ', padToLength)) + projectPath);
5540
+ meta.push(right_pad_1.rightPadWithSpaces('Test type: ', padToLength) +
5541
+ chalk_1.default.bold('Static code analysis'));
5542
+ meta.push(right_pad_1.rightPadWithSpaces('Project path: ', padToLength) + chalk_1.default.bold(projectPath));
5538
5543
  return meta.join('\n');
5539
5544
  }
5540
5545
  exports.getMeta = getMeta;