code2llm 0.5.103__tar.gz → 0.5.104__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. {code2llm-0.5.103 → code2llm-0.5.104}/PKG-INFO +6 -9
  2. {code2llm-0.5.103 → code2llm-0.5.104}/README.md +5 -8
  3. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/__init__.py +1 -1
  4. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/cli_commands.py +1 -1
  5. code2llm-0.5.104/code2llm/core/lang/php.py +66 -0
  6. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/typescript.py +18 -20
  7. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/refactoring.py +1 -1
  8. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/nlp/__init__.py +1 -1
  9. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm.egg-info/PKG-INFO +6 -9
  10. {code2llm-0.5.103 → code2llm-0.5.104}/pyproject.toml +1 -1
  11. {code2llm-0.5.103 → code2llm-0.5.104}/setup.py +1 -1
  12. code2llm-0.5.103/code2llm/core/lang/php.py +0 -106
  13. {code2llm-0.5.103 → code2llm-0.5.104}/LICENSE +0 -0
  14. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/__main__.py +0 -0
  15. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/__init__.py +0 -0
  16. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/call_graph.py +0 -0
  17. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/cfg.py +0 -0
  18. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/coupling.py +0 -0
  19. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/data_analysis.py +0 -0
  20. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/dfg.py +0 -0
  21. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/pipeline_detector.py +0 -0
  22. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/side_effects.py +0 -0
  23. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/smells.py +0 -0
  24. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/type_inference.py +0 -0
  25. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/utils/__init__.py +0 -0
  26. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/analysis/utils/ast_helpers.py +0 -0
  27. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/api.py +0 -0
  28. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/cli.py +0 -0
  29. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/cli_analysis.py +0 -0
  30. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/cli_exports/__init__.py +0 -0
  31. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/cli_exports/code2logic.py +0 -0
  32. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/cli_exports/formats.py +0 -0
  33. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/cli_exports/orchestrator.py +0 -0
  34. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/cli_exports/prompt.py +0 -0
  35. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/cli_parser.py +0 -0
  36. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/__init__.py +0 -0
  37. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/analyzer.py +0 -0
  38. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/ast_registry.py +0 -0
  39. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/config.py +0 -0
  40. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/export_pipeline.py +0 -0
  41. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/file_analyzer.py +0 -0
  42. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/file_cache.py +0 -0
  43. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/file_filter.py +0 -0
  44. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/gitignore.py +0 -0
  45. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/incremental.py +0 -0
  46. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/__init__.py +0 -0
  47. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/base.py +0 -0
  48. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/cpp.py +0 -0
  49. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/csharp.py +0 -0
  50. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/generic.py +0 -0
  51. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/go_lang.py +0 -0
  52. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/java.py +0 -0
  53. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/ruby.py +0 -0
  54. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/rust.py +0 -0
  55. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/ts_extractors.py +0 -0
  56. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/lang/ts_parser.py +0 -0
  57. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/large_repo.py +0 -0
  58. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/models.py +0 -0
  59. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/repo_files.py +0 -0
  60. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/streaming/__init__.py +0 -0
  61. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/streaming/cache.py +0 -0
  62. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/streaming/incremental.py +0 -0
  63. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/streaming/prioritizer.py +0 -0
  64. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/streaming/scanner.py +0 -0
  65. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/streaming/strategies.py +0 -0
  66. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/streaming_analyzer.py +0 -0
  67. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/core/toon_size_manager.py +0 -0
  68. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/__init__.py +0 -0
  69. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/article_view.py +0 -0
  70. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/base.py +0 -0
  71. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/context_exporter.py +0 -0
  72. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/context_view.py +0 -0
  73. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/evolution_exporter.py +0 -0
  74. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/flow_constants.py +0 -0
  75. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/flow_exporter.py +0 -0
  76. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/flow_renderer.py +0 -0
  77. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/html_dashboard.py +0 -0
  78. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/index_generator.py +0 -0
  79. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/json_exporter.py +0 -0
  80. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/llm_exporter.py +0 -0
  81. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/map_exporter.py +0 -0
  82. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/mermaid_exporter.py +0 -0
  83. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/mermaid_flow_helpers.py +0 -0
  84. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/project_yaml_exporter.py +0 -0
  85. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/readme_exporter.py +0 -0
  86. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/report_generators.py +0 -0
  87. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/toon/__init__.py +0 -0
  88. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/toon/helpers.py +0 -0
  89. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/toon/metrics.py +0 -0
  90. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/toon/module_detail.py +0 -0
  91. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/toon/renderer.py +0 -0
  92. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/toon.py +0 -0
  93. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/toon_view.py +0 -0
  94. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/validate_project.py +0 -0
  95. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/exporters/yaml_exporter.py +0 -0
  96. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/generators/__init__.py +0 -0
  97. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/generators/llm_flow.py +0 -0
  98. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/generators/llm_task.py +0 -0
  99. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/generators/mermaid.py +0 -0
  100. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/nlp/config.py +0 -0
  101. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/nlp/entity_resolution.py +0 -0
  102. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/nlp/intent_matching.py +0 -0
  103. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/nlp/normalization.py +0 -0
  104. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/nlp/pipeline.py +0 -0
  105. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/patterns/__init__.py +0 -0
  106. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/patterns/detector.py +0 -0
  107. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/refactor/__init__.py +0 -0
  108. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm/refactor/prompt_engine.py +0 -0
  109. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm.egg-info/SOURCES.txt +0 -0
  110. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm.egg-info/dependency_links.txt +0 -0
  111. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm.egg-info/entry_points.txt +0 -0
  112. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm.egg-info/requires.txt +0 -0
  113. {code2llm-0.5.103 → code2llm-0.5.104}/code2llm.egg-info/top_level.txt +0 -0
  114. {code2llm-0.5.103 → code2llm-0.5.104}/setup.cfg +0 -0
  115. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_advanced_analysis.py +0 -0
  116. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_analyzer.py +0 -0
  117. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_deep_analysis.py +0 -0
  118. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_edge_cases.py +0 -0
  119. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_flow_exporter.py +0 -0
  120. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_format_quality.py +0 -0
  121. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_multilanguage_e2e.py +0 -0
  122. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_nlp_pipeline.py +0 -0
  123. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_nonpython_cc_calls.py +0 -0
  124. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_pipeline_detector.py +0 -0
  125. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_project_toon_export.py +0 -0
  126. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_prompt_engine.py +0 -0
  127. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_prompt_txt.py +0 -0
  128. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_refactoring_engine.py +0 -0
  129. {code2llm-0.5.103 → code2llm-0.5.104}/tests/test_toon_v2.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code2llm
