Skip to content

Commit d516ddd

Browse files
refactor(docs): code analysis engine
changes: - file: cli_commands.py area: cli modified: [validate_chunked_output] - file: refactoring.py area: core modified: [RefactoringAnalyzer, _map_dead_code_to_items] stats: lines: "+83/-71 (net +12)" files: 7 complexity: "Stable complexity"
1 parent e35371a commit d516ddd

18 files changed

Lines changed: 110 additions & 75 deletions

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
## [Unreleased]
22

3+
## [0.5.104] - 2026-04-09
4+
5+
### Docs
6+
- Update README.md
7+
- Update context.md
8+
- Update project/context.md
9+
10+
### Other
11+
- Update analysis.toon.yaml
12+
- Update batch_1/analysis.toon.yaml
13+
- Update code2llm/cli_commands.py
14+
- Update code2llm/core/refactoring.py
15+
- Update project.sh
16+
- Update project/analysis.toon.yaml
17+
- Update project/batch_1/analysis.toon.yaml
18+
- Update project/root/analysis.toon.yaml
19+
- Update root/analysis.toon.yaml
20+
321
## [0.5.103] - 2026-03-31
422

523
### Docs

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# code2llm - Generated Analysis Files
22

3+
## AI Cost Tracking
4+
5+
![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-yellow) ![AI Model](https://img.shields.io/badge/AI%20Model-openrouter%2Fqwen%2Fqwen3-coder-next-lightgrey)
6+
7+
This project uses AI-generated code. Total cost: **$7.5000** with **153** AI commits.
8+
9+
Generated on 2026-04-09 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/models/openrouter/qwen/qwen3-coder-next)
10+
11+
---
12+
13+
14+
315
This directory contains the complete analysis of your project generated by `code2llm`. Each file serves a specific purpose for understanding, refactoring, and documenting your codebase.
416

517
## 📁 Generated Files Overview
@@ -328,3 +340,8 @@ code2llm ./ -f yaml --separate-orphans
328340
**Modules**: 131
329341

330342
For more information about code2llm, visit: https://github.com/tom-sapletta/code2llm
343+
344+
345+
## License
346+
347+
Licensed under Apache-2.0.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.103
1+
0.5.104

analysis.toon.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# code2llm | 122f 22674L | python:118,shell:4 | 2026-04-09
1+
# code2llm | 122f 22674L | python:117,shell:4,java:1 | 2026-04-09
22
# CC̄=4.4 | critical:2/1011 | dups:0 | cycles:0
33

44
HEALTH[2]:
@@ -152,7 +152,7 @@ LAYERS:
152152
│ sample.rs 47L 1C 4m CC=2 ←0
153153
│ sample.go 46L 0C 4m CC=3 ←0
154154
│ sample.php 44L 1C 1m CC=1 ←0
155-
│ sample 40L 2C 5m CC=3 ←0
155+
│ sample 40L 1C 5m CC=3 ←0
156156
│ sample.ts 26L 1C 1m CC=1 ←0
157157
158158
── zero ──

batch_1/analysis.toon.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# code2llm | 122f 22674L | python:115,shell:2 | 2026-04-09
1+
# code2llm | 122f 22674L | python:114,shell:2,java:1 | 2026-04-09
22
# CC̄=4.4 | critical:2/1011 | dups:0 | cycles:0
33

44
HEALTH[2]:
@@ -9,9 +9,9 @@ REFACTOR[1]:
99
1. split 2 high-CC methods (CC>15)
1010

1111
PIPELINES[672]:
12-
[1] Src [main]: main → run_analysis
12+
[1] Src [read_readme]: read_readme
1313
PURITY: 100% pure
14-
[2] Src [read_readme]: read_readme
14+
[2] Src [main]: main → run_analysis
1515
PURITY: 100% pure
1616
[3] Src [__init__]: __init__
1717
PURITY: 100% pure
@@ -148,11 +148,11 @@ LAYERS:
148148
│ server 110L 0C 3m CC=4 ←0
149149
150150
demo_langs/ CC̄=1.5 ←in:0 →out:0
151-
│ sample.java 47L 2C 7m CC=3 ←2
152151
│ sample.rs 47L 1C 4m CC=2 ←0
152+
│ sample.java 47L 2C 7m CC=3 ←2
153153
│ sample.go 46L 0C 4m CC=3 ←0
154154
│ sample.php 44L 1C 1m CC=1 ←0
155-
│ sample 40L 2C 5m CC=3 ←0
155+
│ sample 40L 1C 5m CC=3 ←0
156156
│ sample.ts 26L 1C 1m CC=1 ←0
157157
158158
── zero ──

