@@ -42,7 +42,7 @@ vallm validates code proposals through a **four-tier pipeline** — from millise
4242
4343| Language | Syntax | Imports | Complexity | Security |
4444| ----------| --------| ---------| ------------| ----------|
45- | Python | ✅ AST + tree-sitter | ✅ Full resolution | ✅ radon + lizard | ✅ bandit + patterns |
45+ | Python | ✅ AST + tree-sitter | ✅ Full resolution (22 methods) | ✅ radon + lizard | ✅ bandit + patterns |
4646| JavaScript | ✅ tree-sitter | ✅ Node.js builtins | ✅ lizard | ✅ XSS, eval patterns |
4747| TypeScript | ✅ tree-sitter | ✅ Node.js builtins | ✅ lizard | ✅ XSS, eval patterns |
4848| Go | ✅ tree-sitter | ✅ stdlib + modules | ✅ lizard | ✅ SQL injection, exec |
@@ -73,6 +73,20 @@ pip install vallm[graph] # NetworkX graph analysis
7373
7474## Quick Start
7575
76+ ### Validate Entire Project
77+
78+ ``` bash
79+ # Install with LLM support
80+ pip install vallm[llm]
81+
82+ # Setup Ollama (for semantic review)
83+ ollama pull qwen2.5-coder:7b
84+ ollama serve
85+
86+ # Validate entire project recursively
87+ vallm batch . --recursive --semantic --model qwen2.5-coder:7b
88+ ```
89+
7690### Python API
7791
7892``` python
@@ -94,22 +108,23 @@ print(f"Verdict: {result.verdict.value}") # pass / review / fail
94108print (f " Score: { result.weighted_score:.2f } " )
95109```
96110
97- ### CLI
111+ ### CLI Commands Reference
98112
99113``` bash
100- # Validate a file
101- vallm validate --file mycode.py
102-
103- # Quick syntax check
104- vallm check mycode.py
114+ # Batch validation (best for entire projects)
115+ vallm batch . --recursive --semantic --model qwen2.5-coder:7b
116+ vallm batch src/ --recursive --include " *.py,*.js" --exclude " */test/*"
117+ vallm batch . --recursive --format json --fail-fast
105118
106- # With LLM semantic review (requires Ollama)
119+ # Single file validation
107120vallm validate --file mycode.py --semantic --model qwen2.5-coder:7b
121+ vallm validate --file app.js --security
108122
109- # JSON output
110- vallm validate --file mycode.py --format json
123+ # Quick syntax check only
124+ vallm check mycode.py
125+ vallm check src/main.go
111126
112- # Show config and available validators
127+ # Configuration and info
113128vallm info
114129```
115130
@@ -253,31 +268,67 @@ cd examples && ./run.sh
253268| ` 05_llm_semantic_review/ ` | Ollama Qwen 2.5 Coder 7B LLM-as-judge review |
254269| ` 06_multilang_validation/ ` | JavaScript and C validation via tree-sitter |
255270| ` 07_multi_language/ ` | ** Comprehensive multi-language support** — 8+ languages with auto-detection |
271+ | ` 08_code2llm_integration/ ` | Project analysis integration with code2llm |
272+ | ` 09_code2logic_integration/ ` | Call graph analysis with code2logic |
273+ | ` 10_mcp_ollama_demo/ ` | MCP (Model Context Protocol) demo with Ollama |
274+ | ` 11_claude_code_autonomous/ ` | Autonomous refactoring with Claude Code |
275+ | ` 12_ollama_simple_demo/ ` | Simplified Ollama integration example |
256276
257277## Architecture
258278
259279```
260280src/vallm/
261- ├── cli.py # Typer CLI: validate, check, info, batch
262- ├── config.py # pydantic-settings (VALLM_* env vars)
263- ├── hookspecs.py # pluggy hook specifications
264- ├── scoring.py # Weighted scoring + verdict engine
281+ ├── cli.py # Typer CLI (401L, 8 methods, CC=42) - needs refactoring
282+ ├── config.py # pydantic-settings (VALLM_* env vars)
283+ ├── hookspecs.py # pluggy hook specifications
284+ ├── scoring.py # Weighted scoring + verdict engine (CC=18 validate function)
265285├── core/
266- │ ├── languages.py # Language enum, auto-detection, 30+ languages
267- │ ├── proposal.py # Proposal model
268- │ ├── ast_compare.py # tree-sitter + Python AST similarity
269- │ ├── graph_builder.py # Import/call graph construction
270- │ └── graph_diff.py # Before/after graph comparison
286+ │ ├── languages.py # Language enum, auto-detection, 30+ languages
287+ │ ├── proposal.py # Proposal model
288+ │ ├── ast_compare.py # tree-sitter + Python AST similarity
289+ │ ├── graph_builder.py # Import/call graph construction
290+ │ └── graph_diff.py # Before/after graph comparison
271291├── validators/
272- │ ├── syntax.py # Tier 1: ast.parse + tree-sitter (multi-lang)
273- │ ├── imports.py # Tier 1: module resolution (Python)
274- │ ├── complexity.py # Tier 2: radon (Python) + lizard (16+ langs)
275- │ ├── security.py # Tier 2: patterns + bandit
276- │ └── semantic.py # Tier 3: LLM-as-judge
292+ │ ├── syntax.py # Tier 1: ast.parse + tree-sitter (multi-lang)
293+ │ ├── imports.py # Tier 1: module resolution (653L, 22 methods) - god module
294+ │ ├── complexity.py # Tier 2: radon (Python) + lizard (16+ langs)
295+ │ ├── security.py # Tier 2: patterns + bandit
296+ │ └── semantic.py # Tier 3: LLM-as-judge
277297└── sandbox/
278- └── runner.py # subprocess / Docker execution
298+ └── runner.py # subprocess / Docker execution
279299```
280300
301+ ### Code Health Metrics
302+
303+ Current codebase metrics (generated by code2llm analysis):
304+
305+ | Metric | Current | Target |
306+ | --------| ---------| --------|
307+ | Avg Cyclomatic Complexity (CC̄) | 3.5 | ≤2.4 |
308+ | Max CC | 42 | ≤20 |
309+ | God Modules (>500L) | 2 | 0 |
310+ | High CC Functions (≥15) | 2 | ≤1 |
311+ | Total Functions | 91 | - |
312+ | Total Classes | 19 | - |
313+
314+ ** Critical Functions (CC ≥ 10)** :
315+
316+ | Function | Location | CC | Fan-out | Priority |
317+ | ----------| ----------| -----| ---------| ----------|
318+ | ` batch ` | ` cli.py:140 ` | ** 42** | 34 | 🔴 Split immediately |
319+ | ` validate ` | ` scoring.py:122 ` | ** 18** | 20 | 🟡 Refactor |
320+ | ` _check_lizard ` | ` complexity.py ` | 12 | 9 | 🟡 Simplify |
321+ | ` _parse_response ` | ` semantic.py ` | 12 | 17 | 🟡 Simplify |
322+
323+ ** God Modules** :
324+ - ` src/vallm/validators/imports.py ` (653L, 22 methods, 22 dependent imports)
325+ - ` src/vallm/cli.py ` (401L, 8 methods, CC=42)
326+
327+ See ` project/ ` directory for full analysis files:
328+ - ` analysis.toon ` - Health diagnostics and complexity metrics
329+ - ` evolution.toon ` - Refactoring queue with ranked priorities
330+ - ` context.md ` - Architecture summary for LLM assistance
331+
281332## Roadmap
282333
283334** v0.2 — Completeness**
@@ -286,13 +337,16 @@ src/vallm/
286337- TOML config loading (` vallm.toml ` , ` [tool.vallm] ` )
287338- Pre-commit hook integration
288339- GitHub Actions CI/CD
340+ - ** Refactoring: Split ` batch ` function (CC=42)**
341+ - ** Refactoring: Modularize ` imports.py ` god module**
289342
290343** v0.3 — Depth**
291344- AST edit distance via apted/zss
292345- CodeBERTScore embedding similarity
293346- NetworkX cycle detection and centrality in graph analysis
294347- RegressionValidator (Tier 4) with pytest-json-report
295348- TypeCheckValidator (mypy/pyright)
349+ - ** Refactoring: Extract output formatters**
296350
297351** v0.4 — Intelligence**
298352- ` --fix ` auto-repair mode (LLM-based retry loop)
0 commit comments