Skip to content

Commit bed68ec

Browse files
refactor(docs): code analysis engine
changes: - file: optimized_batch_processor.py area: cli removed: [create_optimized_batch_processor, __init__, _validate_single_file, _handle_no_files_found, _process_files_sequential, _process_files_parallel, +8 more] - file: output_formatters.py area: cli modified: [output_batch_rich, output_batch_json] - file: scoring.py area: core modified: [ValidationResult] stats: lines: "+1696/-1767 (net -71)" files: 23 complexity: "Large structural change (normalized)"
1 parent 9d06422 commit bed68ec

28 files changed

+1711
-1760
lines changed

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -124,37 +124,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
124124
- **Tree-sitter for all** β€” syntax validation for 165+ languages
125125
- **Example 07** β€” comprehensive multi-language demo with 8 languages
126126

127-
## [0.1.11] - 2026-03-23
127+
## [0.1.12] - 2026-03-23
128128

129129
### Docs
130130
- Update CHANGELOG.md
131131
- Update README.md
132-
- Update TODO.md
133132
- Update docs/README.md
134133
- Update project/README.md
135134
- Update project/context.md
136135

137-
### Test
138-
- Update tests/conftest.py
139-
- Update tests/test_cli_e2e.py
140-
- Update tests/test_installation.py
141-
- Update tests/test_performance.py
142-
- Update tests/test_plugins.py
143-
- Update tests/test_sandbox.py
144-
- Update tests/test_semantic_validation.py
145-
146136
### Other
147-
- Update .gitignore
148-
- Update .pre-commit-hooks.yaml
149-
- Update Makefile
150-
- Update examples/01_basic_validation/.vallm/basic_validation_summary.json
151-
- Update examples/01_basic_validation/main.py
152-
- Update examples/02_ast_comparison/main.py
153-
- Update examples/03_security_check/main.py
154-
- Update examples/04_graph_analysis/main.py
155-
- Update examples/05_llm_semantic_review/main.py
156-
- Update examples/05_llm_semantic_review/main_template.py
157-
- ... and 38 more files
137+
- Update project/analysis.toon
138+
- Update project/calls.mmd
139+
- Update project/calls.png
140+
- Update project/compact_flow.mmd
141+
- Update project/compact_flow.png
142+
- Update project/dashboard.html
143+
- Update project/duplication.toon
144+
- Update project/evolution.toon
145+
- Update project/flow.mmd
146+
- Update project/flow.png
147+
- ... and 6 more files
158148

159149
## [0.1.11] - 2026-03-23
160150

@@ -195,12 +185,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
195185
| Code Duplication | 504 lines | 35 lines | βœ… **93% eliminated** |
196186
| CLI Module Size | 850 lines | 9 lines | βœ… **99% reduction** |
197187

188+
### πŸ› οΈ New Validators
189+
- **LogicalErrorValidator** β€” Tier 1: pyflakes integration for detecting logical errors and unused imports
190+
- **LintValidator** β€” Tier 1: ruff integration for style and lint checks with JSON output
191+
- **SemanticCache** β€” Caching layer for semantic validation results to improve performance
192+
198193
### πŸ› οΈ New Shared Utilities
199194
- `examples/utils/validation_runner.py` - Standard validation patterns
200195
- `examples/utils/extract_code_from_response.py` - LLM response parsing
201196
- `examples/12_ollama_simple_demo/utils/` - Demo-specific utilities
202197
- Enhanced `BaseImportValidator` - Common validation logic
203198

199+
### πŸ§ͺ New Test Suites
200+
- **test_sandbox.py** β€” Comprehensive sandbox runner tests (8 test cases)
201+
- **test_plugins.py** β€” Plugin system tests for pluggy integration (8 test cases)
202+
- **test_performance.py** β€” Performance and load testing (12 test cases)
203+
- Enhanced test coverage in existing test files
204+
204205
### πŸ“š Documentation Updates
205206
- **README.md** - Updated architecture section with new modular structure
206207
- **TODO.md** - Marked major refactoring tasks as completed