3
- Version: 0.5.103
3
+ Version: 0.5.104
4
4
  Summary: High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
5
5
  Home-page: https://github.com/wronai/stts
6
6
  Author: STTS Project
@@ -63,16 +63,13 @@ Dynamic: requires-python
63
63
 
64
64
  # code2llm - Generated Analysis Files
65
65
 
66
-
67
66
  ## AI Cost Tracking
68
67
 
69
- ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.5.103-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
70
- ![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-52.2h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
68
+ ![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)
71
69
 
72
- - 🤖 **LLM usage:** $7.5000 (151 commits)
73
- - 👤 **Human dev:** ~$5223 (52.2h @ $100/h, 30min dedup)
70
+ This project uses AI-generated code. Total cost: **$7.5000** with **153** AI commits.
74
71
 
75
- Generated on 2026-03-31 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
72
+ Generated on 2026-04-09 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/models/openrouter/qwen/qwen3-coder-next)
76
73
 
77
74
  ---
78
75
 
@@ -400,8 +397,8 @@ code2llm ./ -f yaml --separate-orphans
400
397
  ---
401
398
 
402
399
  **Generated by**: `code2llm ./ -f all --readme`
403
- **Analysis Date**: 2026-03-31
404
- **Total Functions**: 1006
400
+ **Analysis Date**: 2026-04-09
401
+ **Total Functions**: 1011
405
402
  **Total Classes**: 111
