code2llm 0.5.122__tar.gz → 0.5.123__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.
- {code2llm-0.5.122 → code2llm-0.5.123}/PKG-INFO +2 -2
- {code2llm-0.5.122 → code2llm-0.5.123}/README.md +1 -1
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/__init__.py +1 -1
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/cli_commands.py +6 -5
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/cli_parser.py +12 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/config.py +20 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/base.py +11 -1
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/generators/mermaid.py +15 -9
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/nlp/__init__.py +1 -1
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm.egg-info/PKG-INFO +2 -2
- {code2llm-0.5.122 → code2llm-0.5.123}/pyproject.toml +1 -1
- {code2llm-0.5.122 → code2llm-0.5.123}/setup.py +1 -1
- {code2llm-0.5.122 → code2llm-0.5.123}/LICENSE +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/__main__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/call_graph.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/cfg.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/coupling.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/data_analysis.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/dfg.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/pipeline_classifier.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/pipeline_detector.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/pipeline_resolver.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/side_effects.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/smells.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/type_inference.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/utils/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/analysis/utils/ast_helpers.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/api.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/cli.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/cli_analysis.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/cli_exports/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/cli_exports/code2logic.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/cli_exports/formats.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/cli_exports/orchestrator.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/cli_exports/prompt.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/analyzer.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/ast_registry.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/export_pipeline.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/file_analyzer.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/file_cache.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/file_filter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/gitignore.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/incremental.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/cpp.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/csharp.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/generic.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/go_lang.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/java.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/php.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/ruby.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/rust.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/ts_extractors.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/ts_parser.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/lang/typescript.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/large_repo.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/models.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/persistent_cache.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/refactoring.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/repo_files.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/streaming/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/streaming/cache.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/streaming/incremental.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/streaming/prioritizer.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/streaming/scanner.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/streaming/strategies.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/streaming_analyzer.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/core/toon_size_manager.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/article_view.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/base.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/context_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/context_view.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/dashboard_data.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/dashboard_renderer.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/evolution_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/flow_constants.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/flow_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/flow_renderer.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/html_dashboard.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/index_generator/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/index_generator/renderer.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/index_generator/scanner.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/index_generator.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/json_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/llm_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/map_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/mermaid_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/mermaid_flow_helpers.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/project_yaml/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/project_yaml/constants.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/project_yaml/core.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/project_yaml/evolution.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/project_yaml/health.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/project_yaml/hotspots.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/project_yaml/modules.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/project_yaml_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/readme_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/report_generators.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/toon/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/toon/helpers.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/toon/metrics.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/toon/metrics_core.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/toon/metrics_duplicates.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/toon/metrics_health.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/toon/module_detail.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/toon/renderer.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/toon.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/toon_view.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/validate_project.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/exporters/yaml_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/generators/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/generators/_utils.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/generators/llm_flow.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/generators/llm_task.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/nlp/config.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/nlp/entity_resolution.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/nlp/intent_matching.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/nlp/normalization.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/nlp/pipeline.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/patterns/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/patterns/detector.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/refactor/__init__.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm/refactor/prompt_engine.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm.egg-info/SOURCES.txt +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm.egg-info/dependency_links.txt +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm.egg-info/entry_points.txt +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm.egg-info/requires.txt +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/code2llm.egg-info/top_level.txt +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/setup.cfg +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_advanced_analysis.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_analyzer.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_calls_toon_export.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_deep_analysis.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_edge_cases.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_flow_exporter.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_format_quality.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_multilanguage_e2e.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_nlp_pipeline.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_nonpython_cc_calls.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_persistent_cache.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_pipeline_detector.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_project_toon_export.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_prompt_engine.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_prompt_txt.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/tests/test_refactoring_engine.py +0 -0
- {code2llm-0.5.122 → code2llm-0.5.123}/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.
|
|
3
|
+
Version: 0.5.123
|
|
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
|
|
@@ -67,7 +67,7 @@ Dynamic: requires-python
|
|
|
67
67
|
|
|
68
68
|
## AI Cost Tracking
|
|
69
69
|
|
|
70
|
-
    
|
|
71
71
|
  
