MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / _walk

Function _walk

codewiki/mcp/tools/analysis.py:247–271  ·  view source on GitHub ↗
(tree: Dict, parents: list[str] | None = None)

Source from the content-addressed store, hash-verified

245 if not d.startswith(".") and d not in ("node_modules", "__pycache__", "venv", ".venv")
246 ]
247 for filename in filenames:
248 filepath = Path(dirpath) / filename
249 if filepath.suffix.lower() not in source_extensions:
250 continue
251 try:
252 if filepath.stat().st_mtime > prev_time:
253 rel_path = filepath.relative_to(repo_path).as_posix()
254 changed.append(rel_path)
255 except OSError:
256 continue
257
258 return {"changed_files": changed, "method": "mtime"}
259
260
261def _find_affected_modules(
262 module_tree: dict[str, Any],
263 changed_files: list[str],
264) -> tuple[set, set]:
265 """Map changed files to affected modules using module_tree.json.
266
267 Uses substring matching (same as the CLI ``_invalidate_affected_modules``).
268 Returns (affected_modules, cascade_parent_modules).
269 """
270 affected: set[str] = set()
271 cascade: set[str] = set()
272
273 def _walk(tree: dict, parents: list[str] | None = None):
274 if parents is None:

Callers 1

_find_affected_modulesFunction · 0.85

Calls 3

getMethod · 0.80
addMethod · 0.80
updateMethod · 0.80

Tested by

no test coverage detected