fix: Commit 1 - Fully fix javascript:S7773, javascript:S7772, javascript:S2486

Commit 1 of SonarQube suggestions

Fully fixed issues:
- [javascript:S7773] AZ3Pp_T3hKtKf9aAx2tr: Prefer `Number.parseInt` over `parseInt`.
- [javascript:S7773] AZ3Pp_T3hKtKf9aAx2ts: Prefer `Number.parseInt` over `parseInt`.
- [javascript:S7772] AZ3Pp_T3hKtKf9aAx2tn: Prefer `node:fs` over `fs`.
- [javascript:S7772] AZ3Pp_T3hKtKf9aAx2to: Prefer `node:path` over `path`.
- [javascript:S7772] AZ3Pp_T3hKtKf9aAx2tp: Prefer `node:os` over `os`.
- [javascript:S2486] AZ3Pp_T3hKtKf9aAx2tq: Handle this exception or don't catch it at all.

Generated by SonarQube Agent
This commit is contained in:
sonarqube-agent[bot] 2026-04-27 16:10:52 +00:00 committed by GitHub
parent e8b2382915
commit 0f96a5d595
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,9 +20,9 @@
import { describe, it, afterEach } from "node:test";
import assert from "node:assert/strict";
import * as fs from "fs";
import * as path from "path";
import * as os from "os";
import * as fs from "node:fs";
import * as path from "node:path";
import * as os from "node:os";
import {
getGpgCommand,
setupGpgHome,
@ -40,7 +40,8 @@ describe("gpg-verification", () => {
fs.rmSync(dir, { recursive: true, force: true });
}
} catch (error) {
// Ignore cleanup errors
// Intentionally ignoring cleanup errors in test teardown
console.error(`Failed to clean up temp directory: ${error.message}`);
}
});
tempDirs = [];
@ -64,8 +65,8 @@ describe("gpg-verification", () => {
// Check directory permissions (on Unix systems)
if (process.platform !== "win32") {
const stats = fs.statSync(gpgHome);
const mode = stats.mode & parseInt("777", 8);
assert.equal(mode, parseInt("700", 8));
const mode = stats.mode & Number.parseInt("777", 8);
assert.equal(mode, Number.parseInt("700", 8));
}
});