fix: exclude node_modules from dependency analysis and add progress logging#46
Merged
bdqnghi merged 1 commit intoFSoft-AI4Code:mainfrom Mar 16, 2026
Conversation
…ogging node_modules was missing from DEFAULT_IGNORE_PATTERNS, causing the dependency analyzer to parse all files in node_modules (225k+ files instead of ~600). Also added per-file progress logging and timeout protection to improve observability during long analysis runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When running
codewiki generateon a JavaScript/TypeScript project, the dependency analyzer processes all files innode_modules, resulting in 225,098 files being analyzed instead of the expected ~630 project source files.The CLI correctly detects 623 TypeScript + 8 JavaScript files:
But the backend analyzer receives 225,098 files because
node_modulesis not excluded:This causes the analysis to hang indefinitely with no progress feedback.
Root Cause
node_modulesis missing fromDEFAULT_IGNORE_PATTERNSinpatterns.py. The CLI file detection (validation.py) has its own hardcoded exclusion set that correctly filtersnode_modules, but the backend dependency analyzer (repo_analyzer.py) relies onDEFAULT_IGNORE_PATTERNSwhich lacks it.Solution
1. Add missing ignore patterns (
patterns.py)Added to
DEFAULT_IGNORE_PATTERNS:node_modules/node_modules/— the primary fix.next/— Next.js build output.nuxt/— Nuxt.js build output.turbo/— Turborepo cache2. Add progress logging and timeout protection (
call_graph_analyzer.py)Before:
After:
Test plan
codewiki generate --verboseon a TypeScript project withnode_modulesnow analyzes only source files (~631 instead of 225,098)