code2llm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
and entity resolution with multilingual support.
99
"""
1010

11-
__version__ = "0.5.103"
11+
__version__ = "0.5.104"
1212
__author__ = "STTS Project"
1313

1414
# Core analysis components (lightweight, always needed)

code2llm/cli_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def validate_chunked_output(output_dir: Path, args) -> bool:
128128
print(f"✗ No chunk directories found in: {output_dir}", file=sys.stderr)
129129
return False
130130

131-
required_files = ['analysis.toon', 'context.md', 'evolution.toon.yaml']
131+
required_files = ['analysis.toon.yaml', 'context.md', 'evolution.toon.yaml']
132132
issues = []
133133
valid_chunks = []
134134

code2llm/core/refactoring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _map_dead_code_to_items(self, dead_code, result: AnalysisResult) -> None:
185185

186186
# Check classes
187187
for class_name, class_info in result.classes.items():
188-
if Path(class_info.file).resolve() == Path(item.filename).resolve() and class_info.line == item.lineno:
188+
if Path(class_info.file).resolve() == item_path and class_info.line == item_lineno:
189189
class_info.reachability = "unreachable" # (if we add reachability to ClassInfo too)
190190

191191
def _mark_reachable_items(self, result: AnalysisResult) -> None:

code2llm/nlp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
with multilingual support and fuzzy matching.
55
"""
66

7-
__version__ = "0.5.103"
7+
__version__ = "0.5.104"
88

99
from .pipeline import NLPPipeline
1010
from .normalization import QueryNormalizer

context.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- **Project**: .
66
- **Primary Language**: python
7-
- **Languages**: python: 127, shell: 4
7+
- **Languages**: python: 126, shell: 4, java: 1
88
- **Analysis Mode**: static
99
- **Total Functions**: 1011
1010
- **Total Classes**: 111
@@ -175,17 +175,17 @@ Builds a call graph as a DiGraph, fin
175175
- **Methods**: 17
176176
- **Key Methods**: code2llm.analysis.pipeline_detector.PipelineDetector.__init__, code2llm.analysis.pipeline_detector.PipelineDetector.detect, code2llm.analysis.pipeline_detector.PipelineDetector._build_graph, code2llm.analysis.pipeline_detector.PipelineDetector._find_pipeline_paths, code2llm.analysis.pipeline_detector.PipelineDetector._longest_path_from, code2llm.analysis.pipeline_detector.PipelineDetector._longest_path_in_dag, code2llm.analysis.pipeline_detector.PipelineDetector._build_pipelines, code2llm.analysis.pipeline_detector.PipelineDetector._build_stages, code2llm.analysis.pipeline_detector.PipelineDetector._classify_domain, code2llm.analysis.pipeline_detector.PipelineDetector._derive_pipeline_name
177177

178-
### code2llm.core.file_analyzer.FileAnalyzer
179-
> Analyzes a single file.
180-
- **Methods**: 17
181-
- **Key Methods**: code2llm.core.file_analyzer.FileAnalyzer.__init__, code2llm.core.file_analyzer.FileAnalyzer._route_to_language_analyzer, code2llm.core.file_analyzer.FileAnalyzer.analyze_file, code2llm.core.file_analyzer.FileAnalyzer._analyze_python, code2llm.core.file_analyzer.FileAnalyzer._analyze_ast, code2llm.core.file_analyzer.FileAnalyzer._calculate_complexity, code2llm.core.file_analyzer.FileAnalyzer._perform_deep_analysis, code2llm.core.file_analyzer.FileAnalyzer._process_class, code2llm.core.file_analyzer.FileAnalyzer._process_function, code2llm.core.file_analyzer.FileAnalyzer._build_cfg
182-
183178
### code2llm.analysis.cfg.CFGExtractor
184179
> Extract Control Flow Graph from AST.
185180
- **Methods**: 17
186181
- **Key Methods**: code2llm.analysis.cfg.CFGExtractor.__init__, code2llm.analysis.cfg.CFGExtractor.extract, code2llm.analysis.cfg.CFGExtractor.new_node, code2llm.analysis.cfg.CFGExtractor.connect, code2llm.analysis.cfg.CFGExtractor.visit_FunctionDef, code2llm.analysis.cfg.CFGExtractor.visit_AsyncFunctionDef, code2llm.analysis.cfg.CFGExtractor.visit_If, code2llm.analysis.cfg.CFGExtractor.visit_For, code2llm.analysis.cfg.CFGExtractor.visit_While, code2llm.analysis.cfg.CFGExtractor.visit_Try
187182
- **Inherits**: ast.NodeVisitor
188183