406
403
  **Modules**: 131
407
404
 
@@ -1,15 +1,12 @@
1
1
  # code2llm - Generated Analysis Files
2
2
 
3
-
4
3
  ## AI Cost Tracking
5
4
 
6
- ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.5.103-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
7
- ![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-52.2h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
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)
8
6
 
9
- - 🤖 **LLM usage:** $7.5000 (151 commits)
10
- - 👤 **Human dev:** ~$5223 (52.2h @ $100/h, 30min dedup)
7
+ This project uses AI-generated code. Total cost: **$7.5000** with **153** AI commits.
11
8
 
12
- Generated on 2026-03-31 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
9
+ Generated on 2026-04-09 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/models/openrouter/qwen/qwen3-coder-next)
13
10
 
14
11
  ---
15
12
 
@@ -337,8 +334,8 @@ code2llm ./ -f yaml --separate-orphans
337
334
  ---
338
335
 
339
336
  **Generated by**: `code2llm ./ -f all --readme`
340
- **Analysis Date**: 2026-03-31
341
- **Total Functions**: 1006
337
+ **Analysis Date**: 2026-04-09
338
+ **Total Functions**: 1011
342
339
  **Total Classes**: 111
343
340
  **Modules**: 131
344
341
 
@@ -8,7 +8,7 @@ Includes NLP Processing Pipeline for query normalization, intent matching,
8
8
  and entity resolution with multilingual support.
