technical-debt-radar 1.6.4 → 1.6.5

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 +13 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15332,6 +15332,13 @@ var require_perf_pattern_detector = __commonJS({
15332
15332
  entity = extractTypeORMEntity(node);
15333
15333
  if (!entity)
15334
15334
  entity = extractSequelizeEntity(node);
15335
+ if (methodName === "find") {
15336
+ const typeormEntity = extractTypeORMEntity(node);
15337
+ const seqEntity = extractSequelizeEntity(node);
15338
+ if (!typeormEntity && !seqEntity)
15339
+ return;
15340
+ entity = typeormEntity ?? seqEntity;
15341
+ }
15335
15342
  const vol = entity ? resolveVolume(entity, policy) : void 0;
15336
15343
  const fn = getEnclosingFn(node, fns);
15337
15344
  pushIfNotNull(violations, makeViolation(shared_1.PERFORMANCE_RULES.UNBOUNDED_FIND_MANY, filePath, node.getStartLineNumber(), `${methodName}() without take/limit${vol ? ` on '${entity}' (${vol.size} volume)` : ""} \u2014 may fetch entire table`, policy, vol, fn?.name, "Add take: N or limit to bound the result set"));
@@ -15437,6 +15444,8 @@ var require_perf_pattern_detector = __commonJS({
15437
15444
  entity = extractTypeORMEntity(node);
15438
15445
  if (!entity)
15439
15446
  entity = extractSequelizeEntity(node);
15447
+ if (methodName === "find")
15448
+ return;
15440
15449
  const vol = entity ? resolveVolume(entity, policy) : void 0;
15441
15450
  const hasCursorPagination = argsContainKey(node, "cursor");
15442
15451
  const hasTakePagination = argsContainKey(node, "take") || argsContainKey(node, "limit");
@@ -16670,9 +16679,11 @@ var require_reliability_detector = __commonJS({
16670
16679
  continue;
16671
16680
  let unhandledAwaitCount = 0;
16672
16681
  let totalAwaitCount = 0;
16673
- fn.node.forEachDescendant((child) => {
16674
- if (child !== fn.node && (ts_morph_1.Node.isFunctionDeclaration(child) || ts_morph_1.Node.isMethodDeclaration(child) || ts_morph_1.Node.isArrowFunction(child) || ts_morph_1.Node.isFunctionExpression(child)))
16682
+ fn.node.forEachDescendant((child, traversal) => {
16683
+ if (child !== fn.node && (ts_morph_1.Node.isFunctionDeclaration(child) || ts_morph_1.Node.isMethodDeclaration(child) || ts_morph_1.Node.isArrowFunction(child) || ts_morph_1.Node.isFunctionExpression(child))) {
16684
+ traversal.skip();
16675
16685
  return;
16686
+ }
16676
16687
  if (!ts_morph_1.Node.isAwaitExpression(child))
16677
16688
  return;
16678
16689
  totalAwaitCount++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "technical-debt-radar",
3
- "version": "1.6.4",
3
+ "version": "1.6.5",
4
4
  "description": "Stop Node.js production crashes before merge. 47 detection patterns across 5 categories.",
5
5
  "bin": {
6
6
  "radar": "dist/index.js",