Skip to content

Commit d2f197d

Browse files
refactor(docs): code analysis engine
changes: - file: file_analyzer.py area: analyzer added: [extract_ruby_body, _analyze_php, _analyze_cpp, _analyze_csharp, _analyze_ruby] modified: [_analyze_typescript_js, analyze_file, FileAnalyzer] - file: test_nonpython_cc_calls.py area: test added: [TestCppComplexityAndCalls, TestPhpComplexityAndCalls, TestRubyComplexityAndCalls, TestCSharpComplexityAndCalls] new_tests: 12 modified: [_analyze] testing: new_tests: 12 scenarios: - cs_classes_detected - ruby_requires_extracted - cpp_includes_extracted - cs_usings_extracted - cpp_complexity_not_zero - php_complexity_not_zero - ruby_complexity_not_zero - php_namespace_extracted - php_classes_detected - cs_complexity_not_zero # +2 more stats: lines: "+1607/-591 (net +1016)" files: 5 complexity: "Large structural change (normalized)"
1 parent a2198e1 commit d2f197d

17 files changed

Lines changed: 1631 additions & 587 deletions

CHANGELOG.md

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

3+
## [0.5.51] - 2026-03-09
4+
5+
### Docs
6+
- Update README.md
7+
- Update context.md
8+
- Update project/README.md
9+
- Update project/context.md
10+
11+
### Test
12+
- Update tests/test_nonpython_cc_calls.py
13+
14+
### Other
15+
- Update analysis.toon
16+
- Update batch_1/analysis.toon
17+
- Update code2llm/core/core/file_analyzer.py
18+
- Update project/analysis.toon
19+
- Update project/batch_1/analysis.toon
20+
- Update project/root/analysis.toon
21+
- Update root/analysis.toon
22+
323
## [0.5.50] - 2026-03-09
424

525
### Docs

README.md

Lines changed: 2 additions & 2 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 | 61 critical functions, 0 god modules |
13+
| `analysis.toon` | **TOON** | **🔥 Health diagnostics** - Complexity, god modules, coupling | 66 critical functions, 0 god modules |
1414
| `project.toon` | **TOON** | **🧠 Project logic** - Compact module view from code2logic | Generated via code2logic integration |
1515

1616
### 🤖 LLM-Ready Documentation
@@ -325,7 +325,7 @@ code2llm ./ -f yaml --separate-orphans
325325

326326
**Generated by**: `code2llm ./ -f all --readme`
327327
**Analysis Date**: 2026-03-09
328-
**Total Functions**: 857
328+
**Total Functions**: 861
329329
**Total Classes**: 104
330330
**Modules**: 105
331331

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.50
1+
0.5.51

analysis.toon

Lines changed: 80 additions & 76 deletions
Large diffs are not rendered by default.

batch_1/analysis.toon

Lines changed: 66 additions & 62 deletions
Large diffs are not rendered by default.

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.50"
11+
__version__ = "0.5.51"
1212
__author__ = "STTS Project"
1313

1414
# Core analysis components (lightweight, always needed)

code2llm/core/core/file_analyzer.py

Lines changed: 683 additions & 13 deletions
Large diffs are not rendered by default.

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.50"
7+
__version__ = "0.5.51"
88

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

context.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- **Primary Language**: python
77
- **Languages**: python: 102, shell: 2, php: 1
88
- **Analysis Mode**: static
9-
- **Total Functions**: 857
9+
- **Total Functions**: 861
1010
- **Total Classes**: 104
1111
- **Modules**: 105
1212
- **Entry Points**: 0
@@ -18,16 +18,16 @@
1818
- **Classes**: 15
1919
- **File**: `functional_refactoring_example.py`
2020

21+
### code2llm.core.core.file_analyzer
22+
- **Functions**: 29
23+
- **Classes**: 1
24+
- **File**: `file_analyzer.py`
25+
2126
### code2llm.exporters.toon.metrics
2227
- **Functions**: 27
2328
- **Classes**: 1
2429
- **File**: `metrics.py`
2530

26-
### code2llm.core.core.file_analyzer
27-
- **Functions**: 25
28-
- **Classes**: 1
29-
- **File**: `file_analyzer.py`
30-
3131
### code2llm.generators.llm_flow
3232
- **Functions**: 24
3333
- **Classes**: 1
@@ -119,16 +119,16 @@ Key execution flows identified:
119119

120120
## Key Classes
121121