β€ŽREADME.mdβ€Ž

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,28 @@ vallm check src/main.go
136136
vallm info
137137
```
138138

139+
### Generate Validation Summary File
140+
141+
```bash
142+
# JSON summary for entire project
143+
vallm batch . --recursive --format json > validation-summary.json
144+
145+
# YAML summary for src/ directory
146+
vallm batch src/ --recursive --format yaml > validation-summary.yaml
147+
148+
# TOON format (compact) for CI/CD
149+
vallm batch . --recursive --format toon > validation-summary.toon
150+
151+
# Text format with security checks
152+
vallm batch . --recursive --format text --security > validation-report.txt
153+
154+
# Full validation with semantic review - save to file
155+
vallm batch . --recursive --semantic --model qwen2.5-coder:7b --format json > full-validation.json
156+
157+
# Tee output to both console and file
158+
vallm batch . --recursive --format json | tee validation-summary.json
159+
```
160+
139161
### Batch Command Options
140162

141163
| Option | Short | Description |

β€ŽVERSIONβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.11
1+
0.1.12

β€Ždocs/README.mdβ€Ž

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- code2docs:start --># vallm
22

3-
![version](https://img.shields.io/badge/version-0.1.0-blue) ![python](https://img.shields.io/badge/python-%3E%3D3.10-blue) ![coverage](https://img.shields.io/badge/coverage-unknown-lightgrey) ![functions](https://img.shields.io/badge/functions-329-green)
4-
> **329** functions | **41** classes | **82** files | CCΜ„ = 3.6
3+
![version](https://img.shields.io/badge/version-0.1.0-blue) ![python](https://img.shields.io/badge/python-%3E%3D3.10-blue) ![coverage](https://img.shields.io/badge/coverage-unknown-lightgrey) ![functions](https://img.shields.io/badge/functions-322-green)
4+
> **322** functions | **40** classes | **82** files | CCΜ„ = 3.4
55
66
> Auto-generated project documentation from source code analysis.
77
@@ -151,7 +151,7 @@ Content outside the markers is preserved when regenerating. Enable this with `sy
151151

