@codacy/tools-cppcheck-2 0.1.0 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.js +36 -12
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -3420,16 +3420,16 @@ function ruleMetadata(errorId) {
3420
3420
  const patternId = `${TOOL_ID}_${errorId}`;
3421
3421
  return PATTERN_META.get(patternId) ?? { category: "ErrorProne", severity: "Info" };
3422
3422
  }
3423
- var BLACKLISTED_ERROR_IDS = /* @__PURE__ */ new Set([
3424
- "unusedFunction",
3425
- "missingIncludeSystem",
3426
- "checkersReport"
3427
- ]);
3423
+ var BLACKLISTED_ERROR_IDS = /* @__PURE__ */ new Set(["unusedFunction", "missingIncludeSystem", "checkersReport"]);
3428
3424
  var BINARY = "cppcheck";
3429
3425
  var xmlParser = new import_fast_xml_parser.XMLParser({
3430
3426
  ignoreAttributes: false,
3431
3427
  attributeNamePrefix: "@_",
3432
- isArray: (name) => name === "error" || name === "location"
3428
+ isArray: (name) => name === "error" || name === "location",
3429
+ processEntities: {
3430
+ enabled: true,
3431
+ maxTotalExpansions: 1e5
3432
+ }
3433
3433
  });
3434
3434
  function getLineContent(lines, lineNumber) {
3435
3435
  return lines[lineNumber - 1] ?? "";
@@ -3507,15 +3507,31 @@ var adapter = {
3507
3507
  const codacyBin = import_path.default.join(ctx.toolInstallDir, BINARY);
3508
3508
  const codacyVersion = await getVersionFromBinary(codacyBin);
3509
3509
  if (codacyVersion) {
3510
- ctx.logger.debug("Found codacy-managed binary", { toolId: TOOL_ID, version: codacyVersion, path: codacyBin });
3511
- return { available: true, version: codacyVersion, path: codacyBin, installation: "codacy" };
3510
+ ctx.logger.debug("Found codacy-managed binary", {
3511
+ toolId: TOOL_ID,
3512
+ version: codacyVersion,
3513
+ path: codacyBin
3514
+ });
3515
+ return {
3516
+ available: true,
3517
+ version: codacyVersion,
3518
+ path: codacyBin,
3519
+ installation: "codacy"
3520
+ };
3512
3521
  }
3513
3522
  const globalVersion = await getVersionFromBinary(BINARY);
3514
3523
  if (globalVersion) {
3515
3524
  ctx.logger.debug("Found global binary", { toolId: TOOL_ID, version: globalVersion });
3516
- return { available: true, version: globalVersion, installation: "global" };
3525
+ return {
3526
+ available: true,
3527
+ version: globalVersion,
3528
+ installation: "global"
3529
+ };
3517
3530
  }
3518
- ctx.logger.debug("Binary not found", { toolId: TOOL_ID, reason: "not in PATH or Codacy install directory" });
3531
+ ctx.logger.debug("Binary not found", {
3532
+ toolId: TOOL_ID,
3533
+ reason: "not in PATH or Codacy install directory"
3534
+ });
3519
3535
  return {
3520
3536
  available: false,
3521
3537
  reason: "cppcheck binary not found in PATH or Codacy install directory",
@@ -3528,7 +3544,10 @@ var adapter = {
3528
3544
  */
3529
3545
  async install(ctx) {
3530
3546
  ctx.logger.info("Starting install", { toolId: TOOL_ID });
3531
- ctx.logger.info("Install not supported \u2014 cppcheck must be installed via system package manager", { toolId: TOOL_ID });
3547
+ ctx.logger.info(
3548
+ "Install not supported \u2014 cppcheck must be installed via system package manager",
3549
+ { toolId: TOOL_ID }
3550
+ );
3532
3551
  return {
3533
3552
  success: false,
3534
3553
  error: {
@@ -3685,7 +3704,12 @@ var adapter = {
3685
3704
  });
3686
3705
  }
3687
3706
  const durationMs = Date.now() - startMs;
3688
- ctx.logger.info("Analysis complete", { toolId: TOOL_ID, issueCount: issues.length, errorCount: errors.length, durationMs });
3707
+ ctx.logger.info("Analysis complete", {
3708
+ toolId: TOOL_ID,
3709
+ issueCount: issues.length,
3710
+ errorCount: errors.length,
3711
+ durationMs
3712
+ });
3689
3713
  return buildResult(startedAt, /* @__PURE__ */ new Date(), issues, errors, ctx.targetFiles.length);
3690
3714
  }
3691
3715
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/tools-cppcheck-2",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Cppcheck adapter — CLI-mode C/C++ static analyzer",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,8 +8,8 @@
8
8
  "dist"
9
9
  ],
10
10
  "dependencies": {
11
- "fast-xml-parser": "^4.5.0",
12
- "@codacy/tooling": "0.1.0"
11
+ "fast-xml-parser": "^5.5.6",
12
+ "@codacy/tooling": "0.2.0"
13
13
  },
14
14
  "license": "MIT",
15
15
  "author": "Codacy <support@codacy.com> (https://www.codacy.com)",