184+
### code2llm.core.file_analyzer.FileAnalyzer
185+
> Analyzes a single file.
186+
- **Methods**: 17
187+
- **Key Methods**: code2llm.core.file_analyzer.FileAnalyzer.__init__, code2llm.core.file_analyzer.FileAnalyzer._route_to_language_analyzer, code2llm.core.file_analyzer.FileAnalyzer.analyze_file, code2llm.core.file_analyzer.FileAnalyzer._analyze_python, code2llm.core.file_analyzer.FileAnalyzer._analyze_ast, code2llm.core.file_analyzer.FileAnalyzer._calculate_complexity, code2llm.core.file_analyzer.FileAnalyzer._perform_deep_analysis, code2llm.core.file_analyzer.FileAnalyzer._process_class, code2llm.core.file_analyzer.FileAnalyzer._process_function, code2llm.core.file_analyzer.FileAnalyzer._build_cfg
188+
189189
### code2llm.exporters.evolution_exporter.EvolutionExporter
190190
> Export evolution.toon.yaml — prioritized refactoring queue.
191191
- **Methods**: 17
@@ -286,6 +286,10 @@ Key functions that process and transform data:
286286
> Process a user request with complex logic.
287287
- **Output to**: request.action.startswith, examples.streaming-analyzer.sample_project.utils.validate_input, print, self.auth.authenticate, print
288288

289+
### benchmarks.format_evaluator.evaluate_format
290+
> Oceń pojedynczy format względem ground truth.
291+
- **Output to**: FormatScore, benchmarks.format_evaluator._detect_problems, sum, benchmarks.format_evaluator._detect_pipelines, sum
292+
289293
### scripts.benchmark_badges.parse_evolution_metrics
290294
> Extract metrics from evolution.toon content.
291295
- **Output to**: toon_content.splitlines, re.search, line.strip, line.startswith, m.group
@@ -309,10 +313,6 @@ Key functions that process and transform data:
309313
### scripts.bump_version.format_version
310314
> Format version tuple as string
311315
312-
### benchmarks.format_evaluator.evaluate_format
313-
> Oceń pojedynczy format względem ground truth.
314-
- **Output to**: FormatScore, benchmarks.format_evaluator._detect_problems, sum, benchmarks.format_evaluator._detect_pipelines, sum
315-
316316
### code2llm.cli_parser.create_parser
317317
> Create CLI argument parser.
318318
- **Output to**: argparse.ArgumentParser, parser.add_argument, parser.add_argument, parser.add_argument, parser.add_argument
@@ -328,13 +328,13 @@ Checks:
328328
1. All chunks have required files (analysis.toon, contex
329329
- **Output to**: print, print, sorted, print, print
330330

331-
### code2llm.analysis.data_analysis.DataAnalyzer._identify_process_patterns
332-
- **Output to**: result.functions.items, patterns.items, sorted, func.name.lower, indicators.items
333-
334331
### benchmarks.benchmark_format_quality._generate_format_outputs
335332
> Generate all format outputs and evaluate them.
336333
- **Output to**: format_configs.items, __import__, getattr, exporter_cls, time.time
337334

335+
### code2llm.analysis.data_analysis.DataAnalyzer._identify_process_patterns
336+
- **Output to**: result.functions.items, patterns.items, sorted, func.name.lower, indicators.items
337+
338338
### code2llm.core.ast_registry.ASTRegistry.invalidate
339339
> Remove cached AST and source for *filepath* (e.g. after file write).
340340
- **Output to**: self._trees.pop, self._sources.pop

0 commit comments

Comments
 (0)