Description
When passing a path containing ~ (e.g., "~/workspace/project") to CLDK.analysis(), the tilde is not expanded. This causes the analyzer to interpret ~ as a literal directory name relative to the current working directory, leading to:
- Silent empty results (empty
PyApplication with no classes/methods)
- Creation of spurious directories like
./~/workspace/.../.codeanalyzer/
Reproduction
from cldk import CLDK
pa = CLDK("python").analysis("~/workspace/codellm-devkit/codeanalyzer-python")
pa.get_application_view() # Returns empty PyApplication
Root Cause
Path("~/...") does not expand ~ — it must be explicitly expanded via .expanduser(). The SDK was passing the path directly to Path() without expansion in:
cldk/core.py — analysis() method
cldk/analysis/python/codeanalyzer/codeanalyzer.py — PyCodeanalyzer.__init__()
Expected Behavior
- Tilde should be expanded to the user's home directory
- Invalid/non-existent paths should raise a clear error, not return empty results
Fix
Call .expanduser().resolve() on path inputs and validate the directory exists before proceeding with analysis.
Fixed in: #153
Description
When passing a path containing
~(e.g.,"~/workspace/project") toCLDK.analysis(), the tilde is not expanded. This causes the analyzer to interpret~as a literal directory name relative to the current working directory, leading to:PyApplicationwith no classes/methods)./~/workspace/.../.codeanalyzer/Reproduction
Root Cause
Path("~/...")does not expand~— it must be explicitly expanded via.expanduser(). The SDK was passing the path directly toPath()without expansion in:cldk/core.py—analysis()methodcldk/analysis/python/codeanalyzer/codeanalyzer.py—PyCodeanalyzer.__init__()Expected Behavior
Fix
Call
.expanduser().resolve()on path inputs and validate the directory exists before proceeding with analysis.Fixed in: #153