technical-debt-radar 1.6.2 → 1.6.3
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/dist/index.js +17 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16219,7 +16219,23 @@ var require_reliability_detector = __commonJS({
|
|
|
16219
16219
|
detectUnboundedParallelCalls(sourceFile, file.path, fns, policy, violations);
|
|
16220
16220
|
project.removeSourceFile(sourceFile);
|
|
16221
16221
|
}
|
|
16222
|
-
return applyExceptions(violations, policy);
|
|
16222
|
+
return applyExceptions(deduplicateOverlapping(violations), policy);
|
|
16223
|
+
}
|
|
16224
|
+
function deduplicateOverlapping(violations) {
|
|
16225
|
+
const hasMissingTryCatch = /* @__PURE__ */ new Set();
|
|
16226
|
+
for (const v of violations) {
|
|
16227
|
+
if (v.ruleId === shared_1.RELIABILITY_RULES.MISSING_TRY_CATCH) {
|
|
16228
|
+
hasMissingTryCatch.add(`${v.file}:${v.function ?? ""}`);
|
|
16229
|
+
}
|
|
16230
|
+
}
|
|
16231
|
+
return violations.filter((v) => {
|
|
16232
|
+
if (v.ruleId === shared_1.RELIABILITY_RULES.UNHANDLED_PROMISE_REJECTION) {
|
|
16233
|
+
const key = `${v.file}:${v.function ?? ""}`;
|
|
16234
|
+
if (hasMissingTryCatch.has(key))
|
|
16235
|
+
return false;
|
|
16236
|
+
}
|
|
16237
|
+
return true;
|
|
16238
|
+
});
|
|
16223
16239
|
}
|
|
16224
16240
|
function collectFunctions(sourceFile, filePath) {
|
|
16225
16241
|
const scopes = [];
|