9
9
  """
10
10
 
11
- __version__ = "0.5.103"
11
+ __version__ = "0.5.104"
12
12
  __author__ = "STTS Project"
13
13
 
14
14
  # Core analysis components (lightweight, always needed)
@@ -128,7 +128,7 @@ def validate_chunked_output(output_dir: Path, args) -> bool:
128
128
  print(f"✗ No chunk directories found in: {output_dir}", file=sys.stderr)
129
129
  return False
130
130
 
131
- required_files = ['analysis.toon', 'context.md', 'evolution.toon.yaml']
131
+ required_files = ['analysis.toon.yaml', 'context.md', 'evolution.toon.yaml']
132
132
  issues = []
133
133
  valid_chunks = []
134
134
 
@@ -0,0 +1,66 @@
1
+ import re
2
+ from typing import Dict, Optional, Tuple
3
+ from code2llm.core.models import ClassInfo, FunctionInfo, ModuleInfo
4
+ from code2llm.core.lang.base import calculate_complexity_regex, extract_calls_regex, _extract_declarations
5
+
6
+ def _parse_php_metadata(content: str, module_name: str, result: Dict) -> Tuple[Optional[str], bool]:
7
+ lines = content.split('\n')
8
+ current_namespace = None
9
+ in_php = False
10
+ for line in lines:
11
+ line = line.strip()
12
+ if line.startswith('<?php') or line.startswith('<?'):
13
+ in_php = True
14
+ continue
15
+ if line == '?>':
16
+ in_php = False
17
+ continue
18
+ if not in_php: continue
19
+ ns_match = re.match(r'^namespace\s+([\\\w]+)', line)
20
+ if ns_match:
21
+ current_namespace = ns_match.group(1)
22
+ continue
23
+ use_match = re.match(r'^use\s+([\\\w]+)', line)
24
+ if use_match:
25
+ result['module'].imports.append(use_match.group(1))
26
+ return current_namespace, in_php
27
+
28
+ def _adjust_qualified_names(result: Dict, module_name: str, namespace: str) -> None:
29
+ ns_prefix = f".{namespace}"
30
+ for key in ['classes', 'functions']:
31
+ new_items = {}
32
+ for qname, item in list(result[key].items()):
33
+ new_qname = qname.replace(f"{module_name}.", f"{module_name}{ns_prefix}.", 1)
34
+ item.qualified_name = new_qname
35
+ new_items[new_qname] = item
36
+ result[key] = new_items
37
+ result['module'].__setattr__(key, list(new_items.keys()))
38
+
39
+ def _extract_php_traits(content: str, file_path: str, module_name: str, namespace: Optional[str], result: Dict, stats: Dict) -> None:
40
+ trait_pattern = re.compile(r'^\s*trait\s+(\w+)')
41
+ for line_no, line in enumerate(content.split('\n'), 1):
42
+ tm = trait_pattern.match(line.strip())
43
+ if tm:
44
+ tname = tm.group(1)
45
+ qual = f"{module_name}.{namespace + '.' if namespace else ''}{tname}"
46
+ result['classes'][qual] = ClassInfo(name=tname, qualified_name=qual, file=file_path, line=line_no, module=module_name, bases=[], methods=[], docstring="")
47
+ result['module'].classes.append(qual)
48
+ stats['classes_found'] += 1
49
+
50
+ def analyze_php(content: str, file_path: str, module_name: str, ext: str, stats: Dict) -> Dict:
51
+ patterns = {
52
+ 'import': re.compile(r'^(?:include|require|include_once|require_once)\s*["\']([^"\']+)["\']'),
53
+ 'class': re.compile(r'(?:abstract\s+|final\s+)?class\s+(\w+)(?:\s+extends\s+(\w+))?(?:\s+implements\s+([\w,\s\\]+))?'),
54
+ 'interface': re.compile(r'interface\s+(\w+)'),
55
+ 'function': re.compile(r'(?:public\s+|private\s+|protected\s+)?(?:static\s+)?function\s+(\w+)\s*\('),
56
+ }
57
+ lang_config = {'index_files': (), 'brace_track': True, 'reserved': {'if', 'for', 'while', 'switch', 'return', 'catch', 'echo', 'print'}}
58
+ result = _extract_declarations(content, file_path, module_name, patterns, stats, lang_config)
59
+ namespace, _ = _parse_php_metadata(content, module_name, result)
60
+ if namespace:
61
+ _adjust_qualified_names(result, module_name, namespace)
62
+ _extract_php_traits(content, file_path, module_name, namespace, result, stats)
63
+ calculate_complexity_regex(content, result, lang='c_family')
64
+ extract_calls_regex(content, module_name, result)
65
+ stats['files_processed'] += 1
66
+ return result
@@ -1,18 +1,10 @@
1
- """TypeScript/JavaScript analyzer (regex-based)."""
2
-
3
1
  import re
4
2
  from typing import Dict
5
-
6
- from code2llm.core.models import ClassInfo, FunctionInfo, ModuleInfo
7
3
  from code2llm.core.lang.base import calculate_complexity_regex, extract_calls_regex, _extract_declarations
8
4
 
9
-
10
- def analyze_typescript_js(content: str, file_path: str, module_name: str,
11
- ext: str, stats: Dict) -> Dict:
12
- """Analyze TypeScript/JavaScript files using shared extraction."""
13
-
14
- # TypeScript-specific patterns
15
- patterns = {
5
+ def get_typescript_patterns() -> Dict[str, re.Pattern]:
6
+ """Returns regex patterns for TypeScript/JavaScript parsing."""
7
+ return {
16
8
  'import': re.compile(r"^\s*import\s+.*?\s+from\s+['\"]([^'\"]+)['\"]"),
17
9
  'decorator': re.compile(r"^\s*@(\w+(?:\.\w+)?)(?:\([^)]*\))?"),
18
10
  'class': re.compile(
@@ -32,24 +24,30 @@ def analyze_typescript_js(content: str, file_path: str, module_name: str,
32
24
  r"^\s*(?:(?:public|private|protected|static|readonly)\s+)*(\w+)\s*(?::\s*[^=]+)?\s*=\s*(?:<[^>]+>\s*)?(?:async\s+)?(?:\([^)]*\)|[a-zA-Z_]\w*)\s*=>"
33
25
  ),
34
26
  }
35
-
36
- # Language configuration
37
- lang_config = {
27
+
28
+ def get_typescript_lang_config() -> Dict:
29
+ """Returns language configuration for TypeScript/JavaScript."""
30
+ return {
38
31
  'index_files': ('index.ts', 'index.js', 'index.tsx', 'index.jsx'),
39
32
  'brace_track': True,
40
33
  'reserved': {'if', 'for', 'while', 'switch', 'return', 'catch', 'constructor',
41
34
  'class', 'import', 'export', 'new'},
42
35
  }
43
-
44
- # Use shared extraction
36
+
37
+ def analyze_typescript_js(content: str, file_path: str, module_name: str,
38
+ ext: str, stats: Dict) -> Dict:
39
+ """Analyze TypeScript/JavaScript files using shared extraction."""
40
+
41
+ patterns = get_typescript_patterns()
42
+ lang_config = get_typescript_lang_config()
43
+
45
44
  result = _extract_declarations(
46
45
  content, file_path, module_name,
47
46
  patterns, stats, lang_config
48
47
  )
49
-
50
- # Post-processing: calculate complexity and extract calls
48
+
51
49
  calculate_complexity_regex(content, result, lang='c_family')
52
50
  extract_calls_regex(content, module_name, result)
53
-
51
+
54
52
  stats['files_processed'] += 1
55
- return result
53
+ return result
@@ -185,7 +185,7 @@ class RefactoringAnalyzer:
185
185
 
186
186
  # Check classes
187
187
  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:
189
189
  class_info.reachability = "unreachable" # (if we add reachability to ClassInfo too)
190
190
 
191
191
  def _mark_reachable_items(self, result: AnalysisResult) -> None:
@@ -4,7 +4,7 @@ Provides query normalization, intent matching, and entity resolution
4
4
  with multilingual support and fuzzy matching.
5
5
  """