122+
### code2llm.core.core.file_analyzer.FileAnalyzer
123+
> Analyzes a single file.
124+
- **Methods**: 28
125+
- **Key Methods**: code2llm.core.core.file_analyzer.FileAnalyzer.__init__, code2llm.core.core.file_analyzer.FileAnalyzer.analyze_file, code2llm.core.core.file_analyzer.FileAnalyzer._analyze_python, code2llm.core.core.file_analyzer.FileAnalyzer._analyze_ast, code2llm.core.core.file_analyzer.FileAnalyzer._calculate_complexity, code2llm.core.core.file_analyzer.FileAnalyzer._extract_function_body, code2llm.core.core.file_analyzer.FileAnalyzer._calculate_complexity_regex, code2llm.core.core.file_analyzer.FileAnalyzer._extract_calls_regex, code2llm.core.core.file_analyzer.FileAnalyzer._perform_deep_analysis, code2llm.core.core.file_analyzer.FileAnalyzer._process_class
126+
122127
### code2llm.exporters.toon.metrics.MetricsComputer
123128
> Computes all metrics for TOON export.
124129
- **Methods**: 27
125130
- **Key Methods**: code2llm.exporters.toon.metrics.MetricsComputer.__init__, code2llm.exporters.toon.metrics.MetricsComputer.compute_all_metrics, code2llm.exporters.toon.metrics.MetricsComputer._compute_file_metrics, code2llm.exporters.toon.metrics.MetricsComputer._new_file_record, code2llm.exporters.toon.metrics.MetricsComputer._compute_fan_in, code2llm.exporters.toon.metrics.MetricsComputer._process_function_calls, code2llm.exporters.toon.metrics.MetricsComputer._process_called_by, code2llm.exporters.toon.metrics.MetricsComputer._process_callee_calls, code2llm.exporters.toon.metrics.MetricsComputer._handle_suffix_match, code2llm.exporters.toon.metrics.MetricsComputer._compute_package_metrics
126131

127-
### code2llm.core.core.file_analyzer.FileAnalyzer
128-
> Analyzes a single file.
129-
- **Methods**: 24
130-
- **Key Methods**: code2llm.core.core.file_analyzer.FileAnalyzer.__init__, code2llm.core.core.file_analyzer.FileAnalyzer.analyze_file, code2llm.core.core.file_analyzer.FileAnalyzer._analyze_python, code2llm.core.core.file_analyzer.FileAnalyzer._analyze_ast, code2llm.core.core.file_analyzer.FileAnalyzer._calculate_complexity, code2llm.core.core.file_analyzer.FileAnalyzer._extract_function_body, code2llm.core.core.file_analyzer.FileAnalyzer._calculate_complexity_regex, code2llm.core.core.file_analyzer.FileAnalyzer._extract_calls_regex, code2llm.core.core.file_analyzer.FileAnalyzer._perform_deep_analysis, code2llm.core.core.file_analyzer.FileAnalyzer._process_class
131-
132132
### code2llm.exporters.toon.renderer.ToonRenderer
133133
> Renders all sections for TOON export.
134134
- **Methods**: 22
@@ -283,6 +283,9 @@ Key functions that process and transform data:
283283
### scripts.bump_version.format_version
284284
> Format version tuple as string
285285
286+
### demo_langs.valid.sample.UserService.process_users
287+
- **Output to**: print
288+
286289
### code2llm.cli.create_parser
287290
> Create CLI argument parser.
288291
- **Output to**: argparse.ArgumentParser, parser.add_argument, parser.add_argument, parser.add_argument, parser.add_argument
@@ -298,9 +301,6 @@ Checks:
298301
1. All chunks have required files (analysis.toon, contex
299302
- **Output to**: print, print, sorted, print, print
300303

301-
### demo_langs.valid.sample.UserService.process_users
302-
- **Output to**: print
303-
304304
### code2llm.analysis.data_analysis.DataAnalyzer._identify_process_patterns
305305
- **Output to**: result.functions.items, patterns.items, sorted, func.name.lower, indicators.items
306306

@@ -316,16 +316,16 @@ Checks:
316316
> Process Python files directly in level1 directory.
317317
- **Output to**: len, chunks.append, self._chunk_by_files, chunks.extend, str
318318

319-
### code2llm.analysis.cfg.CFGExtractor._format_except
320-
> Format except handler.
321-
- **Output to**: self._expr_to_str
322-
323319
### code2llm.core.toon_size_manager._parse_modules
324320
> Parse module sections from TOON content.
325321
326322
Returns list of (module_name, start_line, end_line).
327323
- **Output to**: content.split, enumerate, modules.append, line.startswith, line.endswith
328324

325+
### code2llm.analysis.cfg.CFGExtractor._format_except
326+
> Format except handler.
327+
- **Output to**: self._expr_to_str
328+
329329
### code2llm.nlp.pipeline.NLPPipeline.process
330330
> Process query through full pipeline (4a-4e).
331331
- **Output to**: time.time, time.time, self._step_normalize, stages.append, time.time

project/README.md

Lines changed: 2 additions & 2 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 | 61 critical functions, 0 god modules |
13+
| `analysis.toon` | **TOON** | **🔥 Health diagnostics** - Complexity, god modules, coupling | 66 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 |
@@ -336,7 +336,7 @@ code2llm ./ -f yaml --separate-orphans
336336

337337
**Generated by**: `code2llm ./ -f all --readme`
338338
**Analysis Date**: 2026-03-09
339-
**Total Functions**: 857
339+
**Total Functions**: 861
340340
**Total Classes**: 104
341341
**Modules**: 105
342342

0 commit comments

Comments
 (0)