@coana-tech/cli 14.12.152 → 14.12.154

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
@@ -234634,6 +234634,7 @@ function isShortestPath(root3, vulnPath) {
234634
234634
 
234635
234635
  // ../web-compat-utils/src/analysis-error-keys.ts
234636
234636
  var CLI_ANALYSIS_ERROR_MESSAGE = "Sharing log due to analysis error";
234637
+ var ANALYSIS_LOW_CONFIDENCE_MESSAGE = "Analysis had low confidence in result";
234637
234638
 
234638
234639
  // ../web-compat-utils/src/pluralize.ts
234639
234640
  function pluralize(count, word) {
@@ -235720,6 +235721,10 @@ var ERROR_CATEGORY_MESSAGES = {
235720
235721
  "Check https://docs.socket.dev/docs/reachability-analysis#reachability-ecosystem-support for more details"
235721
235722
  ]
235722
235723
  },
235724
+ lowConfidence: {
235725
+ title,
235726
+ details: [TIER2_FALLBACK_MESSAGE, "The analysis produced only a partial result, which is of insufficient quality to accurately determine the reachability of this advisory."]
235727
+ },
235723
235728
  general: {
235724
235729
  title,
235725
235730
  details: [TIER2_FALLBACK_MESSAGE, "Check the logs for more details on the specific error"]
@@ -235781,7 +235786,9 @@ function displayWorkspaceDiagnosticsSummaryInternal(diagnosticsEntries, vulns) {
235781
235786
  failedToInstallPackages.add(packageInstallMatch[1]);
235782
235787
  }
235783
235788
  let category = "general";
235784
- if (errorMessageLower.includes("install") || errorMessageLower.includes("npm") || errorMessageLower.includes("pip") || errorMessageLower.includes("dependency")) {
235789
+ if (errorMessageLower.includes(ANALYSIS_LOW_CONFIDENCE_MESSAGE.toLowerCase())) {
235790
+ category = "lowConfidence";
235791
+ } else if (errorMessageLower.includes("install") || errorMessageLower.includes("npm") || errorMessageLower.includes("pip") || errorMessageLower.includes("dependency")) {
235785
235792
  category = "install";
235786
235793
  } else if (errorMessageLower.includes("timeout") || errorMessageLower.includes("timed out")) {
235787
235794
  category = "timeout";
@@ -250895,7 +250902,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
250895
250902
  }
250896
250903
 
250897
250904
  // dist/version.js
250898
- var version3 = "14.12.152";
250905
+ var version3 = "14.12.154";
250899
250906
 
250900
250907
  // dist/cli-core.js
250901
250908
  var { mapValues, omit, partition, pickBy: pickBy2 } = import_lodash15.default;
@@ -251167,6 +251174,15 @@ var CliCore = class {
251167
251174
  }
251168
251175
  this.sendProgress("RUN_ON_SUBPROJECT", false, this.rootWorkingDirectory);
251169
251176
  }
251177
+ for (const vuln of vulnsWithResults) {
251178
+ if (vuln.codeAwareScanResult.type === "success" && vuln.codeAwareScanResult.lowConfidence === true && vuln.codeAwareScanResult.detectedOccurrences?.stacks?.length === 0) {
251179
+ vuln.codeAwareScanResult = {
251180
+ type: "analysisError",
251181
+ message: ANALYSIS_LOW_CONFIDENCE_MESSAGE
251182
+ };
251183
+ vuln.reachability = "UNKNOWN";
251184
+ }
251185
+ }
251170
251186
  displayResultsSummary(vulnsWithResults, allWorkspaceTimings);
251171
251187
  displayWorkspaceDiagnosticsSummary(allWorkspaceDiagnostics, vulnsWithResults);
251172
251188
  await this.shareLogIfAnalysisError(vulnsWithResults);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coana-tech/cli",
3
- "version": "14.12.152",
3
+ "version": "14.12.154",
4
4
  "description": "Coana CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -110825,7 +110825,7 @@ async function runJellyAnalysis(mainProjectRoot, projectRoot, jellyOptions, reac
110825
110825
  }
110826
110826
  );
