Socket
Socket
Sign inDemoInstall

@appland/scanner

Package Overview
Dependencies
326
Maintainers
4
Versions
118
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.82.0 to 1.82.1

51

built/cli/scan/watchScan.js

@@ -53,2 +53,3 @@ "use strict";

const util_1 = require("util");
const console_1 = require("console");
const debug = (0, util_1.debuglog)('scanner:watch');

@@ -180,21 +181,33 @@ function isDir(targetPath) {

(0, assert_1.default)(this.config, `config should always be loaded before appmapWatcher triggers a scan`);
const appmapFile = [path_1.default.dirname(mtimePath), 'appmap.json'].join('.');
const reportFile = mtimePath.replace(/mtime$/, 'appmap-findings.json');
const [appmapStats, reportStats] = yield Promise.all([appmapFile, reportFile].map((f) => (0, promises_1.stat)(f).catch(() => null)));
if (!appmapStats)
return;
const cut = (str) => str.substring(str.length - 8);
debug('%s: %s, findings: %s, config: %s', appmapFile, cut(appmapStats.mtimeMs.toFixed(3)), reportStats && cut(reportStats.mtimeMs.toFixed(3)), cut(this.config.timestampMs.toFixed(3)));
if (reportStats &&
reportStats.mtimeMs > appmapStats.mtimeMs - 1000 &&
reportStats.mtimeMs > this.config.timestampMs - 1000)
return; // report is up to date
const startTime = Date.now();
const scanner = yield (0, scanner_1.default)(true, this.config, [appmapFile]);
const rawScanResults = yield scanner.scan();
const elapsed = Date.now() - startTime;
this.scanEventEmitter.emit('scan', { scanResults: rawScanResults, elapsed });
// Always report the raw data
yield (0, promises_1.writeFile)(reportFile, (0, formatReport_1.formatReport)(rawScanResults));
this.processing.delete(mtimePath);
const perform = () => __awaiter(this, void 0, void 0, function* () {
const appmapFile = [path_1.default.dirname(mtimePath), 'appmap.json'].join('.');
const reportFile = mtimePath.replace(/mtime$/, 'appmap-findings.json');
const [appmapStats, reportStats] = yield Promise.all([appmapFile, reportFile].map((f) => (0, promises_1.stat)(f).catch(() => null)));
if (!appmapStats) {
(0, console_1.warn)(`[scan] AppMap file ${appmapFile} does not exist`);
return;
}
const cut = (str) => str.substring(str.length - 8);
(0, assert_1.default)(this.config);
debug('%s: %s, findings: %s, config: %s', appmapFile, cut(appmapStats.mtimeMs.toFixed(3)), reportStats && cut(reportStats.mtimeMs.toFixed(3)), cut(this.config.timestampMs.toFixed(3)));
if (reportStats &&
reportStats.mtimeMs > appmapStats.mtimeMs - 1000 &&
reportStats.mtimeMs > this.config.timestampMs - 1000) {
(0, console_1.warn)(`[scan] Report file ${reportFile} is already up to date`);
return;
}
const startTime = Date.now();
const scanner = yield (0, scanner_1.default)(true, this.config, [appmapFile]);
const rawScanResults = yield scanner.scan();
const elapsed = Date.now() - startTime;
this.scanEventEmitter.emit('scan', { scanResults: rawScanResults, elapsed });
// Always report the raw data
yield (0, promises_1.writeFile)(reportFile, (0, formatReport_1.formatReport)(rawScanResults));
});
try {
yield perform();
}
finally {
this.processing.delete(mtimePath);
}
});

@@ -201,0 +214,0 @@ }

@@ -274,3 +274,3 @@ "use strict";

try {
const commandProcess = (0, child_process_1.spawn)('git', ['status'], {
const commandProcess = (0, child_process_1.spawn)('git', ['status', '--porcelain'], {
shell: true,

@@ -277,0 +277,0 @@ cwd: cwd === null || cwd === void 0 ? void 0 : cwd.toString(),

{
"name": "@appland/scanner",
"version": "1.82.0",
"version": "1.82.1",
"description": "Analyze AppMaps for code flaws",

@@ -5,0 +5,0 @@ "bin": "built/cli.js",

Sorry, the diff of this file is too big to display

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