@safetnsr/vet 1.10.0 → 1.10.1

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.
@@ -175,13 +175,15 @@ function findDuplicates(allFuncs) {
175
175
  fixHint: 'extract shared logic into a single function',
176
176
  });
177
177
  }
178
- // Similarity check for non-exact matches
178
+ // Similarity check for non-exact matches (capped to avoid O(n²) explosion on large repos)
179
179
  const singles = allFuncs.filter(fn => {
180
180
  const g = groups.get(fn.hash);
181
181
  return !g || g.length < 2;
182
182
  });
183
- for (let i = 0; i < singles.length; i++) {
184
- for (let j = i + 1; j < singles.length; j++) {
183
+ // Cap at 500 functions for similarity — O(n²) with levenshtein is too expensive above that
184
+ const singlesCapped = singles.length > 500 ? singles.slice(0, 500) : singles;
185
+ for (let i = 0; i < singlesCapped.length; i++) {
186
+ for (let j = i + 1; j < singlesCapped.length; j++) {
185
187
  const a = singles[i];
186
188
  const b = singles[j];
187
189
  // Skip very short normalized bodies
package/dist/util.js CHANGED
@@ -41,7 +41,7 @@ export function readFile(path) {
41
41
  export function fileExists(path) {
42
42
  return existsSync(path);
43
43
  }
44
- export function walkFiles(dir, ignore = [], maxFiles) {
44
+ export function walkFiles(dir, ignore = [], maxFiles = 2000) {
45
45
  const results = [];
46
46
  const defaultIgnore = ['node_modules', '.git', 'dist', 'build', '.next', 'coverage', 'vendor', '__pycache__', '.venv', 'venv'];
47
47
  const allIgnore = [...defaultIgnore, ...ignore];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@safetnsr/vet",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "vet your AI-generated code — one command, one score card, one letter grade",
5
5
  "type": "module",
6
6
  "bin": {