110827
110827
  if (reachabilityAnalysisOptions.printLogFile)
110828
- logger.info("JS analysis log file:", await readFile8(logFile, "utf-8"));
110828
+ logger.info("JS analysis log file:", logFile);
110829
110829
  const analysisDiagnostics = JSON.parse(await readFile8(diagnosticsFile, "utf-8"));
110830
110830
  const callStacks = JSON.parse(await readFile8(callStackFile, "utf-8"));
110831
110831
  const matches = {};
@@ -110952,12 +110952,14 @@ var JSCodeAwareVulnerabilityScanner = class _JSCodeAwareVulnerabilityScanner {
110952
110952
  analysisOptionsFromHeuristic.approx = process.env.JELLY_APPROX === "true" || experiment === "JELLY_APPROX";
110953
110953
  const analysisRes = await runJellyAnalysis(this.mainProjectDir, this.projectDir, analysisOptionsFromHeuristic, this.options, timeoutInSeconds, vulnerabilities, experiment, telemetryHandler, analyzerTelemetryHandler);
110954
110954
  const { analysisDiagnostics: diagnostics, matches } = analysisRes;
110955
+ const lowConfidence = diagnostics.round < 2 && (diagnostics.timeout || diagnostics.aborted);
110955
110956
  return {
110956
110957
  type: "success",
110957
110958
  diagnostics,
110958
110959
  terminatedEarly: diagnostics.aborted || diagnostics.timeout || diagnostics.lowmemory,
110959
110960
  reachedDependencies: diagnostics.packages > 0,
110960
110961
  affectedPurls: analysisRes.affectedPurls,
110962
+ lowConfidence,
110961
110963
  computeDetectedOccurrences: ({ url: url2 }) => this.transformSourceLocations(matches[url2] ?? { analysisLevel: "function-level", affectedPackages: [], stacks: [] })
110962
110964
  };
110963
110965
  } catch (e) {
@@ -113078,7 +113080,8 @@ function augmentVulnsWithDetectedOccurrences(vulns, codeAwareScanner, heuristic,
113078
113080
  terminatedEarly: result.terminatedEarly,
113079
113081
  heuristicName: heuristic.name,
113080
113082
  affectedPurls: result.affectedPurls,
113081
- detectedOccurrences
113083
+ detectedOccurrences,
113084
+ lowConfidence: result.lowConfidence
113082
113085
  };
113083
113086
  }
113084
113087
  logger.debug("Done augmenting with detected occurrences");
@@ -108,6 +108,10 @@ var require_worklist = __commonJS({
108
108
  }
109
109
  first;
110
110
  last;
111
+ _size = 0;
112
+ get size() {
113
+ return this._size;
114
+ }
111
115
  enqueue(v) {
112
116
  const n = new Node(v);
113
117
  if (this.last)
@@ -115,6 +119,7 @@ var require_worklist = __commonJS({
115
119
  else
116
120
  this.first = n;
117
121
  this.last = n;
122
+ this._size++;
118
123
  }
119
124
  *[Symbol.iterator]() {
120
125
  while (this.first) {
@@ -122,6 +127,7 @@ var require_worklist = __commonJS({
122
127
  this.first = c.next;
123
128
  if (this.first === void 0)
124
129
  this.last = void 0;
130
+ this._size--;
125
131
  yield c.value;
126
132
  }
127
133
  }
@@ -2639,6 +2645,9 @@ var require_solver = __commonJS({
2639
2645
  unprocessedListeners2: f.postponedListenerCalls2.length,
2640
2646
  packages: a.packageInfos.size,
2641
2647
  modules: a.moduleInfos.size,
2648
+ modulesFull: d.modulesFull,
2649
+ pendingFiles: a.pendingFiles.size,
2650
+ pendingModulesFull: a.pendingModulesFull.size,
2642
2651
  functions: a.functionInfos.size,
2643
2652
  uniqueTokens: a.canonicalTokens.size
2644
2653
  });