6
6
 
7
- __version__ = "0.5.103"
7
+ __version__ = "0.5.104"
8
8
 
9
9
  from .pipeline import NLPPipeline
10
10
  from .normalization import QueryNormalizer
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code2llm
3
- Version: 0.5.103
3
+ Version: 0.5.104
4
4
  Summary: High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
5
5
  Home-page: https://github.com/wronai/stts
6
6
  Author: STTS Project
@@ -63,16 +63,13 @@ Dynamic: requires-python
63
63
 
64
64
  # code2llm - Generated Analysis Files
65
65
 
66
-
67
66
  ## AI Cost Tracking
68
67
 
69
- ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.5.103-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
70
- ![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-52.2h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
68
+ ![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)
71
69
 
72
- - 🤖 **LLM usage:** $7.5000 (151 commits)
73
- - 👤 **Human dev:** ~$5223 (52.2h @ $100/h, 30min dedup)
70
+ This project uses AI-generated code. Total cost: **$7.5000** with **153** AI commits.
74
71
 
75
- Generated on 2026-03-31 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
72
+ Generated on 2026-04-09 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/models/openrouter/qwen/qwen3-coder-next)
76
73
 
77
74
  ---
78
75
 
@@ -400,8 +397,8 @@ code2llm ./ -f yaml --separate-orphans
400
397
  ---
401
398
 
402
399
  **Generated by**: `code2llm ./ -f all --readme`
403
- **Analysis Date**: 2026-03-31
404
- **Total Functions**: 1006
400
+ **Analysis Date**: 2026-04-09
401
+ **Total Functions**: 1011
405
402
  **Total Classes**: 111
406
403
  **Modules**: 131
407
404
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "code2llm"
7
- version = "0.5.103"
7
+ version = "0.5.104"
8
8
  description = "High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
4
4
  import os
5
5
 
6
6
  # Read version
7
- version = "0.5.102"
7
+ version = "0.5.103"
8
8
 
9
9
  # Read long description
10
10
  def read_readme():
