@coana-tech/cli 14.12.218 → 14.12.220

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.
package/cli.mjs CHANGED
@@ -205673,6 +205673,11 @@ async function getFilesRelative(dir, excludeDirs) {
205673
205673
  if (!excludeDirs?.includes(item.name)) await helper(itemPath, arrayOfFiles);
205674
205674
  } else if (item.isFile()) {
205675
205675
  arrayOfFiles.push(itemPath);
205676
+ } else if (item.isSymbolicLink()) {
205677
+ try {
205678
+ if ((await stat(join3(dir, itemPath))).isFile()) arrayOfFiles.push(itemPath);
205679
+ } catch {
205680
+ }
205676
205681
  }
205677
205682
  }
205678
205683
  return arrayOfFiles;
@@ -251831,7 +251836,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
251831
251836
  }
251832
251837
 
251833
251838
  // dist/version.js
251834
- var version3 = "14.12.218";
251839
+ var version3 = "14.12.220";
251835
251840
 
251836
251841
  // dist/cli-core.js
251837
251842
  var { mapValues, omit, partition, pickBy: pickBy2 } = import_lodash15.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coana-tech/cli",
3
- "version": "14.12.218",
3
+ "version": "14.12.220",
4
4
  "description": "Coana CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -81412,6 +81412,11 @@ async function getFiles(dir, excludeDirs) {
81412
81412
  if (!excludeDirs?.includes(item.name)) await helper(itemPath, arrayOfFiles);
81413
81413
  } else if (item.isFile()) {
81414
81414
  arrayOfFiles.push(itemPath);
81415
+ } else if (item.isSymbolicLink()) {
81416
+ try {
81417
+ if ((await stat(itemPath)).isFile()) arrayOfFiles.push(itemPath);
81418
+ } catch {
81419
+ }
81415
81420
  }
81416
81421
  }
81417
81422
  return arrayOfFiles;
@@ -113912,9 +113917,22 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
113912
113917
  heuristic: getHeuristicFromName(state, b.heuristicName, ecosystem),
113913
113918
  vulnerabilities: b.vulnUrls.map((vUrl) => vulnerabilities.find((v) => v.url === vUrl))
113914
113919
  })), analysisMetadataCollector, true);
113920
+ const originalUrlToReachability = transformVulnsToUrlToReachability(resWithoutExperimentalHeuristic.augmentedVulnerabilities);
113921
+ if (expHeuristicName === "SPARJS_EXPERIMENT") {
113922
+ for (const v of resWithoutExperimentalHeuristic.augmentedVulnerabilities) {
113923
+ if (v.results.type !== "success")
113924
+ continue;
113925
+ const { stacks } = v.results.detectedOccurrences;
113926
+ if (!stacks.length)
113927
+ continue;
113928
+ const pkgsInVulnChain = new Set(Object.values(v.vulnChainDetails.transitiveDependencies).map((d) => d.packageName));
113929
+ if (stacks.every((s2) => s2.some((f2, i4) => i4 > 0 && !pkgsInVulnChain.has(f2.package))))
113930
+ ignoredVulnerabilities.add(v.url);
113931
+ }
113932
+ }
113915
113933
  await Promise.all([
113916
113934
  sendTimeRegressionsToDashboard(expHeuristicName, resWithoutExperimentalHeuristic.analysisMetadata, bucketsToRecompute),
113917
- sendReachabilityRegressionsToDashboard(resWithoutExperimentalHeuristic.analysisMetadata[0].heuristicName, expHeuristicName, transformVulnsToUrlToReachability(resWithoutExperimentalHeuristic.augmentedVulnerabilities), experimentalUrlToReachability, ignoredVulnerabilities)
113935
+ sendReachabilityRegressionsToDashboard(resWithoutExperimentalHeuristic.analysisMetadata[0].heuristicName, expHeuristicName, originalUrlToReachability, experimentalUrlToReachability, ignoredVulnerabilities)
113918
113936
  ]);
113919
113937
  }
113920
113938
  const vulnsToGetFromExperimental = bucketsNotToRecompute.flatMap((b) => b.vulnUrls);
@@ -114222,8 +114240,8 @@ function findDuplicateVulnsInBuckets(bucketsFromLastAnalysis) {
114222
114240
  }
114223
114241
  return duplicateUrls;
114224
114242
  }
114225
- function transformVulnsToUrlToReachability(oldHeuristicAugmentedVulnerabilities) {
114226
- return Object.fromEntries(oldHeuristicAugmentedVulnerabilities.map((v) => [
114243
+ function transformVulnsToUrlToReachability(augmentedVulnerabilities) {
114244
+ return Object.fromEntries(augmentedVulnerabilities.map((v) => [
114227
114245
  v.url,
114228
114246
  {
114229
114247
  reachability: getVulnReachability(v.results),