152152
```
153153
vallm/
154-
β”œβ”€β”€ bump_version β”œβ”€β”€ hookspecs β”œβ”€β”€ vallm/ β”œβ”€β”€ __main__ β”œβ”€β”€ cli/ β”œβ”€β”€ base β”œβ”€β”€ complexity β”œβ”€β”€ logical β”œβ”€β”€ validators/ β”œβ”€β”€ semantic_cache β”œβ”€β”€ security β”œβ”€β”€ syntax β”œβ”€β”€ lint β”œβ”€β”€ imports/ β”œβ”€β”€ semantic β”œβ”€β”€ graph_diff β”œβ”€β”€ core/ β”œβ”€β”€ ast_compare β”œβ”€β”€ proposal β”œβ”€β”€ gitignore β”œβ”€β”€ scoring β”œβ”€β”€ output_formatters β”œβ”€β”€ languages β”œβ”€β”€ batch_processor β”œβ”€β”€ runner β”œβ”€β”€ sandbox/ β”œβ”€β”€ base β”œβ”€β”€ javascript_imports β”œβ”€β”€ python_imports β”œβ”€β”€ go_imports β”œβ”€β”€ c_imports β”œβ”€β”€ rust_imports β”œβ”€β”€ utils β”œβ”€β”€ wrapper β”œβ”€β”€ factory β”œβ”€β”€ java_imports β”œβ”€β”€ main_template β”œβ”€β”€ main β”œβ”€β”€ main β”œβ”€β”€ claude_autonomous_demo β”œβ”€β”€ main β”œβ”€β”€ ollama_simple_demo β”œβ”€β”€ iteration_1 β”œβ”€β”€ best_version β”œβ”€β”€ iteration_2 β”œβ”€β”€ main β”œβ”€β”€ main β”œβ”€β”€ main β”œβ”€β”€ main_template β”œβ”€β”€ main β”œβ”€β”€ main β”œβ”€β”€ refactored_output β”œβ”€β”€ optimized_batch_processor β”œβ”€β”€ utils/ β”œβ”€β”€ extraction β”œβ”€β”€ save_analysis_data β”œβ”€β”€ extract_code_from_response β”œβ”€β”€ validation_runner β”œβ”€β”€ mcp_demo β”œβ”€β”€ logging_utils β”œβ”€β”€ order_processor β”œβ”€β”€ main β”œβ”€β”€ process_user_input β”œβ”€β”€ simple_buggy β”œβ”€β”€ utils/ β”œβ”€β”€ load_config β”œβ”€β”€ main β”œβ”€β”€ calculate_total β”œβ”€β”€ save_dataβ”œβ”€β”€ project β”œβ”€β”€ run β”œβ”€β”€ run β”œβ”€β”€ docker-entrypoint β”œβ”€β”€ run β”œβ”€β”€ docker-entrypoint β”œβ”€β”€ run β”œβ”€β”€ docker-entrypoint β”œβ”€β”€ data_processor β”œβ”€β”€ config β”œβ”€β”€ command_handlers```
154+
β”œβ”€β”€ examples/ β”œβ”€β”€ cli/ β”œβ”€β”€ hookspecs β”œβ”€β”€ vallm/ β”œβ”€β”€ __main__ β”œβ”€β”€ bump_version β”œβ”€β”€ base β”œβ”€β”€ complexity β”œβ”€β”€ logical β”œβ”€β”€ validators/ β”œβ”€β”€ semantic_cache β”œβ”€β”€ security β”œβ”€β”€ syntax β”œβ”€β”€ lint β”œβ”€β”€ imports/ β”œβ”€β”€ semantic β”œβ”€β”€ graph_diff β”œβ”€β”€ core/ β”œβ”€β”€ ast_compare β”œβ”€β”€ proposal β”œβ”€β”€ gitignore β”œβ”€β”€ scoring β”œβ”€β”€ output_formatters β”œβ”€β”€ batch_processor β”œβ”€β”€ languages β”œβ”€β”€ sandbox/ β”œβ”€β”€ base β”œβ”€β”€ javascript_imports β”œβ”€β”€ python_imports β”œβ”€β”€ go_imports β”œβ”€β”€ c_imports β”œβ”€β”€ rust_imports β”œβ”€β”€ utils β”œβ”€β”€ wrapper β”œβ”€β”€ factory β”œβ”€β”€ java_imports β”œβ”€β”€ main_template β”œβ”€β”€ main β”œβ”€β”€ main β”œβ”€β”€ claude_autonomous_demo β”œβ”€β”€ main β”œβ”€β”€ ollama_simple_demo β”œβ”€β”€ iteration_1 β”œβ”€β”€ best_version β”œβ”€β”€ iteration_2 β”œβ”€β”€ main β”œβ”€β”€ main β”œβ”€β”€ main β”œβ”€β”€ main_template β”œβ”€β”€ main β”œβ”€β”€ main β”œβ”€β”€ refactored_output β”œβ”€β”€ runner β”œβ”€β”€ utils/ β”œβ”€β”€ mcp_demo β”œβ”€β”€ extraction β”œβ”€β”€ save_analysis_data β”œβ”€β”€ extract_code_from_response β”œβ”€β”€ logging_utils β”œβ”€β”€ validation_runner β”œβ”€β”€ order_processor β”œβ”€β”€ main β”œβ”€β”€ process_user_input β”œβ”€β”€ load_config β”œβ”€β”€ simple_buggy β”œβ”€β”€ utils/ β”œβ”€β”€ calculate_total β”œβ”€β”€ main β”œβ”€β”€ save_dataβ”œβ”€β”€ project β”œβ”€β”€ run β”œβ”€β”€ run β”œβ”€β”€ docker-entrypoint β”œβ”€β”€ run β”œβ”€β”€ docker-entrypoint β”œβ”€β”€ run β”œβ”€β”€ docker-entrypoint β”œβ”€β”€ data_processor β”œβ”€β”€ config β”œβ”€β”€ command_handlers```
155155
156156
## API Overview
157157
@@ -174,10 +174,8 @@ vallm/
174174
- **`Issue`** β€” A single issue found during validation.
175175
- **`ValidationResult`** β€” Result from a single validator.
176176
- **`PipelineResult`** β€” Aggregated result from all validators.
177-
- **`Language`** β€” Supported programming languages with their tree-sitter identifiers.
178177
- **`BatchProcessor`** β€” Handles batch validation of multiple files.
179-
- **`ExecutionResult`** β€” Result of sandboxed code execution.
180-
- **`SandboxRunner`** β€” Unified interface for running code in a sandbox.
178+
- **`Language`** β€” Supported programming languages with their tree-sitter identifiers.
181179
- **`BaseImportValidator`** β€” Base class for all import validators.
182180
- **`JavaScriptImportValidator`** β€” JavaScript/TypeScript import validator.
183181
- **`PythonImportValidator`** β€” Python-specific import validator.
@@ -190,7 +188,8 @@ vallm/
190188
- **`Colors`** β€” β€”
191189
- **`Colors`** β€” β€”
192190
- **`OrderManager`** β€” Class with single responsibility - adheres to SOLID principles.
193-
- **`OptimizedBatchProcessor`** β€” Optimized batch processor with parallel processing capabilities.
191+
- **`ExecutionResult`** β€” Result of sandboxed code execution.
192+
- **`SandboxRunner`** β€” Unified interface for running code in a sandbox.
194193
- **`Colors`** β€” β€”
195194
- **`Colors`** β€” ANSI color codes for terminal output.
196195
- **`OrderManager`** β€” Class with mixed responsibilities - SOLID violation.
@@ -298,16 +297,10 @@ vallm/
298297
- `save_data(data, filename)` β€” Save data safely using json.dump.
299298
- `process_order(data)` β€” Process order data with proper error handling and validation.
300299
- `main()` β€” β€”
301-
- `create_optimized_batch_processor(console)` β€” Create an optimized batch processor instance.
302300
- `save_analysis_data(example_name, result_data)` β€” Save analysis data to .vallm folder.
303301
- `run_validation_examples(example_name, good_code, bad_code, complex_code)` β€” Run standard validation examples (good, bad, complex code).
304302
- `validate_code_example(name, code, settings, all_results)` β€” Validate a code example and store results.
305303
- `print_summary(all_results)` β€” Print summary of all validation results.
306-
- `extract_code_from_response(response, language)` β€” Extract code from LLM response.
307-
- `extract_json_from_response(response)` β€” Extract JSON object from LLM response.
308-
- `save_analysis_data(example_name, result_data)` β€” Save analysis data to JSON file.
309-
- `extract_code_from_response(response)` β€” Extract Python code from LLM response.
310-
- `run_validation_examples(example_name, good_code, bad_code, complex_code)` β€” Run standard validation examples (good, bad, complex code).
311304
- `log_section(title)` β€” Print a section header.
312305
- `log_step(step, description)` β€” Print a step.
313306
- `log_code(label, code, max_lines)` β€” Log code with label.
@@ -317,10 +310,15 @@ vallm/
317310
- `generate_refactoring_prompt(code, analysis)` β€” Generate prompt for LLM to refactor code.
318311
- `run_mcp_workflow(code_path, max_iterations)` β€” Run the complete MCP workflow.
319312
- `main()` β€” Main entry point.
313+
- `extract_code_from_response(response, language)` β€” Extract code from LLM response.
314+
- `extract_json_from_response(response)` β€” Extract JSON object from LLM response.
315+
- `save_analysis_data(example_name, result_data)` β€” Save analysis data to JSON file.
316+
- `extract_code_from_response(response)` β€” Extract Python code from LLM response.
320317
- `log_section(title)` β€” Print a section header.
321318
- `log_step(step, description)` β€” Print a step indicator.
322319
- `log_code(label, code, max_lines)` β€” Log code with label and truncation.
323320
- `log_result(status, message)` β€” Log a result with appropriate color.
321+
- `run_validation_examples(example_name, good_code, bad_code, complex_code)` β€” Run standard validation examples (good, bad, complex code).
324322
- `process_order(data)` β€” Process order data - has multiple issues.
325323
- `load_config()` β€” Load config - security issue with eval.
326324
- `save_data(data, filename)` β€” Save data - uses pickle without validation.
@@ -335,16 +333,16 @@ vallm/
335333
- `generate_report(code2llm_result, vallm_result, output_path)` β€” Generate combined analysis report.
336334
- `main()` β€” Main example function.
337335
- `process_user_input(user_input)` β€” Process user input with standard logic.
336+
- `load_config()` β€” Load configuration with default values.
338337
- `process_user_input(user_input)` β€” Process user input with security issues.
339338
- `load_config()` β€” Load configuration with eval.
340339
- `save_data(data, filename)` β€” Save data without validation.
341340
- `calculate_total(items)` β€” Calculate total with no error handling.
342341
- `duplicate_function()` β€” Another duplicate function.
343342
- `unused_function()` β€” This function is never used.
344343
- `main()` β€” Main function with problems.
345-
- `load_config()` β€” Load configuration with default values.
346-
- `run_demo_main()` β€” Run the standard demo main function pattern.
347344
- `calculate_total(items)` β€” Calculate total price from items list.
345+
- `run_demo_main()` β€” Run the standard demo main function pattern.
348346
- `save_data(data, filename)` β€” Save data to JSON file.
349347
- `run_example()` β€” β€”
350348
- `print_section()` β€” β€”
@@ -369,6 +367,7 @@ vallm/
369367
370368
## Project Structure
371369
370+
πŸ“¦ `examples`
372371
πŸ“„ `examples.01_basic_validation.main` (1 functions)
373372
πŸ“„ `examples.02_ast_comparison.main` (1 functions)
374373
πŸ“„ `examples.03_security_check.main` (1 functions)
@@ -416,7 +415,6 @@ vallm/
416415
πŸ“¦ `src.vallm.cli`
417416
πŸ“„ `src.vallm.cli.batch_processor` (12 functions, 1 classes)
418417
πŸ“„ `src.vallm.cli.command_handlers` (11 functions)
419-
πŸ“„ `src.vallm.cli.optimized_batch_processor` (13 functions, 1 classes)
420418
πŸ“„ `src.vallm.cli.output_formatters` (13 functions)
421419
πŸ“„ `src.vallm.config` (1 functions, 1 classes)
422420
πŸ“¦ `src.vallm.core`
@@ -438,8 +436,8 @@ vallm/
438436
πŸ“„ `src.vallm.validators.imports.factory` (3 functions, 1 classes)
439437
πŸ“„ `src.vallm.validators.imports.go_imports` (5 functions, 1 classes)
440438
πŸ“„ `src.vallm.validators.imports.java_imports` (5 functions, 1 classes)
441-
πŸ“„ `src.vallm.validators.imports.javascript_imports` (4 functions, 1 classes)
442-
πŸ“„ `src.vallm.validators.imports.python_imports` (3 functions, 1 classes)
439+
πŸ“„ `src.vallm.validators.imports.javascript_imports` (7 functions, 1 classes)
440+
πŸ“„ `src.vallm.validators.imports.python_imports` (6 functions, 1 classes)
443441
πŸ“„ `src.vallm.validators.imports.rust_imports` (5 functions, 1 classes)
444442
πŸ“„ `src.vallm.validators.imports.utils` (2 functions)
445443
πŸ“„ `src.vallm.validators.imports.wrapper` (1 functions, 1 classes)

β€Žproject/README.mdβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ When you run `code2llm ./ -f all`, the following files are created:
1010

1111
| File | Format | Purpose | Key Insights |
1212
|------|--------|---------|--------------|
13-
| `analysis.toon` | **TOON** | **πŸ”₯ Health diagnostics** - Complexity, god modules, coupling | 6 critical functions, 0 god modules |
13+
| `analysis.toon` | **TOON** | **πŸ”₯ Health diagnostics** - Complexity, god modules, coupling | 9 critical functions, 0 god modules |
1414
| `evolution.toon` | **TOON** | **πŸ“‹ Refactoring queue** - Prioritized improvements | 0 refactoring actions needed |
1515
| `flow.toon` | **TOON** | **πŸ”„ Data flow analysis** - Pipelines, contracts, types | Data dependencies and side effects |
1616
| `map.toon` | **TOON** | **πŸ—ΊοΈ Structural map** - Modules, imports, signatures | Project architecture overview |
@@ -338,8 +338,8 @@ code2llm ./ -f yaml --separate-orphans
338338

339339
**Generated by**: `code2llm ./ -f all --readme`
340340
**Analysis Date**: 2026-03-23
341-
**Total Functions**: 12041
342-
**Total Classes**: 3032
343-
**Modules**: 1414
341+
**Total Functions**: 12079
342+
**Total Classes**: 3036
343+
**Modules**: 1419
344344

345345
For more information about code2llm, visit: https://github.com/tom-sapletta/code2llm

0 commit comments

Comments
Β (0)