@@ -1,106 +0,0 @@
1
- """PHP analyzer (regex-based)."""
2
-
3
- import re
4
- from typing import Dict
5
-
6
- from code2llm.core.models import ClassInfo, FunctionInfo, ModuleInfo
7
- from code2llm.core.lang.base import calculate_complexity_regex, extract_calls_regex, _extract_declarations
8
-
9
-
10
- def analyze_php(content: str, file_path: str, module_name: str,
11
- ext: str, stats: Dict) -> Dict:
12
- """Analyze PHP files using shared extraction."""
13
-
14
- # PHP-specific patterns
15
- patterns = {
16
- 'import': re.compile(r'^(?:include|require|include_once|require_once)\s*["\']([^"\']+)["\']'),
17
- 'class': re.compile(
18
- r'(?:abstract\s+|final\s+)?class\s+(\w+)(?:\s+extends\s+(\w+))?(?:\s+implements\s+([\w,\s\\]+))?'
19
- ),
20
- 'interface': re.compile(r'interface\s+(\w+)'),
21
- 'function': re.compile(
22
- r'(?:public\s+|private\s+|protected\s+)?(?:static\s+)?function\s+(\w+)\s*\('
23
- ),
24
- }
25
-
26
- # Language configuration
27
- lang_config = {
28
- 'index_files': (),
29
- 'brace_track': True,
30
- 'reserved': {'if', 'for', 'while', 'switch', 'return', 'catch', 'echo', 'print'},
31
- }
32
-
33
- # Use shared extraction
34
- result = _extract_declarations(
35
- content, file_path, module_name,
36
- patterns, stats, lang_config
37
- )
38
-
39
- # PHP-specific: handle namespaces and adjust qualified names
40
- lines = content.split('\n')
41
- current_namespace = None
42
- in_php = False
43
-
44
- for line in lines:
45
- line = line.strip()
46
- if line.startswith('<?php') or line.startswith('<?'):
47
- in_php = True
48
- continue
49
- if line == '?>':
50
- in_php = False
51
- continue
52
- if not in_php:
53
- continue
54
-
55
- ns_match = re.match(r'^namespace\s+([\\\w]+)', line)
56
- if ns_match:
57
- current_namespace = ns_match.group(1)
58
- continue
59
-
60
- use_match = re.match(r'^use\s+([\\\w]+)', line)
61
- if use_match:
62
- result['module'].imports.append(use_match.group(1))
63
- continue
64
-
65
- # Adjust qualified names for namespaces
66
- if current_namespace:
67
- ns_prefix = f".{current_namespace}"
68
- new_classes = {}
69
- for qname, cls in list(result['classes'].items()):
70
- new_qname = qname.replace(f"{module_name}.", f"{module_name}{ns_prefix}.", 1)
71
- cls.qualified_name = new_qname
72
- new_classes[new_qname] = cls
73
- result['classes'] = new_classes
74
- result['module'].classes = list(new_classes.keys())
75
-
76
- new_functions = {}
77
- for qname, func in list(result['functions'].items()):
78
- new_qname = qname.replace(f"{module_name}.", f"{module_name}{ns_prefix}.", 1)
79
- func.qualified_name = new_qname
80
- new_functions[new_qname] = func
81
- result['functions'] = new_functions
82
- result['module'].functions = list(new_functions.keys())
83
-
84
- # Handle traits as classes
85
- trait_pattern = re.compile(r'^\s*trait\s+(\w+)')
86
- for line_no, line in enumerate(lines, 1):
87
- tm = trait_pattern.match(line.strip())
88
- if tm:
89
- tname = tm.group(1)
90
- if current_namespace:
91
- qual = f"{module_name}.{current_namespace}.{tname}"
92
- else:
93
- qual = f"{module_name}.{tname}"
94
- result['classes'][qual] = ClassInfo(
95
- name=tname, qualified_name=qual,
96
- file=file_path, line=line_no, module=module_name,
97
- bases=[], methods=[], docstring="",
98
- )
99
- result['module'].classes.append(qual)
100
- stats['classes_found'] += 1
101
-
102
- calculate_complexity_regex(content, result, lang='c_family')
103
- extract_calls_regex(content, module_name, result)
104
-
105
- stats['files_processed'] += 1
106
- return result
File without changes
File without changes
File without changes
File without changes