|
|
72
72
|
|
|
73
73
|
- 🤖 **LLM usage:** $7.5000 (166 commits)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
## AI Cost Tracking
|
|
5
5
|
|
|
6
|
-
    
|
|
7
7
|
  
|
|
8
8
|
|
|
9
9
|
- 🤖 **LLM usage:** $7.5000 (166 commits)
|
|
@@ -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.
|
|
11
|
+
__version__ = "0.5.123"
|
|
12
12
|
__author__ = "STTS Project"
|
|
13
13
|
|
|
14
14
|
# Core analysis components (lightweight, always needed)
|
|
@@ -6,6 +6,7 @@ from pathlib import Path
|
|
|
6
6
|
from typing import Optional
|
|
7
7
|
|
|
8
8
|
from .cli_exports import _run_report
|
|
9
|
+
from .core.config import DEFAULT_CACHE_MAX_AGE_DAYS, KB
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
def handle_special_commands() -> Optional[int]:
|
|
@@ -39,18 +40,18 @@ def handle_cache_command(args_list) -> int:
|
|
|
39
40
|
parser.add_argument('action', choices=['status', 'clear', 'gc'], help='Cache action')
|
|
40
41
|
parser.add_argument('--all', action='store_true', dest='all_projects',
|
|
41
42
|
help='Apply to all cached projects (clear only)')
|
|
42
|
-
parser.add_argument('--max-age', type=int, default=
|
|
43
|
-
help='Max age in days for gc (default:
|
|
43
|
+
parser.add_argument('--max-age', type=int, default=DEFAULT_CACHE_MAX_AGE_DAYS, metavar='DAYS',
|
|
44
|
+
help=f'Max age in days for gc (default: {DEFAULT_CACHE_MAX_AGE_DAYS})')
|
|
44
45
|
args = parser.parse_args(args_list)
|
|
45
46
|
|
|
46
47
|
if args.action == 'status':
|
|
47
48
|
projects = get_all_projects()
|
|
48
49
|
root = _DEFAULT_ROOT
|
|
49
|
-
total_mb = sum(p.get('cache_size_bytes', 0) for p in projects) / (
|
|
50
|
+
total_mb = sum(p.get('cache_size_bytes', 0) for p in projects) / (KB * KB)
|
|
50
51
|
print(f"Cache: {root}")
|
|
51
52
|
print(f" Projects: {len(projects)} Total: {total_mb:.1f} MB")
|
|
52
53
|
for p in projects:
|
|
53
|
-
size_mb = p.get('cache_size_bytes', 0) / (
|
|
54
|
+
size_mb = p.get('cache_size_bytes', 0) / (KB * KB)
|
|
54
55
|
updated = p.get('updated_at', 0)
|
|
55
56
|
age_min = int((time.time() - updated) / 60) if updated else 0
|
|
56
57
|
age_str = f"{age_min}m ago" if age_min < 120 else f"{age_min//60}h ago"
|
|
@@ -246,7 +247,7 @@ def _get_file_sizes(chunk_dir: Path, required_files: list[str]) -> str:
|
|
|
246
247
|
sizes = []
|
|
247
248
|
for req_file in required_files:
|
|
248
249
|
size = (chunk_dir / req_file).stat().st_size
|
|
249
|
-
sizes.append(f"{req_file}:{size//
|
|
250
|
+
sizes.append(f"{req_file}:{size//KB}KB" if size > KB else f"{req_file}:{size}B")
|
|
250
251
|
return ", ".join(sizes)
|
|
251
252
|
|
|
252
253
|
|
|
@@ -147,6 +147,18 @@ Strategy Options (--strategy):
|
|
|
147
147
|
help='Force re-analysis and re-export even when cache is valid (alias for --no-cache)'
|
|
148
148
|
)
|
|
149
149
|
|
|
150
|
+
parser.add_argument(
|
|
151
|
+
'--dry-run',
|
|
152
|
+
action='store_true',
|
|
153
|
+
help='Show what would be exported without writing files'
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
parser.add_argument(
|
|
157
|
+
'--watch',
|
|
158
|
+
action='store_true',
|
|
159
|
+
help='Auto-detect changed files and only re-analyze those (faster subsequent runs)'
|
|
160
|
+
)
|
|
161
|
+
|
|
150
162
|
parser.add_argument(
|
|
151
163
|
'--strategy',
|
|
152
164
|
choices=['quick', 'standard', 'deep'],
|
|
@@ -36,6 +36,26 @@ DEFAULT_CACHE_TTL_HOURS = 24
|
|
|
36
36
|
DEFAULT_MAX_MEMORY_MB = 2048
|
|
37
37
|
DEFAULT_PROGRESS_BAR_THRESHOLD = 50 # File count threshold for progress bar
|
|
38
38
|
|
|
39
|
+
# Complexity thresholds
|
|
40
|
+
CC_LOW_THRESHOLD = 5 # Rank A
|
|
41
|
+
CC_MEDIUM_THRESHOLD = 10 # Rank B
|
|
42
|
+
CC_HIGH_THRESHOLD = 20 # Rank C
|
|
43
|
+
CC_CRITICAL_THRESHOLD = 50 # For warnings
|
|
44
|
+
|
|
45
|
+
# Size limits
|
|
46
|
+
KB = 1024
|
|
47
|
+
MB = 1024 * 1024
|
|
48
|
+
MAX_FILE_SIZE_KB = 256
|
|
49
|
+
CHUNK_SIZE_KB = 256
|
|
50
|
+
|
|
51
|
+
# Timeouts
|
|
52
|
+
DEFAULT_PNG_TIMEOUT = 60
|
|
53
|
+
DEFAULT_MERMAID_MAX_TEXT_SIZE = 2_000_000
|
|
54
|
+
DEFAULT_MERMAID_MAX_EDGES = 20_000
|
|
55
|
+
|
|
56
|
+
# Cache settings
|
|
57
|
+
DEFAULT_CACHE_MAX_AGE_DAYS = 30
|
|
58
|
+
|
|
39
59
|
|
|
40
60
|
class AnalysisMode(str, Enum):
|
|
41
61
|
"""Available analysis modes."""
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
import re
|
|
4
4
|
from typing import Dict, List
|
|
5
5
|
|
|
6
|
+
from code2llm.core.config import (
|
|
7
|
+
CC_LOW_THRESHOLD,
|
|
8
|
+
CC_MEDIUM_THRESHOLD,
|
|
9
|
+
CC_HIGH_THRESHOLD,
|
|
10
|
+
)
|
|
11
|
+
|
|
6
12
|
|
|
7
13
|
# Branching keywords per language family
|
|
8
14
|
CC_PATTERNS = {
|
|
@@ -64,7 +70,11 @@ def calculate_complexity_regex(content: str, result: Dict,
|
|
|
64
70
|
cc = 1
|
|
65
71
|
else:
|
|
66
72
|
cc = 1 + len(pattern.findall(body))
|
|
67
|
-
rank =
|
|
73
|
+
rank = (
|
|
74
|
+
'A' if cc <= CC_LOW_THRESHOLD
|
|
75
|
+
else ('B' if cc <= CC_MEDIUM_THRESHOLD
|
|
76
|
+
else ('C' if cc <= CC_HIGH_THRESHOLD else 'D'))
|
|
77
|
+
)
|
|
68
78
|
func_info.complexity = {
|
|
69
79
|
'cyclomatic_complexity': cc,
|
|
70
80
|
'cc_rank': rank,
|
|
@@ -12,6 +12,12 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
from typing import List, Optional, Tuple
|
|
14
14
|
|
|
15
|
+
from code2llm.core.config import (
|
|
16
|
+
DEFAULT_PNG_TIMEOUT,
|
|
17
|
+
DEFAULT_MERMAID_MAX_TEXT_SIZE,
|
|
18
|
+
DEFAULT_MERMAID_MAX_EDGES,
|
|
19
|
+
)
|
|
20
|
+
|
|
15
21
|
|
|
16
22
|
def validate_mermaid_file(mmd_path: Path) -> List[str]:
|
|
17
23
|
"""Validate Mermaid file and return list of errors."""
|
|
@@ -283,7 +289,7 @@ def _prepare_and_render(mmd_file: Path, output_dir: Path, timeout: int) -> bool:
|
|
|
283
289
|
|
|
284
290
|
|
|
285
291
|
def generate_pngs(
|
|
286
|
-
input_dir: Path, output_dir: Path, timeout: int =
|
|
292
|
+
input_dir: Path, output_dir: Path, timeout: int = DEFAULT_PNG_TIMEOUT, max_workers: int = 0
|
|
287
293
|
) -> int:
|
|
288
294
|
"""Generate PNG files from all .mmd files in input_dir (parallel).
|
|
289
295
|
|
|
@@ -310,14 +316,14 @@ def generate_pngs(
|
|
|
310
316
|
def _setup_puppeteer_config() -> tuple[int, int, Optional[str]]:
|
|
311
317
|
"""Setup puppeteer config file and return (max_text_size, max_edges, cfg_path)."""
|
|
312
318
|
try:
|
|
313
|
-
max_text_size = int(os.getenv('CODE2FLOW_MERMAID_MAX_TEXT_SIZE',
|
|
319
|
+
max_text_size = int(os.getenv('CODE2FLOW_MERMAID_MAX_TEXT_SIZE', str(DEFAULT_MERMAID_MAX_TEXT_SIZE)))
|
|
314
320
|
except Exception:
|
|
315
|
-
max_text_size =
|
|
321
|
+
max_text_size = DEFAULT_MERMAID_MAX_TEXT_SIZE
|
|
316
322
|
|
|
317
323
|
try:
|
|
318
|
-
max_edges = int(os.getenv('CODE2FLOW_MERMAID_MAX_EDGES',
|
|
324
|
+
max_edges = int(os.getenv('CODE2FLOW_MERMAID_MAX_EDGES', str(DEFAULT_MERMAID_MAX_EDGES)))
|
|
319
325
|
except Exception:
|
|
320
|
-
max_edges =
|
|
326
|
+
max_edges = DEFAULT_MERMAID_MAX_EDGES
|
|
321
327
|
|
|
322
328
|
cfg_path: Optional[str] = None
|
|
323
329
|
try:
|
|
@@ -406,7 +412,7 @@ def _run_mmdc_subprocess(
|
|
|
406
412
|
return False
|
|
407
413
|
|
|
408
414
|
|
|
409
|
-
def generate_single_png(mmd_file: Path, output_file: Path, timeout: int =
|
|
415
|
+
def generate_single_png(mmd_file: Path, output_file: Path, timeout: int = DEFAULT_PNG_TIMEOUT) -> bool:
|
|
410
416
|
"""Generate PNG from single Mermaid file using available renderers."""
|
|
411
417
|
# Create output directory
|
|
412
418
|
output_file.parent.mkdir(parents=True, exist_ok=True)
|
|
@@ -431,9 +437,9 @@ def generate_single_png(mmd_file: Path, output_file: Path, timeout: int = 60) ->
|
|
|
431
437
|
def generate_with_puppeteer(
|
|
432
438
|
mmd_file: Path,
|
|
433
439
|
output_file: Path,
|
|
434
|
-
timeout: int =
|
|
435
|
-
max_text_size: int =
|
|
436
|
-
max_edges: int =
|
|
440
|
+
timeout: int = DEFAULT_PNG_TIMEOUT,
|
|
441
|
+
max_text_size: int = DEFAULT_MERMAID_MAX_TEXT_SIZE,
|
|
442
|
+
max_edges: int = DEFAULT_MERMAID_MAX_EDGES,
|
|
437
443
|
) -> bool:
|
|
438
444
|
"""Generate PNG using Puppeteer with HTML template."""
|
|
439
445
|
try:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2llm
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.123
|
|
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
|
|
@@ -67,7 +67,7 @@ Dynamic: requires-python
|
|
|
67
67
|
|
|
68
68
|
## AI Cost Tracking
|
|
69
69
|
|
|
70
|
-
    
|
|
71
71
|
  
|
|
72
72
|
|
|
73
73
|
- 🤖 **LLM usage:** $7.5000 (166 commits)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "code2llm"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.123"
|
|
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"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|