High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
- Metadata
- Architecture
- Interfaces
- Workflows
- Quality Pipeline (
pyqual.yaml) - Configuration
- Dependencies
- Deployment
- Environment Variables (
.env.example) - Release Management (
goal.yaml) - Makefile Targets
- Code Analysis
- Source Map
- Call Graph
- Test Contracts
- Intent
- name:
code2llm - version:
0.5.146 - python_requires:
>=3.8 - license: {'text': 'Apache-2.0'}
- ai_model:
openrouter/qwen/qwen3-coder-next - ecosystem: SUMD + DOQL + testql + taskfile
- generated_from: pyproject.toml, requirements.txt, Taskfile.yml, Makefile, testql(3), app.doql.less, pyqual.yaml, goal.yaml, .env.example, src(5 mod), project/(2 analysis files)
SUMD (description) → DOQL/source (code) → taskfile (automation) → testql (verification)
// LESS format — define @variables here as needed
// Generated by sumd for code2llm
app {
name: code2llm;
version: 0.5.146;
}
interface[type="cli"] {
framework: click;
}
workflow[name="install"] {
trigger: manual;
step-1: run cmd=pip install -e .;
}
workflow[name="dev"] {
trigger: manual;
step-1: run cmd=pip install -e ".[dev]";
}
workflow[name="build"] {
trigger: manual;
step-1: run cmd=python -m build;
}
workflow[name="test"] {
trigger: manual;
step-1: run cmd=pytest -q;
}
workflow[name="lint"] {
trigger: manual;
step-1: run cmd=ruff check .;
}
workflow[name="fmt"] {
trigger: manual;
step-1: run cmd=ruff format .;
}
workflow[name="clean"] {
trigger: manual;
step-1: run cmd=rm -rf build/ dist/ *.egg-info;
}
workflow[name="help"] {
trigger: manual;
step-1: run cmd=task --list;
}
deploy {
target: pip;
}
environment[name="local"] {
runtime: python;
}code2llm.apicode2llm.clicode2llm.cli_analysiscode2llm.cli_commandscode2llm.cli_parser
code2llm
# SCENARIO: Auto-generated API Smoke Tests
# TYPE: api
# GENERATED: true
# DETECTORS: FlaskDetector, ConfigEndpointDetector
CONFIG[5]{key, value}:
base_url, http://localhost:8101
timeout_ms, 10000
retry_count, 3
retry_backoff_ms, 1000
detected_frameworks, FlaskDetector, ConfigEndpointDetector
# REST API Endpoints (1 unique)
API[1]{method, endpoint, expected_status}:
GET, /, 200
ASSERT[2]{field, operator, expected}:
_status, <, 500
_status, >=, 200
# Summary by Framework:
# flask: 1 endpoints
# docker: 14 endpoints
# SCENARIO: CLI Command Tests
# TYPE: cli
# GENERATED: true
CONFIG[2]{key, value}:
cli_command, python -m code2llm
timeout_ms, 10000
# Test 1: CLI help command
SHELL "python -m code2llm --help" 5000
ASSERT_EXIT_CODE 0
ASSERT_STDOUT_CONTAINS "usage"
# Test 2: CLI version command
SHELL "python -m code2llm --version" 5000
ASSERT_EXIT_CODE 0
# Test 3: CLI main workflow (dry-run)
SHELL "python -m code2llm --help" 10000
ASSERT_EXIT_CODE 0
# SCENARIO: Auto-generated from Python Tests
# TYPE: integration
# GENERATED: true
CONFIG[2]{key, value}:
base_url, ${api_url:-http://localhost:8101}
timeout_ms, 10000
# Converted 2 assertions from pytest
ASSERT[2]{field, operator, expected}:
nlp_result.get_intent(), ==, "find_function"
nlp_result.get_intent(), ==, "find_function"
version: '1'
name: code2llm
description: Minimal Taskfile
variables:
APP_NAME: code2llm
environments:
local:
container_runtime: docker
compose_command: docker compose
pipeline:
python_version: "3.12"
runner_image: ubuntu-latest
branches: [main]
cache: [~/.cache/pip]
artifacts: [dist/]
stages:
- name: lint
tasks: [lint]
- name: test
tasks: [test]
- name: build
tasks: [build]
when: "branch:main"
tasks:
install:
desc: Install Python dependencies (editable)
cmds:
- pip install -e .[dev]
test:
desc: Run pytest suite
cmds:
- pytest -q
build:
desc: Build wheel + sdist
cmds:
- python -m build
clean:
desc: Remove build artefacts
cmds:
- rm -rf build/ dist/ *.egg-info
help:
desc: '[imported from Makefile] help'
cmds:
- echo "code2llm - Python Code Flow Analysis Tool with LLM Integration and TOON
Format"
- echo ""
- "echo \"\U0001F680 Installation:\""
- echo " make install - Install package"
- echo " make dev-install - Install with development dependencies"
- echo ""
- "echo \"\U0001F9EA Testing:\""
- echo " make test - Run test suite"
- echo " make test-toon - Test TOON format only"
- echo " make validate-toon - Validate TOON format output"
- echo " make test-all-formats - Test all output formats"
- echo ""
- "echo \"\U0001F527 Code Quality:\""
- echo " make lint - Run linters (flake8, black --check)"
- echo " make format - Format code with black"
- echo " make typecheck - Run mypy type checking"
- echo " make check - Run all quality checks"
- echo ""
- "echo \"\U0001F4CA Analysis:\""
- echo " make analyze - Run analysis on current project (TOON format)"
- echo " make run - Run with example arguments"
- echo " make analyze-all - Run analysis with all formats"
- echo ""
- "echo \"\U0001F3AF TOON Format:\""
- echo " make toon-demo - Quick TOON format demo"
- echo " make toon-compare - Compare TOON vs YAML formats"
- echo " make toon-validate - Validate TOON format structure"
- echo ""
- "echo \"\U0001F4E6 Building & Release:\""
- echo " make build - Build distribution packages"
- echo " make publish - Publish to PyPI (with version bump)"
- echo " make publish-test - Publish to TestPyPI"
- echo " make bump-patch - Bump patch version"
- echo " make bump-minor - Bump minor version"
- echo " make bump-major - Bump major version"
- echo ""
- "echo \"\U0001F3A8 Visualization:\""
- echo " make mermaid-png - Generate PNG from all Mermaid files"
- echo " make install-mermaid - Install Mermaid CLI renderer"
- echo " make check-mermaid - Check available Mermaid renderers"
- echo ""
- "echo \"\U0001F9F9 Maintenance:\""
- echo " make clean - Remove build artifacts"
- echo " make clean-png - Clean PNG files"
- echo ""
dev-install:
desc: '[imported from Makefile] dev-install'
cmds:
- $(PYTHON) -m pip install -e ".[dev]"
- "echo \"\u2713 code2llm installed with dev dependencies\""
test-cov:
desc: '[imported from Makefile] test-cov'
cmds:
- $(PYTHON) -m pytest tests/ --cov=code2llm --cov-report=html --cov-report=term
2>/dev/null || echo "No tests yet"
test-toon:
desc: '[imported from Makefile] test-toon'
cmds:
- "echo \"\U0001F3AF Testing TOON format...\""
- $(PYTHON) -m code2llm ./ -v -o ./test_toon -m hybrid -f toon
- $(PYTHON) validate_toon.py test_toon/analysis.toon
- "echo \"\u2713 TOON format test complete\""
validate-toon:
desc: '[imported from Makefile] validate-toon'
deps:
- test-toon
test-all-formats:
desc: '[imported from Makefile] test-all-formats'
cmds:
- "echo \"\U0001F4CA Testing all output formats...\""
- $(PYTHON) -m code2llm ./ -v -o ./test_all -m hybrid -f all
- $(PYTHON) validate_toon.py test_all/analysis.toon
- "echo \"\u2713 All formats test complete\""
test-comprehensive:
desc: '[imported from Makefile] test-comprehensive'
cmds:
- "echo \"\U0001F680 Running comprehensive test suite...\""
- bash project.sh
- "echo \"\u2713 Comprehensive tests complete\""
lint:
desc: '[imported from Makefile] lint'
cmds:
- $(PYTHON) -m flake8 code2llm/ --max-line-length=100 --ignore=E203,W503 2>/dev/null
|| echo "flake8 not installed"
- $(PYTHON) -m black --check code2llm/ 2>/dev/null || echo "black not installed"
- "echo \"\u2713 Linting complete\""
format:
desc: '[imported from Makefile] format'
cmds:
- '$(PYTHON) -m black code2llm/ --line-length=100 2>/dev/null || echo "black not
installed, run: pip install black"'
- "echo \"\u2713 Code formatted\""
typecheck:
desc: '[imported from Makefile] typecheck'
cmds:
- $(PYTHON) -m mypy code2llm/ --ignore-missing-imports 2>/dev/null || echo "mypy
not installed"
check:
desc: '[imported from Makefile] check'
cmds:
- "echo \"\u2713 All checks passed\""
deps:
- lint
- typecheck
- test
run:
desc: '[imported from Makefile] run'
cmds:
- $(PYTHON) -m code2llm ../python/stts_core -v -o ./output
analyze:
desc: '[imported from Makefile] analyze'
cmds:
- "echo \"\U0001F3AF Running TOON format analysis on current project...\""
- $(PYTHON) -m code2llm ./ -v -o ./analysis -m hybrid -f toon
- $(PYTHON) validate_toon.py analysis/analysis.toon
- "echo \"\u2713 TOON analysis complete - check analysis/analysis.toon\""
analyze-all:
desc: '[imported from Makefile] analyze-all'
cmds:
- "echo \"\U0001F4CA Running analysis with all formats...\""
- $(PYTHON) -m code2llm ./ -v -o ./analysis_all -m hybrid -f all
- $(PYTHON) validate_toon.py analysis_all/analysis.toon
- "echo \"\u2713 All formats analysis complete - check analysis_all/\""
toon-demo:
desc: '[imported from Makefile] toon-demo'
cmds:
- "echo \"\U0001F3AF Quick TOON format demo...\""
- $(PYTHON) -m code2llm ./ -v -o ./demo -m hybrid -f toon
- "echo \"\U0001F4C1 Generated: demo/analysis.toon\""
- "echo \"\U0001F4CA Size: $$(du -h demo/analysis.toon | cut -f1)\""
- "echo \"\U0001F50D Preview:\""
- head -20 demo/analysis.toon
toon-compare:
desc: '[imported from Makefile] toon-compare'
cmds:
- "echo \"\U0001F4CA Comparing TOON vs YAML formats...\""
- $(PYTHON) -m code2llm ./ -v -o ./compare -m hybrid -f toon,yaml
- "echo \"\U0001F4C1 Files generated:\""
- 'echo " - TOON: compare/analysis.toon ($$(du -h compare/analysis.toon | cut
-f1))"'
- 'echo " - YAML: compare/analysis.yaml ($$(du -h compare/analysis.yaml | cut
-f1))"'
- 'echo " - Ratio: $$(echo "scale=1; $$(du -k compare/analysis.yaml | cut -f1)
/ $$(du -k compare/analysis.toon | cut -f1)" | bc)x smaller"'
- $(PYTHON) validate_toon.py compare/analysis.yaml compare/analysis.toon
toon-validate:
desc: '[imported from Makefile] toon-validate'
cmds:
- "echo \"\U0001F50D Validating TOON format structure...\""
- $(PYTHON) validate_toon.py analysis/analysis.toon 2>/dev/null || $(PYTHON) validate_toon.py
test_toon/analysis.toon 2>/dev/null || echo "Run 'make test-toon' first"
publish-test:
desc: '[imported from Makefile] publish-test'
cmds:
- "echo \"\U0001F680 Publishing to TestPyPI...\""
- $(PYTHON) -m venv publish-test-env
- publish-test-env/bin/pip install twine
- publish-test-env/bin/python -m twine upload --repository testpypi dist/*
- rm -rf publish-test-env
- "echo \"\u2713 Published to TestPyPI\""
deps:
- build
bump-patch:
desc: '[imported from Makefile] bump-patch'
cmds:
- "echo \"\U0001F522 Bumping patch version...\""
- $(PYTHON) scripts/bump_version.py patch 2>/dev/null || echo "Create scripts/bump_version.py
or edit pyproject.toml manually"
bump-minor:
desc: '[imported from Makefile] bump-minor'
cmds:
- "echo \"\U0001F522 Bumping minor version...\""
- $(PYTHON) scripts/bump_version.py minor 2>/dev/null || echo "Create scripts/bump_version.py
or edit pyproject.toml manually"
bump-major:
desc: '[imported from Makefile] bump-major'
cmds:
- "echo \"\U0001F522 Bumping major version...\""
- $(PYTHON) scripts/bump_version.py major 2>/dev/null || echo "Create scripts/bump_version.py
or edit pyproject.toml manually"
publish:
desc: '[imported from Makefile] publish'
cmds:
- "echo \"\U0001F680 Publishing to PyPI...\""
- "echo \"\U0001F522 Bumping patch version...\""
- $(MAKE) bump-patch
- "echo \"\U0001F528 Rebuilding package with new version...\""
- $(MAKE) build
- "echo \"\U0001F4E6 Publishing to PyPI...\""
- $(PYTHON) -m venv publish-env
- publish-env/bin/pip install twine
- publish-env/bin/python -m twine upload dist/*
- rm -rf publish-env
- "echo \"\u2713 Published to PyPI\""
deps:
- build
mermaid-png:
desc: '[imported from Makefile] mermaid-png'
cmds:
- $(PYTHON) mermaid_to_png.py --batch output output
install-mermaid:
desc: '[imported from Makefile] install-mermaid'
cmds:
- npm install -g @mermaid-js/mermaid-cli
check-mermaid:
desc: '[imported from Makefile] check-mermaid'
cmds:
- echo "Checking available Mermaid renderers..."
- "which mmdc > /dev/null && echo \"\u2713 mmdc (mermaid-cli)\" || echo \"\u2717\
\ mmdc (run: npm install -g @mermaid-js/mermaid-cli)\""
- "which npx > /dev/null && echo \"\u2713 npx (for @mermaid-js/mermaid-cli)\"\
\ || echo \"\u2717 npx (install Node.js)\""
- "which puppeteer > /dev/null && echo \"\u2713 puppeteer\" || echo \"\u2717 puppeteer\
\ (run: npm install -g puppeteer)\""
clean-png:
desc: '[imported from Makefile] clean-png'
cmds:
- rm -f output/*.png
- "echo \"\u2713 Cleaned PNG files\""
quickstart:
desc: '[imported from Makefile] quickstart'
cmds:
- "echo \"\U0001F680 Quick Start with code2llm TOON format:\""
- echo ""
- 'echo "1. Install: make install"'
- 'echo "2. Test TOON: make test-toon"'
- 'echo "3. Analyze: make analyze"'
- 'echo "4. Compare: make toon-compare"'
- 'echo "5. All formats: make test-all-formats"'
- echo ""
- "echo \"\U0001F4D6 For more: make help\""
health:
desc: '[from doql] workflow: health'
cmds:
- docker compose ps
- docker compose exec app echo "Health check passed"
import-makefile-hint:
desc: '[from doql] workflow: import-makefile-hint'
cmds:
- 'echo ''Run: taskfile import Makefile to import existing targets.'''
all:
desc: Run install, lint, test
cmds:
- taskfile run install
- taskfile run lint
- taskfile run test
fmt:
desc: Auto-format with ruff
cmds:
- ruff format .
sumd:
desc: Generate SUMD (Structured Unified Markdown Descriptor) for AI-aware project description
cmds:
- |
echo "# $(basename $(pwd))" > SUMD.md
echo "" >> SUMD.md
echo "$(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('description','Project description'))" 2>/dev/null || echo 'Project description')" >> SUMD.md
echo "" >> SUMD.md
echo "## Contents" >> SUMD.md
echo "" >> SUMD.md
echo "- [Metadata](#metadata)" >> SUMD.md
echo "- [Architecture](#architecture)" >> SUMD.md
echo "- [Dependencies](#dependencies)" >> SUMD.md
echo "- [Source Map](#source-map)" >> SUMD.md
echo "- [Intent](#intent)" >> SUMD.md
echo "" >> SUMD.md
echo "## Metadata" >> SUMD.md
echo "" >> SUMD.md
echo "- **name**: \`$(basename $(pwd))\`" >> SUMD.md
echo "- **version**: \`$(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('version','unknown'))" 2>/dev/null || echo 'unknown')\`" >> SUMD.md
echo "- **python_requires**: \`>=$(python3 --version 2>/dev/null | cut -d' ' -f2 | cut -d. -f1,2)\`" >> SUMD.md
echo "- **license**: $(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('license',{}).get('text','MIT'))" 2>/dev/null || echo 'MIT')" >> SUMD.md
echo "- **ecosystem**: SUMD + DOQL + testql + taskfile" >> SUMD.md
echo "- **generated_from**: pyproject.toml, Taskfile.yml, Makefile, src/" >> SUMD.md
echo "" >> SUMD.md
echo "## Architecture" >> SUMD.md
echo "" >> SUMD.md
echo '```' >> SUMD.md
echo "SUMD (description) → DOQL/source (code) → taskfile (automation) → testql (verification)" >> SUMD.md
echo '```' >> SUMD.md
echo "" >> SUMD.md
echo "## Source Map" >> SUMD.md
echo "" >> SUMD.md
find . -name '*.py' -not -path './.venv/*' -not -path './venv/*' -not -path './__pycache__/*' -not -path './.git/*' | head -50 | sed 's|^./||' | sed 's|^|- |' >> SUMD.md
echo "Generated SUMD.md"
- |
python3 -c "
import json, os, subprocess
from pathlib import Path
project_name = Path.cwd().name
py_files = list(Path('.').rglob('*.py'))
py_files = [f for f in py_files if not any(x in str(f) for x in ['.venv', 'venv', '__pycache__', '.git'])]
data = {
'project_name': project_name,
'description': 'SUMD - Structured Unified Markdown Descriptor for AI-aware project refactorization',
'files': [{'path': str(f), 'type': 'python'} for f in py_files[:100]]
}
with open('sumd.json', 'w') as f:
json.dump(data, f, indent=2)
print('Generated sumd.json')
" 2>/dev/null || echo 'Python generation failed, using fallback'
sumr:
desc: Generate SUMR (Summary Report) with project metrics and health status
cmds:
- |
echo "# $(basename $(pwd)) - Summary Report" > SUMR.md
echo "" >> SUMR.md
echo "SUMR - Summary Report for project analysis" >> SUMR.md
echo "" >> SUMR.md
echo "## Contents" >> SUMR.md
echo "" >> SUMR.md
echo "- [Metadata](#metadata)" >> SUMR.md
echo "- [Quality Status](#quality-status)" >> SUMR.md
echo "- [Metrics](#metrics)" >> SUMR.md
echo "- [Refactoring Analysis](#refactoring-analysis)" >> SUMR.md
echo "- [Intent](#intent)" >> SUMR.md
echo "" >> SUMR.md
echo "## Metadata" >> SUMR.md
echo "" >> SUMR.md
echo "- **name**: \`$(basename $(pwd))\`" >> SUMR.md
echo "- **version**: \`$(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('version','unknown'))" 2>/dev/null || echo 'unknown')\`" >> SUMR.md
echo "- **generated_at**: \`$(date -Iseconds)\`" >> SUMR.md
echo "" >> SUMR.md
echo "## Quality Status" >> SUMR.md
echo "" >> SUMR.md
if [ -f pyqual.yaml ]; then
echo "- **pyqual_config**: ✅ Present" >> SUMR.md
echo "- **last_run**: $(stat -c %y .pyqual/pipeline.db 2>/dev/null | cut -d' ' -f1 || echo 'N/A')" >> SUMR.md
else
echo "- **pyqual_config**: ❌ Missing" >> SUMR.md
fi
echo "" >> SUMR.md
echo "## Metrics" >> SUMR.md
echo "" >> SUMR.md
py_files=$(find . -name '*.py' -not -path './.venv/*' -not -path './venv/*' | wc -l)
echo "- **python_files**: $py_files" >> SUMR.md
lines=$(find . -name '*.py' -not -path './.venv/*' -not -path './venv/*' -exec cat {} \; 2>/dev/null | wc -l)
echo "- **total_lines**: $lines" >> SUMR.md
echo "" >> SUMR.md
echo "## Refactoring Analysis" >> SUMR.md
echo "" >> SUMR.md
echo "Run \`code2llm ./ -f evolution\` for detailed refactoring queue." >> SUMR.md
echo "Generated SUMR.md"
- |
python3 -c "
import json, os, subprocess
from pathlib import Path
from datetime import datetime
project_name = Path.cwd().name
py_files = len([f for f in Path('.').rglob('*.py') if not any(x in str(f) for x in ['.venv', 'venv', '__pycache__', '.git'])])
data = {
'project_name': project_name,
'report_type': 'SUMR',
'generated_at': datetime.now().isoformat(),
'metrics': {
'python_files': py_files,
'has_pyqual_config': Path('pyqual.yaml').exists()
}
}
with open('SUMR.json', 'w') as f:
json.dump(data, f, indent=2)
print('Generated SUMR.json')
" 2>/dev/null || echo 'Python generation failed, using fallback'pipeline:
name: code2llm-quality
metrics:
cc_max: 15
critical_max: 0
custom_tools:
- name: code2llm_code2llm
binary: code2llm
command: >-
code2llm {workdir} -f toon -o ./project --no-chunk
--exclude .git .venv .venv_test build dist __pycache__ .pytest_cache .code2llm_cache .benchmarks .mypy_cache .ruff_cache node_modules
output: ""
allow_failure: false
- name: vallm_code2llm
binary: vallm
command: >-
vallm batch {workdir} --recursive --format toon --output ./project
--exclude .git,.venv,.venv_test,build,dist,__pycache__,.pytest_cache,.code2llm_cache,.benchmarks,.mypy_cache,.ruff_cache,node_modules,CHANGELOG.md,*.md
output: ""
allow_failure: false
stages:
- name: analyze
tool: code2llm_code2llm
optional: true
timeout: 0
- name: validate
tool: vallm_code2llm
optional: true
timeout: 0
- name: lint
tool: ruff
optional: true
- name: fix
tool: prefact
optional: true
when: metrics_fail
timeout: 900
- name: test
run: python3 -m pytest -q
when: always
loop:
max_iterations: 3
on_fail: report
env:
LLM_MODEL: openrouter/qwen/qwen3-coder-nextproject:
name: code2llm
version: 0.5.146
env: localnetworkx>=2.6
matplotlib>=3.4
pyyaml>=5.4
numpy>=1.20
jinja2>=3.0
radon>=5.1
astroid>=3.0
code2logic
vulture>=2.10
tiktoken>=0.5
tree-sitter>=0.21
tree-sitter-python>=0.21
tree-sitter-javascript>=0.21
tree-sitter-typescript>=0.21
tree-sitter-go>=0.21
tree-sitter-rust>=0.21
tree-sitter-java>=0.21
tree-sitter-c>=0.21
tree-sitter-cpp>=0.22
tree-sitter-c-sharp>=0.21
tree-sitter-php>=0.22
tree-sitter-ruby>=0.21
pytest>=6.2
pytest-cov>=2.12
pytest-xdist>=3.0
black>=21.0
flake8>=3.9
mypy>=0.910
goal>=2.1.218
costs>=0.1.20
pfix>=0.1.60
pip install code2llm
# development install
pip install -e .[dev]networkx>=3.0matplotlib>=3.6.0numpy>=1.21.0pyyaml>=6.0scipy>=1.7.0radon>=5.1psutil>=5.8.0astroid>=3.0code2logic
| Variable | Default | Description |
|---|---|---|
CODE2FLOW_CALLS_SPLIT |
1 |
Enable/disable splitting |
CODE2FLOW_CALLS_KEEP_MAIN |
0 |
Keep writing the full calls.mmd in addition to parts |
CODE2FLOW_CALLS_MIN_NODES |
30 |
Minimum number of functions per part |
CODE2FLOW_CALLS_MAX_NODES |
250 |
Maximum number of functions per part |
CODE2FLOW_CALLS_MAX_PARTS |
20 |
Maximum number of parts to generate |
CODE2FLOW_CALLS_INCLUDE_SINGLETONS |
0 |
Include singleton components (1 function with no edges) |
CODE2FLOW_MERMAID_MAX_EDGES |
20000 |
Increase if Mermaid CLI reports edge/text limits. |
CODE2FLOW_MERMAID_MAX_TEXT_SIZE |
2000000 |
- versioning:
semver - commits:
conventionalscope=code2flow - changelog:
keep-a-changelog - build strategies:
python,nodejs,rust - version files:
VERSION,pyproject.toml:version,setup.py:version,code2llm/__init__.py:__version__
PYTHONhelp— Default targetinstalldev-installtesttest-covtest-toonvalidate-toontest-all-formatstest-comprehensivelintformattypecheckcheckrunanalyzeanalyze-alltoon-demotoon-comparetoon-validatebuildpublish-testbump-patchbump-minorbump-majorpublishmermaid-pnginstall-mermaidcheck-mermaidcleanclean-pngquickstart
# code2llm | 245f 35704L | python:224,go:5,rust:5,typescript:4,shell:4,less:2,javascript:1 | 2026-05-06
# stats: 525 func | 186 cls | 245 mod | CC̄=4.4 | critical:42 | cycles:0
# alerts[5]: CC _analyze_subproject=14; CC _run_exports=14; CC _analyze_generated_files=14; CC _match_method_name=14; CC analyze_ruby=14
# hotspots[5]: run_benchmark fan=18; _run_exports fan=18; handle_cache_command fan=17; _export_simple_formats fan=17; _export_mermaid fan=17
# evolution: baseline
# Keys: M=modules, D=details, i=imports, e=exports, c=classes, f=functions, m=methods
M[245]:
app.doql.less,60
badges/server.py,110
benchmarks/benchmark_constants.py,30
benchmarks/benchmark_evolution.py,138
benchmarks/benchmark_format_quality.py,144
benchmarks/benchmark_optimizations.py,158
benchmarks/benchmark_performance.py,307
benchmarks/format_evaluator.py,139
benchmarks/project_generator.py,234
benchmarks/reporting.py,180
benchmarks/test_performance.py,260
code2llm/__init__.py,53
code2llm/__main__.py,7
code2llm/analysis/__init__.py,38
code2llm/analysis/call_graph.py,199
code2llm/analysis/cfg.py,281
code2llm/analysis/coupling.py,78
code2llm/analysis/data_analysis.py,376
code2llm/analysis/dfg.py,220
code2llm/analysis/pipeline_classifier.py,101
code2llm/analysis/pipeline_detector.py,363
code2llm/analysis/pipeline_resolver.py,92
code2llm/analysis/side_effects.py,295
code2llm/analysis/smells.py,193
code2llm/analysis/type_inference.py,291
code2llm/analysis/utils/__init__.py,6
code2llm/analysis/utils/ast_helpers.py,87
code2llm/api.py,74
code2llm/cli.py,70
code2llm/cli_analysis.py,346
code2llm/cli_commands.py,318
code2llm/cli_exports/__init__.py,55
code2llm/cli_exports/code2logic.py,128
code2llm/cli_exports/formats.py,336
code2llm/cli_exports/orchestrator.py,363
code2llm/cli_exports/orchestrator_chunked.py,88
code2llm/cli_exports/orchestrator_constants.py,53
code2llm/cli_exports/orchestrator_handlers.py,175
code2llm/cli_exports/prompt.py,481
code2llm/cli_parser.py,334
code2llm/core/__init__.py,53
code2llm/core/analyzer.py,496
code2llm/core/ast_registry.py,103
code2llm/core/config.py,353
code2llm/core/export_pipeline.py,154
code2llm/core/file_analyzer.py,410
code2llm/core/file_cache.py,108
code2llm/core/file_filter.py,128
code2llm/core/gitignore.py,139
code2llm/core/incremental.py,151
code2llm/core/lang/__init__.py,172
code2llm/core/lang/base.py,465
code2llm/core/lang/cpp.py,36
code2llm/core/lang/csharp.py,43
code2llm/core/lang/generic.py,72
code2llm/core/lang/go_lang.py,103
code2llm/core/lang/java.py,44
code2llm/core/lang/php.py,66
code2llm/core/lang/ruby.py,165
code2llm/core/lang/rust.py,95
code2llm/core/lang/ts_extractors.py,181
code2llm/core/lang/ts_parser.py,159
code2llm/core/lang/typescript.py,53
code2llm/core/large_repo.py,489
code2llm/core/models.py,194
code2llm/core/persistent_cache.py,454
code2llm/core/refactoring.py,210
code2llm/core/repo_files.py,175
code2llm/core/streaming/__init__.py,8
code2llm/core/streaming/cache.py,51
code2llm/core/streaming/incremental.py,76
code2llm/core/streaming/prioritizer.py,132
code2llm/core/streaming/scanner.py,202
code2llm/core/streaming/strategies.py,69
code2llm/core/streaming_analyzer.py,182
code2llm/core/toon_size_manager.py,266
code2llm/exporters/__init__.py,82
code2llm/exporters/article_view.py,160
code2llm/exporters/base.py,175
code2llm/exporters/context_exporter.py,251
code2llm/exporters/context_view.py,137
code2llm/exporters/dashboard_data.py,164
code2llm/exporters/dashboard_renderer.py,343
code2llm/exporters/evolution/__init__.py,79
code2llm/exporters/evolution/computation.py,168
code2llm/exporters/evolution/constants.py,26
code2llm/exporters/evolution/exclusion.py,18
code2llm/exporters/evolution/render.py,196
code2llm/exporters/evolution/yaml_export.py,104
code2llm/exporters/evolution_exporter.py,75
code2llm/exporters/flow_constants.py,47
code2llm/exporters/flow_exporter.py,386
code2llm/exporters/flow_renderer.py,189
code2llm/exporters/html_dashboard.py,69
code2llm/exporters/index_generator/__init__.py,74
code2llm/exporters/index_generator/renderer.py,638
code2llm/exporters/index_generator/scanner.py,117
code2llm/exporters/index_generator.py,30
code2llm/exporters/json_exporter.py,28
code2llm/exporters/llm_exporter.py,13
code2llm/exporters/map/__init__.py,61
code2llm/exporters/map/alerts.py,85
code2llm/exporters/map/details.py,116
code2llm/exporters/map/header.py,72
code2llm/exporters/map/module_list.py,27
code2llm/exporters/map/utils.py,70
code2llm/exporters/map/yaml_export.py,107
code2llm/exporters/map_exporter.py,51
code2llm/exporters/mermaid/__init__.py,67
code2llm/exporters/mermaid/calls.py,63
code2llm/exporters/mermaid/classic.py,94
code2llm/exporters/mermaid/compact.py,68
code2llm/exporters/mermaid/flow_compact.py,158
code2llm/exporters/mermaid/flow_detailed.py,71
code2llm/exporters/mermaid/flow_full.py,71
code2llm/exporters/mermaid/utils.py,100
code2llm/exporters/mermaid_exporter.py,75
code2llm/exporters/mermaid_flow_helpers.py,264
code2llm/exporters/project_yaml/__init__.py,16
code2llm/exporters/project_yaml/constants.py,16
code2llm/exporters/project_yaml/core.py,121
code2llm/exporters/project_yaml/evolution.py,47
code2llm/exporters/project_yaml/health.py,104
code2llm/exporters/project_yaml/hotspots.py,107
code2llm/exporters/project_yaml/modules.py,152
code2llm/exporters/project_yaml_exporter.py,16
code2llm/exporters/readme/__init__.py,41
code2llm/exporters/readme/content.py,349
code2llm/exporters/readme/files.py,27
code2llm/exporters/readme/insights.py,53
code2llm/exporters/readme/sections.py,68
code2llm/exporters/readme_exporter.py,67
code2llm/exporters/report_generators.py,77
code2llm/exporters/toon/__init__.py,200
code2llm/exporters/toon/helpers.py,143
code2llm/exporters/toon/metrics.py,99
code2llm/exporters/toon/metrics_core.py,298
code2llm/exporters/toon/metrics_duplicates.py,79
code2llm/exporters/toon/metrics_health.py,99
code2llm/exporters/toon/module_detail.py,163
code2llm/exporters/toon/renderer.py,472
code2llm/exporters/toon.py,11
code2llm/exporters/toon_view.py,154
code2llm/exporters/validate_project.py,119
code2llm/exporters/yaml_exporter.py,355
code2llm/generators/__init__.py,16
code2llm/generators/_utils.py,16
code2llm/generators/llm_flow/__init__.py,99
code2llm/generators/llm_flow/analysis.py,174
code2llm/generators/llm_flow/cli.py,77
code2llm/generators/llm_flow/generator.py,119
code2llm/generators/llm_flow/nodes.py,104
code2llm/generators/llm_flow/parsing.py,40
code2llm/generators/llm_flow/utils.py,85
code2llm/generators/llm_flow.py,88
code2llm/generators/llm_task.py,320
code2llm/generators/mermaid/__init__.py,71
code2llm/generators/mermaid/fix.py,148
code2llm/generators/mermaid/png.py,265
code2llm/generators/mermaid/validation.py,120
code2llm/generators/mermaid.py,89
code2llm/nlp/__init__.py,24
code2llm/nlp/config.py,175
code2llm/nlp/entity_resolution.py,327
code2llm/nlp/intent_matching.py,298
code2llm/nlp/normalization.py,123
code2llm/nlp/pipeline.py,389
code2llm/parsers/toon_parser.py,148
code2llm/patterns/__init__.py,1
code2llm/patterns/detector.py,169
code2llm/refactor/__init__.py,1
code2llm/refactor/prompt_engine.py,151
demo_langs/invalid/sample_bad.go,25
demo_langs/invalid/sample_bad.py,24
demo_langs/invalid/sample_bad.rs,19
demo_langs/invalid/sample_bad.ts,21
demo_langs/valid/sample.go,47
demo_langs/valid/sample.py,54
demo_langs/valid/sample.rs,48
demo_langs/valid/sample.ts,27
examples/docker-doql-example/app/main.py,23
examples/docker-doql-example/app.doql.less,516
examples/docker-doql-example/go/main.go,57
examples/docker-doql-example/node/index.js,38
examples/docker-doql-example/run-doql.sh,428
examples/docker-doql-example/rust/src/main.rs,48
examples/docker-doql-example/worker/worker.py,29
examples/functional_refactoring/__init__.py,7
examples/functional_refactoring/cache.py,122
examples/functional_refactoring/cli.py,46
examples/functional_refactoring/entity_preparers.py,130
examples/functional_refactoring/generator.py,62
examples/functional_refactoring/models.py,26
examples/functional_refactoring/template_engine.py,105
examples/functional_refactoring_example.py,62
examples/litellm/run.py,121
examples/streaming-analyzer/demo.py,252
examples/streaming-analyzer/sample_project/__init__.py,2
examples/streaming-analyzer/sample_project/api.py,77
examples/streaming-analyzer/sample_project/auth.py,89
examples/streaming-analyzer/sample_project/database.py,158
examples/streaming-analyzer/sample_project/main.py,159
examples/streaming-analyzer/sample_project/utils.py,85
examples/streaming-analyzer/test_example.py,93
orchestrator.sh,83
pipeline.py,204
project.sh,53
project2.sh,50
scripts/benchmark_badges.py,392
scripts/bump_version.py,97
setup.py,73
test_langs/invalid/sample_bad.go,25
test_langs/invalid/sample_bad.py,24
test_langs/invalid/sample_bad.rs,19
test_langs/invalid/sample_bad.ts,21
test_langs/valid/sample.go,47
test_langs/valid/sample.py,41
test_langs/valid/sample.rs,48
test_langs/valid/sample.ts,27
test_python_only/invalid/__init__.py,2
test_python_only/invalid/sample_bad.py,24
test_python_only/valid/__init__.py,2
test_python_only/valid/sample.py,41
tests/test_advanced_analysis.py,95
tests/test_analyzer.py,262
tests/test_cache_invalidation_e2e.py,114
tests/test_calls_toon_export.py,242
tests/test_declarative_collection.py,205
tests/test_deep_analysis.py,80
tests/test_edge_cases.py,406
tests/test_file_analyzer_tagging.py,70
tests/test_flow_exporter.py,453
tests/test_format_quality.py,360
tests/test_multilanguage_e2e.py,352
tests/test_nlp_pipeline.py,334
tests/test_nonpython_cc_calls.py,643
tests/test_orchestrator_cache_mtime.py,55
tests/test_persistent_cache.py,387
tests/test_pipeline_detector.py,417
tests/test_project_toon_export.py,72
tests/test_prompt_engine.py,78
tests/test_prompt_txt.py,253
tests/test_refactoring_engine.py,76
tests/test_toon_v2.py,300
validate_toon.py,380
D:
badges/server.py:
e: index,generate_badges,get_badges
index()
generate_badges()
get_badges()
benchmarks/benchmark_constants.py:
benchmarks/benchmark_evolution.py:
e: parse_evolution_metrics,load_previous,save_current,run_benchmark
parse_evolution_metrics(toon_content)
load_previous(history_file)
save_current(history_file;metrics)
run_benchmark(project_path)
benchmarks/benchmark_format_quality.py:
e: _print_benchmark_header,_print_ground_truth_info,_generate_format_outputs,_create_offline_scores,run_benchmark
_print_benchmark_header()
_print_ground_truth_info(project_path)
_generate_format_outputs(result;output_dir)
_create_offline_scores()
run_benchmark()
benchmarks/benchmark_optimizations.py:
e: clear_caches,run_analysis,benchmark_cold_vs_warm,print_summary,main
clear_caches(project_path)
run_analysis(project_path;config)
benchmark_cold_vs_warm(project_path;runs)
print_summary(results)
main()
benchmarks/benchmark_performance.py:
e: save_report,create_test_project,benchmark_original_analyzer,benchmark_streaming_analyzer,benchmark_with_strategies,print_comparison,main
save_report(results;filename)
create_test_project(size)
benchmark_original_analyzer(project_path;runs)
benchmark_streaming_analyzer(project_path;runs)
benchmark_with_strategies(project_path)
print_comparison(original;streaming)
main()
benchmarks/format_evaluator.py:
e: _detect_problems,_detect_pipelines,_detect_hub_types,_check_structural_features,evaluate_format,FormatScore
FormatScore: # Wynik oceny pojedynczego formatu.
_detect_problems(content)
_detect_pipelines(content)
_detect_hub_types(content)
_check_structural_features(content)
evaluate_format(name;content;path)
benchmarks/project_generator.py:
e: create_core_py,create_etl_py,create_validation_py,create_utils_py,add_validator_to_core,create_ground_truth_project
create_core_py(project)
create_etl_py(project)
create_validation_py(project)
create_utils_py(project)
add_validator_to_core(project)
create_ground_truth_project(base_dir)
benchmarks/reporting.py:
e: _print_header,_print_scores_table,_print_problems_detail,_print_pipelines_detail,_print_structural_features,_print_gap_analysis,print_results,build_report,save_report
_print_header()
_print_scores_table(scores)
_print_problems_detail(scores)
_print_pipelines_detail(scores)
_print_structural_features(scores)
_print_gap_analysis(scores)
print_results(scores)
build_report(scores)
save_report(report;filename)
benchmarks/test_performance.py:
e: save_test_report,TestPerformanceBenchmarks,TestMemoryBenchmarks
TestPerformanceBenchmarks: large_project(0),test_fast_mode_performance(1),test_caching_performance(1),test_parallel_vs_sequential(1),test_scaling_with_project_size(1) # Performance benchmark tests.
TestMemoryBenchmarks: test_memory_usage_stays_bounded(1) # Memory usage benchmarks.
save_test_report(results;test_name)
code2llm/__init__.py:
e: __getattr__
__getattr__(name)
code2llm/__main__.py:
code2llm/analysis/__init__.py:
e: __getattr__
__getattr__(name)
code2llm/analysis/call_graph.py:
e: CallGraphExtractor
CallGraphExtractor: __init__(1),extract(3),_calculate_metrics(0),visit_Import(1),visit_ImportFrom(1),visit_ClassDef(1),visit_FunctionDef(1),visit_AsyncFunctionDef(1),visit_Call(1),_resolve_call(1),_resolve_with_astroid(1),_expr_to_str(1) # Extract call graph from AST.
code2llm/analysis/cfg.py:
e: CFGExtractor
CFGExtractor: __init__(1),extract(3),new_node(2),connect(4),visit_FunctionDef(1),visit_AsyncFunctionDef(1),visit_If(1),visit_For(1),visit_While(1),visit_Try(1),visit_Assign(1),visit_Return(1),visit_Expr(1),_extract_condition(1),_expr_to_str(1),_format_except(1) # Extract Control Flow Graph from AST.
code2llm/analysis/coupling.py:
e: CouplingAnalyzer
CouplingAnalyzer: __init__(1),analyze(0),_analyze_module_interactions(0),_detect_data_leakage(0),_detect_shared_state(0) # Analyze coupling between modules.
code2llm/analysis/data_analysis.py:
e: _categorize_functions,_make_stage,DataAnalyzer,DataFlowAnalyzer,OptimizationAdvisor
DataAnalyzer: analyze_data_flow(1),analyze_data_structures(1),_find_data_pipelines(1),_find_state_patterns(1),_find_data_dependencies(1),_find_event_flows(1),_detect_types_from_name(2),_create_type_entry(4),_update_type_stats(4),_analyze_data_types(1),_infer_parameter_types(1),_infer_return_types(1),_build_data_flow_graph(1),_get_function_data_types(1),_identify_process_patterns(1),_analyze_optimization_opportunities(3) # Analyze data flows, structures, and optimization opportuniti
DataFlowAnalyzer: analyze(1),find_data_pipelines(1),find_state_patterns(1),find_data_dependencies(1),find_event_flows(1) # Analyze data flows: pipelines, state patterns, dependencies,
OptimizationAdvisor: analyze(1),analyze_data_types(1),build_data_flow_graph(1),identify_process_patterns(1),analyze_optimization_opportunities(3) # Analyze optimization opportunities: data types and process p
_categorize_functions(result)
_make_stage(label;func_name;func)
code2llm/analysis/dfg.py:
e: DFGExtractor
DFGExtractor: __init__(1),extract(3),visit_FunctionDef(1),visit_Assign(1),visit_AugAssign(1),visit_For(1),visit_Call(1),_extract_targets(1),_get_names(1),_extract_names(1),_expr_to_str(1),_build_data_flow_edges(0) # Extract Data Flow Graph from AST.
code2llm/analysis/pipeline_classifier.py:
e: PipelineClassifier
PipelineClassifier: __init__(1),classify_domain(2),derive_pipeline_name(3),get_entry_type(1),get_exit_type(1) # Classify pipelines by domain and derive human-readable names
code2llm/analysis/pipeline_detector.py:
e: PipelineStage,Pipeline,PipelineDetector
PipelineStage: # A single stage in a detected pipeline.
Pipeline: purity_ratio(0),to_dict(0) # A detected pipeline with stages, purity info, and domain.
PipelineDetector: __init__(2),detect(2),_build_graph(1),_find_pipeline_paths(1),_longest_path_from(3),_longest_path_in_dag(1),_build_pipelines(3),_build_stages(3) # Detect pipelines in a codebase using networkx graph analysis
code2llm/analysis/pipeline_resolver.py:
e: PipelineResolver
PipelineResolver: resolve(3),_strip_self_prefix(1),_try_same_class_resolution(3),_get_suffix_candidates(2),_select_same_class_candidate(3) # Resolves callee names to qualified function names.
code2llm/analysis/side_effects.py:
e: SideEffectInfo,SideEffectDetector
SideEffectInfo: __init__(2),is_pure(0),side_effect_summary(0),to_dict(0) # Side-effect analysis result for a single function.
SideEffectDetector: __init__(1),analyze_function(1),analyze_all(1),get_purity_score(1),_scan_node(2),_check_calls(2),_check_assignments(2),_check_globals(2),_check_yield(2),_check_delete(2),_classify(1),_heuristic_classify(2),_get_call_name(1) # Detect side effects in Python functions via AST analysis.
code2llm/analysis/smells.py:
e: SmellDetector
SmellDetector: __init__(1),detect(0),_detect_god_functions(0),_detect_god_modules(0),_detect_feature_envy(0),_detect_data_clumps(0),_detect_shotgun_surgery(0),_detect_bottlenecks(0),_detect_circular_dependencies(0) # Detect code smells from analysis results.
code2llm/analysis/type_inference.py:
e: TypeInferenceEngine
TypeInferenceEngine: __init__(1),enrich_function(1),get_arg_types(1),get_return_type(1),get_typed_signature(1),extract_all_types(1),_extract_from_node(2),_extract_args(1),_annotation_to_str(1),_ann_constant(1),_ann_name(1),_ann_attribute(1),_ann_subscript(1),_ann_tuple(1),_ann_binop(1),_infer_from_name(1),_infer_arg_type(2) # Extract and infer type information from Python source files.
code2llm/analysis/utils/__init__.py:
code2llm/analysis/utils/ast_helpers.py:
e: get_ast,find_function_node,ast_unparse,qualified_name,expr_to_str
get_ast(filepath;registry)
find_function_node(tree;name;line)
ast_unparse(node;default_none)
qualified_name(module_name;class_stack;name)
expr_to_str(node)
code2llm/api.py:
e: analyze,analyze_file
analyze(project_path;config)
analyze_file(file_path;config)
code2llm/cli.py:
e: main
main()
code2llm/cli_analysis.py:
e: _run_analysis,_run_standard_analysis,_build_config,_print_analysis_summary,_run_chunked_analysis,_print_chunked_plan,_filter_subprojects,_analyze_all_subprojects,_analyze_subproject,_merge_chunked_results,_run_streaming_analysis
_run_analysis(args;source_path;output_dir)
_run_standard_analysis(args;source_path;output_dir)
_build_config(args;output_dir)
_print_analysis_summary(result)
_run_chunked_analysis(args;source_path;output_dir)
_print_chunked_plan(subprojects)
_filter_subprojects(args;subprojects)
_analyze_all_subprojects(args;subprojects;output_dir)
_analyze_subproject(args;subproject;output_dir)
_merge_chunked_results(all_results;source_path)
_run_streaming_analysis(args;config;source_path)
code2llm/cli_commands.py:
e: handle_special_commands,handle_cache_command,handle_report_command,validate_and_setup,print_start_info,validate_chunked_output,_get_chunk_dirs,_validate_chunks,_validate_single_chunk,_get_file_sizes,_print_chunk_errors,_print_validation_summary,generate_llm_context
handle_special_commands()
handle_cache_command(args_list)
handle_report_command(args_list)
validate_and_setup(args)
print_start_info(args;source_path;output_dir)
validate_chunked_output(output_dir;args)
_get_chunk_dirs(output_dir)
_validate_chunks(chunk_dirs;required_files)
_validate_single_chunk(chunk_dir;required_files)
_get_file_sizes(chunk_dir;required_files)
_print_chunk_errors(chunk_name;chunk_issues)
_print_validation_summary(chunk_dirs;valid_chunks;issues)
generate_llm_context(args_list)
code2llm/cli_exports/__init__.py:
code2llm/cli_exports/code2logic.py:
e: _export_code2logic,_should_run_code2logic,_check_code2logic_installed,_build_code2logic_cmd,_run_code2logic,_handle_code2logic_error,_find_code2logic_output,_normalize_code2logic_output
_export_code2logic(args;source_path;output_dir;formats)
_should_run_code2logic(formats)
_check_code2logic_installed()
_build_code2logic_cmd(args;source_path;output_dir)
_run_code2logic(cmd;verbose)
_handle_code2logic_error(res;cmd)
_find_code2logic_output(output_dir;res)
_normalize_code2logic_output(found;target;args)
code2llm/cli_exports/formats.py:
e: _export_evolution,_export_data_structures,_export_context_fallback,_export_readme,_export_project_yaml,_export_project_toon,_run_report,_export_simple_formats,_export_yaml,_export_mermaid_pngs,_export_calls_format,_export_calls,_export_calls_toon,_export_mermaid,_export_refactor_prompts,_export_index_html
_export_evolution(args;result;output_dir)
_export_data_structures(args;result;output_dir)
_export_context_fallback(args;result;output_dir;formats)
_export_readme(args;result;output_dir)
_export_project_yaml(args;result;output_dir)
_export_project_toon(args;result;output_dir)
_run_report(args;project_yaml_path;output_dir)
_export_simple_formats(args;result;output_dir;formats)
_export_yaml(args;result;output_dir)
_export_mermaid_pngs(args;output_dir)
_export_calls_format(args;result;output_dir;toon)
_export_calls(args;result;output_dir)
_export_calls_toon(args;result;output_dir)
_export_mermaid(args;result;output_dir)
_export_refactor_prompts(args;result;output_dir)
_export_index_html(args;output_dir)
code2llm/cli_exports/orchestrator.py:
e: _build_export_config,_collect_dry_run_files,_show_dry_run_plan,_run_exports,_copy_cached_export,_touch_recursive,_copy_to_cache,_expand_all_formats,_export_single,_export_registry_formats,_get_format_kwargs,_export_chunked,_inject_generation_time
_build_export_config(args;formats)
_collect_dry_run_files(formats;output_dir)
_show_dry_run_plan(formats;output_dir;is_chunked;result)
_run_exports(args;result;output_dir;source_path)
_copy_cached_export(cached_dir;output_dir;verbose)
_touch_recursive(path)
_copy_to_cache(output_dir;cache_dir;verbose)
_expand_all_formats(requested;include_png)
_export_single(args;result;output_dir;formats;requested_formats;source_path)
_export_registry_formats(args;result;output_dir;formats)
_get_format_kwargs(fmt;args)
_export_chunked(args;result;output_dir;source_path;formats;requested_formats)
_inject_generation_time(filepath;elapsed)
code2llm/cli_exports/orchestrator_chunked.py:
e: _export_chunked,_get_filtered_subprojects,_process_subproject
_export_chunked(args;result;output_dir;source_path;formats;requested_formats)
_get_filtered_subprojects(args;source_path)
_process_subproject(args;sp;output_dir)
code2llm/cli_exports/orchestrator_constants.py:
code2llm/cli_exports/orchestrator_handlers.py:
e: _export_mermaid,_export_mermaid_pngs,_export_calls,_export_context_fallback,_export_data_structures,_export_project_toon,_export_readme,_export_index_html
_export_mermaid(args;result;output_dir)
_export_mermaid_pngs(args;output_dir)
_export_calls(args;result;output_dir;formats)
_export_context_fallback(args;result;output_dir)
_export_data_structures(args;result;output_dir)
_export_project_toon(args;result;output_dir)
_export_readme(args;result;output_dir)
_export_index_html(args;output_dir)
code2llm/cli_exports/prompt.py:
e: _export_prompt_txt,_export_chunked_prompt_txt,_get_prompt_paths,_build_prompt_header,_find_existing_prompt_file,_build_prompt_file_lines,_build_main_files_section,_build_optional_files_section,_format_size,_get_missing_files,_build_subprojects_section,_build_missing_files_section,_analyze_generated_files,_build_dynamic_focus_areas,_build_dynamic_tasks,_build_priority_order,_build_strategy_section,_build_prompt_footer
_export_prompt_txt(args;output_dir;formats;source_path)
_export_chunked_prompt_txt(args;output_dir;formats;source_path;subprojects)
_get_prompt_paths(source_path;output_dir)
_build_prompt_header(project_path)
_find_existing_prompt_file(output_dir;candidates)
_build_prompt_file_lines(output_dir;output_rel_path;files)
_build_main_files_section(output_dir;output_rel_path)
_build_optional_files_section(output_dir;output_rel_path)
_format_size(size_bytes)
_get_missing_files(output_dir)
_build_subprojects_section(subprojects;output_dir;output_rel_path)
_build_missing_files_section(output_dir;output_rel_path)
_analyze_generated_files(output_dir;subprojects)
_build_dynamic_focus_areas(file_analysis)
_build_dynamic_tasks(file_analysis)
_build_priority_order(file_analysis)
_build_strategy_section(file_analysis)
_build_prompt_footer(chunked;file_analysis)
code2llm/cli_parser.py:
e: get_version,create_parser
get_version()
create_parser()
code2llm/core/__init__.py:
e: __getattr__
__getattr__(name)
code2llm/core/analyzer.py:
e: ProjectAnalyzer
ProjectAnalyzer: __init__(2),analyze_project(1),_resolve_project_path(1),_load_from_persistent_cache(2),_run_analysis(1),_store_to_persistent_cache(3),_build_stats(4),_print_summary(1),_post_process(4),_should_collect_file(4),_compute_module_name(3),_collect_files(1),_analyze_parallel(1),_analyze_sequential(1),_merge_results(2),_build_simple_name_map(1),_resolve_call(4),_collect_call_edges(2),_find_entry_points(1),_build_call_graph(1),analyze_files(2),_detect_patterns(1) # Main analyzer with parallel processing.
code2llm/core/ast_registry.py:
e: ASTRegistry
ASTRegistry: __init__(0),get_global(1),reset_global(1),get_ast(1),get_source(1),invalidate(1),clear(0),__len__(0),__repr__(0) # Parse each file exactly once; share the AST across all analy
code2llm/core/config.py:
e: _get_optimal_workers,AnalysisMode,PerformanceConfig,FilterConfig,DepthConfig,OutputConfig,Config
AnalysisMode: # Available analysis modes.
PerformanceConfig: get_workers(0),apply_fast_mode(0) # Performance optimization settings.
FilterConfig: # Filtering options to reduce analysis scope.
DepthConfig: # Depth limiting for control flow analysis.
OutputConfig: # Output formatting options.
Config: # Analysis configuration with performance optimizations.
_get_optimal_workers(default;max_per_gb)
code2llm/core/export_pipeline.py:
e: SharedExportContext,ExportPipeline
SharedExportContext: __init__(1),result(0),functions(0),classes(0),modules(0),entry_points(0),metrics_summary(0),complexity_distribution(0),call_graph_edges(0),high_complexity_functions(0),_compute_metrics_summary(0),_compute_cc_distribution(0) # Pre-computed context shared across all exporters.
ExportPipeline: __init__(1),context(0),run(2) # Run multiple exporters with a single shared context.
code2llm/core/file_analyzer.py:
e: _analyze_single_file,FileAnalyzer
FileAnalyzer: __init__(2),_route_to_language_analyzer(4),analyze_file(2),_analyze_python(3),_analyze_ast(4),_calculate_complexity(3),_perform_deep_analysis(4),_process_class(4),_process_function(5),_build_cfg(4),_process_cfg_block(8),_process_if_stmt(8),_process_loop_stmt(7),_process_return_stmt(6),_get_base_name(1),_get_decorator_name(1),_get_call_name(1) # Analyzes a single file.
_analyze_single_file(args)
code2llm/core/file_cache.py:
e: make_cache_key,FileCache
FileCache: __init__(2),_get_cache_key_stat(1),_get_cache_key(2),_get_cache_path(1),get(2),put(3),get_fast(1),put_fast(2),clear(0) # Cache for parsed AST files.
make_cache_key(file_path;content)
code2llm/core/file_filter.py:
e: FastFileFilter
FastFileFilter: __init__(2),should_skip_dir(1),_passes_gitignore(1),_passes_excludes(2),_passes_includes(1),should_process(1),_passes_line_count(1),_passes_visibility(3),should_skip_function(4) # Fast file filtering with pattern matching.
code2llm/core/gitignore.py:
e: load_gitignore_patterns,_GitIgnoreEntry,GitIgnoreParser
_GitIgnoreEntry: __init__(3) # Single parsed gitignore rule.
GitIgnoreParser: __init__(1),_load_gitignore(1),_parse_entry(1),_pattern_to_regex(2),is_ignored(2) # Parse and apply .gitignore patterns to file paths.
load_gitignore_patterns(project_path)
code2llm/core/incremental.py:
e: _file_signature,IncrementalAnalyzer
IncrementalAnalyzer: __init__(1),needs_analysis(1),get_cached_result(1),update(2),invalidate(1),save(0),clear(0),cached_count(0),_load_cache(0),_normalize_key(1) # Track file signatures to skip unchanged files on subsequent
_file_signature(filepath)
code2llm/core/lang/__init__.py:
e: register_language,get_parser,list_parsers,LanguageParser
LanguageParser: analyze(4),can_parse(1) # Abstract base class for language-specific parsers.
register_language()
get_parser(extension)
list_parsers()
code2llm/core/lang/base.py:
e: extract_function_body,calculate_complexity_regex,_resolve_call,extract_calls_regex,_extract_declarations,_update_brace_tracking,_process_decorators,_process_classes,_process_standalone_function,_match_method_name,_process_class_method,_process_functions,_clear_orphaned_decorators,analyze_c_family
extract_function_body(content;start_line)
calculate_complexity_regex(content;result;lang)
_resolve_call(simple_call;func_qname;module_name;known_simple;calls_seen;func_info)
extract_calls_regex(content;module_name;result)
_extract_declarations(content;file_path;module_name;patterns;stats;lang_config)
_update_brace_tracking(raw_line;brace_depth;current_class;class_brace_depth;track_braces)
_process_decorators(decorator_re;line;pending_decorators)
_process_classes(class_re;interface_re;line;line_no;file_path;module_name;result;stats;current_class;class_brace_depth;pending_decorators)
_process_standalone_function(func_re;arrow_re;line;line_no;file_path;module_name;result;stats;pending_decorators;reserved)
_match_method_name(arrow_prop_re;method_re;func_re;line;reserved)
_process_class_method(method_re;arrow_prop_re;func_re;line;line_no;file_path;module_name;result;stats;current_class;pending_decorators;reserved)
_process_functions(func_re;arrow_re;method_re;arrow_prop_re;line;line_no;file_path;module_name;result;stats;current_class;pending_decorators;reserved)
_clear_orphaned_decorators(line;pending_decorators;func_re;arrow_re;class_re;interface_re;method_re)
analyze_c_family(content;file_path;module_name;stats;patterns;lang_config;cc_lang;ext)
code2llm/core/lang/cpp.py:
e: analyze_cpp
analyze_cpp(content;file_path;module_name;ext;stats)
code2llm/core/lang/csharp.py:
e: analyze_csharp
analyze_csharp(content;file_path;module_name;ext;stats)
code2llm/core/lang/generic.py:
e: analyze_generic
analyze_generic(content;file_path;module_name;ext;stats)
code2llm/core/lang/go_lang.py:
e: _analyze_go_regex,analyze_go
_analyze_go_regex(content;file_path;module_name;stats)
analyze_go(content;file_path;module_name;ext;stats)
code2llm/core/lang/java.py:
e: analyze_java
analyze_java(content;file_path;module_name;ext;stats)
code2llm/core/lang/php.py:
e: _parse_php_metadata,_adjust_qualified_names,_extract_php_traits,analyze_php
_parse_php_metadata(content;module_name;result)
_adjust_qualified_names(result;module_name;namespace)
_extract_php_traits(content;file_path;module_name;namespace;result;stats)
analyze_php(content;file_path;module_name;ext;stats)
code2llm/core/lang/ruby.py:
e: _extract_ruby_body,_adjust_ruby_module_qualnames,analyze_ruby,RubyParser
RubyParser: analyze(4) # Ruby language parser - registered via @register_language in
_extract_ruby_body(content;start_line)
_adjust_ruby_module_qualnames(result;module_name;current_module)
analyze_ruby(content;file_path;module_name;ext;stats)
code2llm/core/lang/rust.py:
e: analyze_rust
analyze_rust(content;file_path;module_name;ext;stats)
code2llm/core/lang/ts_extractors.py:
e: _get_node_text,_find_name_node,_extract_functions_ts,_extract_classes_ts,extract_declarations_ts
_get_node_text(node;source_bytes)
_find_name_node(node)
_extract_functions_ts(tree;source_bytes;lang;module_name;file_path)
_extract_classes_ts(tree;source_bytes;lang;module_name;file_path)
extract_declarations_ts(tree;source_bytes;ext;file_path;module_name)
code2llm/core/lang/ts_parser.py:
e: _init_tree_sitter,_get_language,_get_parser,get_parser,parse_source,is_available,TreeSitterParser
TreeSitterParser: __init__(0),available(0),parse(2),supports(1) # Unified tree-sitter parser for all supported languages.
_init_tree_sitter()
_get_language(ext)
_get_parser(ext)
get_parser()
parse_source(content;ext)
is_available()
code2llm/core/lang/typescript.py:
e: get_typescript_patterns,get_typescript_lang_config,analyze_typescript_js
get_typescript_patterns()
get_typescript_lang_config()
analyze_typescript_js(content;file_path;module_name;ext;stats)
code2llm/core/large_repo.py:
e: should_use_chunking,get_analysis_plan,SubProject,HierarchicalRepoSplitter
SubProject: estimated_size_kb(0),file_count(0) # Represents a sub-project within a larger repository.
HierarchicalRepoSplitter: __init__(2),get_analysis_plan(1),_split_hierarchically(1),_merge_small_l1_dirs(2),_split_level2_consolidated(3),_categorize_subdirs(2),_process_large_dirs(3),_process_level1_files(2),_merge_small_dirs(3),_chunk_by_files(5),_collect_files_in_dir(2),_collect_files_recursive(2),_collect_root_files(1),_count_py_files(1),_contains_python_files(1),_should_skip_file(1),_calculate_priority(2),_get_level1_dirs(1) # Splits large repositories using hierarchical approach.
should_use_chunking(project_path;size_threshold_kb)
get_analysis_plan(project_path;size_limit_kb)
code2llm/core/models.py:
e: BaseModel,FlowNode,FlowEdge,FunctionInfo,ClassInfo,ModuleInfo,Pattern,CodeSmell,Mutation,DataFlow,AnalysisResult
BaseModel: to_dict(1),_filter_compact(1) # Base class for models with automated serialization.
FlowNode: # Represents a node in the control flow graph.
FlowEdge: # Represents an edge in the control flow graph.
FunctionInfo: # Information about a function/method.
ClassInfo: # Information about a class.
ModuleInfo: # Information about a module/package.
Pattern: # Detected behavioral pattern.
CodeSmell: # Represents a detected code smell.
Mutation: # Represents a mutation of a variable/object.
DataFlow: # Represents data flow for a variable.
AnalysisResult: get_function_count(0),get_class_count(0),get_node_count(0),get_edge_count(0) # Complete analysis result for a project.
code2llm/core/persistent_cache.py:
e: _pack,_unpack,get_all_projects,clear_all,PersistentCache
PersistentCache: __init__(4),content_hash(1),get_file_result(1),put_file_result(2),get_changed_files(1),prune_missing(1),get_export_cache_dir(1),create_export_cache_dir(1),mark_export_complete(1),save(0),cache_size_mb(0),_cleanup_stale_exports(1),_cleanup_orphaned_files(2),auto_cleanup(1),gc(2),clear(0),_load_manifest(0),_compute_run_hash(1) # Content-addressed persistent cache stored in ~/.code2llm/.
_pack(obj)
_unpack(data)
get_all_projects(cache_root)
clear_all(cache_root)
code2llm/core/refactoring.py:
e: RefactoringAnalyzer
RefactoringAnalyzer: __init__(2),perform_refactoring_analysis(1),_build_call_graph(1),_calculate_centrality(2),_detect_cycles(2),_detect_communities(2),_analyze_coupling(1),_detect_smells(1),_detect_dead_code(1),_map_dead_code_to_items(2),_mark_reachable_items(1) # Performs refactoring analysis on code.
code2llm/core/repo_files.py:
e: _get_gitignore_parser,should_skip_file,collect_files_in_dir,collect_root_files,count_py_files,contains_python_files,get_level1_dirs,calculate_priority
_get_gitignore_parser(project_path)
should_skip_file(file_str;project_path;gitignore_parser)
collect_files_in_dir(dir_path;project_path)
collect_root_files(project_path)
count_py_files(path)
contains_python_files(dir_path)
get_level1_dirs(project_path)
calculate_priority(name;level)
code2llm/core/streaming/__init__.py:
code2llm/core/streaming/cache.py:
e: StreamingFileCache
StreamingFileCache: __init__(2),_get_cache_key(2),_evict_if_needed(0),get(2),put(3) # Memory-efficient cache with LRU eviction.
code2llm/core/streaming/incremental.py:
e: StreamingIncrementalAnalyzer
StreamingIncrementalAnalyzer: __init__(1),_load_state(0),_save_state(1),get_changed_files(1),_get_module_name(2) # Incremental analysis with change detection for streaming ana
code2llm/core/streaming/prioritizer.py:
e: FilePriority,SmartPrioritizer
FilePriority: # Priority scoring for file analysis order.
SmartPrioritizer: __init__(1),prioritize_files(2),_build_import_graph(1),_check_has_main(1) # Smart file prioritization for optimal analysis order.
code2llm/core/streaming/scanner.py:
e: StreamingScanner
StreamingScanner: __init__(2),quick_scan_file(1),deep_analyze_file(1),build_call_graph_streaming(1),select_important_files(2),collect_files(1) # Handles file scanning operations.
code2llm/core/streaming/strategies.py:
e: ScanStrategy
ScanStrategy: # Scanning methodology configuration.
code2llm/core/streaming_analyzer.py:
e: StreamingAnalyzer
StreamingAnalyzer: __init__(2),set_progress_callback(1),cancel(0),analyze_streaming(2),_estimate_eta(3),_report_progress(4) # Memory-efficient streaming analyzer with progress tracking.
code2llm/core/toon_size_manager.py:
e: get_file_size_kb,should_split_toon,split_toon_file,_parse_modules,_split_by_modules,_split_by_lines,_write_chunk,manage_toon_size
get_file_size_kb(filepath)
should_split_toon(filepath;max_kb)
split_toon_file(source_file;output_dir;max_kb;prefix)
_parse_modules(content)
_split_by_modules(source_file;output_dir;modules;max_kb;prefix)
_split_by_lines(source_file;output_dir;max_kb;prefix)
_write_chunk(output_dir;prefix;chunk_num;content)
manage_toon_size(source_file;output_dir;max_kb;prefix;verbose)
code2llm/exporters/__init__.py:
code2llm/exporters/article_view.py:
e: ArticleViewGenerator
ArticleViewGenerator: _render(1),_render_frontmatter(1),_render_health_summary(2),_render_alerts(1),_render_hotspots(1),_render_roadmap(1),_render_evolution(1),_render_footer(0) # Generate status.md — publishable project health article.
code2llm/exporters/base.py:
e: export_format,get_exporter,list_exporters,BaseExporter,ViewGeneratorMixin
BaseExporter: export(2),generate(2),_ensure_dir(1),_write_text(2) # Abstract base class for all code2llm exporters.
ViewGeneratorMixin: generate(2) # Mixin providing the shared ``generate`` implementation for v
export_format(name;description;extension;supports_project_yaml)
get_exporter(name)
list_exporters()
code2llm/exporters/context_exporter.py:
e: ContextExporter
ContextExporter: export(2),_get_overview(1),_detect_languages(1),_get_architecture_by_module(1),_get_important_entries(1),_get_key_entry_points(1),_get_process_flows(2),_get_key_classes(1),_get_data_transformations(1),_get_behavioral_patterns(1),_get_api_surface(1),_get_system_interactions(1),_group_calls_by_module(2),_format_sub_flow(3),_trace_flow(5) # Export LLM-ready analysis summary with architecture and flow
code2llm/exporters/context_view.py:
e: ContextViewGenerator
ContextViewGenerator: _render(1),_render_overview(2),_render_architecture(1),_render_exports(1),_render_hotspots(1),_render_refactoring(1),_render_guidelines(0) # Generate context.md from project.yaml data.
code2llm/exporters/dashboard_data.py:
e: DashboardDataBuilder
DashboardDataBuilder: health_verdict(1),build_evolution_section(1),build_language_breakdown(1),build_module_lines_chart(1),build_module_funcs_chart(1),build_top_modules_html(1),build_alerts_html(1),build_hotspots_html(1),build_refactoring_html(1) # Build dashboard data structures from project analysis result
code2llm/exporters/dashboard_renderer.py:
e: DashboardRenderer
DashboardRenderer: render(17),_assemble_html(0),_render_evolution_section(1),_render_evolution_script(1) # Render HTML dashboard from prepared data structures.
code2llm/exporters/evolution/__init__.py:
code2llm/exporters/evolution/computation.py:
e: compute_func_data,scan_file_sizes,aggregate_file_stats,make_relative_path,filter_god_modules,compute_god_modules,compute_hub_types,build_context
compute_func_data(result)
scan_file_sizes(project_path)
aggregate_file_stats(result;file_lines)
make_relative_path(fpath;project_path)
filter_god_modules(file_stats;project_path)
compute_god_modules(result)
compute_hub_types(result)
build_context(result)
code2llm/exporters/evolution/constants.py:
code2llm/exporters/evolution/exclusion.py:
e: is_excluded
is_excluded(path)
code2llm/exporters/evolution/render.py:
e: render_header,render_next,render_risks,render_metrics_target,render_patterns,render_history
render_header(ctx)
render_next(ctx)
render_risks(ctx)
render_metrics_target(ctx)
render_patterns(ctx)
render_history(ctx;output_path)
code2llm/exporters/evolution/yaml_export.py:
e: export_to_yaml
export_to_yaml(result;output_path)
code2llm/exporters/evolution_exporter.py:
e: EvolutionExporter
EvolutionExporter: _is_excluded(1),export(2),export_to_yaml(2) # Export evolution.toon.yaml — prioritized refactoring queue.
code2llm/exporters/flow_constants.py:
e: is_excluded_path
is_excluded_path(path)
code2llm/exporters/flow_exporter.py:
e: FlowExporter
FlowExporter: __init__(0),export(2),_build_context(1),_pipeline_to_dict(1),_compute_transforms(1),_transform_label(2),_compute_type_usage(2),_normalize_type(1),_type_label(3),_classify_side_effects(2),_compute_contracts(4),_build_stage_contract(4),_infer_invariant(2),_is_excluded(1) # Export to flow.toon — data-flow focused format.
code2llm/exporters/flow_renderer.py:
e: FlowRenderer
FlowRenderer: render_header(1),render_pipelines(1),render_transforms(1),render_contracts(1),render_data_types(1),render_side_effects(1) # Renderer dla sekcji formatu flow.toon.
code2llm/exporters/html_dashboard.py:
e: HTMLDashboardGenerator
HTMLDashboardGenerator: __init__(0),generate(2),_render(1) # Generate dashboard.html from project.yaml data.
code2llm/exporters/index_generator/__init__.py:
e: generate_index_html,IndexHTMLGenerator
IndexHTMLGenerator: __init__(1),generate(0),scan_files(0),render_html(1) # Generate index.html for browsing all generated files.
generate_index_html(output_dir)
code2llm/exporters/index_generator/renderer.py:
e: HTMLRenderer
HTMLRenderer: render(1) # Render the index.html page with CSS and JavaScript.
code2llm/exporters/index_generator/scanner.py:
e: get_file_types,get_default_file_info,FileScanner
FileScanner: __init__(1),scan(0),_read_file_content(2),_escape_html(1),_format_size(1) # Scan output directory and collect file metadata.
get_file_types()
get_default_file_info(ext)
code2llm/exporters/index_generator.py:
code2llm/exporters/json_exporter.py:
e: JSONExporter
JSONExporter: export(4) # Export to JSON format.
code2llm/exporters/llm_exporter.py:
code2llm/exporters/map/__init__.py:
code2llm/exporters/map/alerts.py:
e: build_alerts,build_hotspots,load_evolution_trend,_read_previous_cc_avg
build_alerts(funcs)
build_hotspots(funcs)
load_evolution_trend(evolution_path;current_cc)
_read_previous_cc_avg(evolution_path)
code2llm/exporters/map/details.py:
e: render_details,_rank_modules,_render_map_module,_render_map_class,_function_signature
render_details(result;is_excluded_path)
_rank_modules(result;is_excluded_path)
_render_map_module(result;mi;lines;is_excluded_path)
_render_map_class(result;ci;lines)
_function_signature(fi)
code2llm/exporters/map/header.py:
e: render_header,_render_stats_line,_render_alerts_line,_render_hotspots_line
render_header(result;output_path;is_excluded_path)
_render_stats_line(funcs;files;total_lines;lang_str)
_render_alerts_line(funcs)
_render_hotspots_line(funcs)
code2llm/exporters/map/module_list.py:
e: render_module_list
render_module_list(result;is_excluded_path)
code2llm/exporters/map/utils.py:
e: rel_path,file_line_count,count_total_lines,detect_languages
rel_path(fpath;project_path)
file_line_count(fpath)
count_total_lines(result;is_excluded_path)
detect_languages(result;is_excluded_path)
code2llm/exporters/map/yaml_export.py:
e: export_to_yaml,_build_module_entry,_build_module_exports,_build_module_classes_data,_build_module_functions_data
export_to_yaml(result;output_path;is_excluded_path)
_build_module_entry(mi;result;is_excluded_path)
_build_module_exports(mi;result)
_build_module_classes_data(mi;result)
_build_module_functions_data(mi;result)
code2llm/exporters/map_exporter.py:
e: MapExporter
MapExporter: export(2),export_to_yaml(2) # Export to map.toon.yaml — structural map with a compact proj
code2llm/exporters/mermaid/__init__.py:
code2llm/exporters/mermaid/calls.py:
e: export_calls
export_calls(result;output_path)
code2llm/exporters/mermaid/classic.py:
e: export_classic,_render_subgraphs,_render_edges,_render_cc_styles
export_classic(result;output_path)
_render_subgraphs(result;lines)
_render_edges(result;lines;name_index;limit)
_render_cc_styles(result;lines)
code2llm/exporters/mermaid/compact.py:
e: export_compact
export_compact(result;output_path)
code2llm/exporters/mermaid/flow_compact.py:
e: should_skip_module,is_entry_point,build_callers_graph,find_leaves,_longest_path_dfs,_select_longest_path,find_critical_path,export_flow_compact
should_skip_module(module;include_examples)
is_entry_point(func_name;fi;result)
build_callers_graph(result;name_index)
find_leaves(result;name_index)
_longest_path_dfs(result;start;visited;name_index)
_select_longest_path(result;entry_points;name_index)
find_critical_path(result;entry_points)
export_flow_compact(result;output_path;include_examples)
code2llm/exporters/mermaid/flow_detailed.py:
e: export_flow_detailed
export_flow_detailed(result;output_path;include_examples)
code2llm/exporters/mermaid/flow_full.py:
e: export_flow_full
export_flow_full(result;output_path;include_examples)
code2llm/exporters/mermaid/utils.py:
e: readable_id,safe_module,_sanitize_identifier,module_of,build_name_index,resolve_callee,write_file,get_cc
readable_id(name)
safe_module(name)
_sanitize_identifier(name;prefix)
module_of(func_name)
build_name_index(funcs)
resolve_callee(callee;funcs;name_index)
write_file(path;lines)
get_cc(fi)
code2llm/exporters/mermaid_exporter.py:
e: MermaidExporter
MermaidExporter: # Export call graph to Mermaid format.
code2llm/exporters/mermaid_flow_helpers.py:
e: _filtered_functions,_entry_points,_group_functions_by_module,_classify_architecture_module,_group_architecture_functions,_select_key_functions,_append_flow_node,_render_module_subgraphs,_render_flow_edges,_append_entry_styles,_render_flow_styles,_render_architecture_view
_filtered_functions(result;module_of;should_skip_module;include_examples)
_entry_points(filtered_funcs;result;is_entry_point)
_group_functions_by_module(funcs;module_of)
_classify_architecture_module(func_name;module)
_group_architecture_functions(funcs;module_of)
_select_key_functions(func_names;funcs;entry_points;critical_path;get_cc;threshold)
_append_flow_node(lines;func_name;fi;short_len;entry_points;readable_id;get_cc;high_threshold;med_threshold)
_render_module_subgraphs(lines;modules;entry_points;short_len;readable_id;safe_module;get_cc;sort_funcs;max_funcs;high_threshold;med_threshold)
_render_flow_edges(lines;funcs;readable_id;resolve;calls_per_function;limit;name_index)
_append_entry_styles(lines;entry_points;readable_id;entry_limit)
_render_flow_styles(lines;funcs;entry_points;readable_id;get_cc;high_threshold;med_threshold;high_limit;med_limit;entry_limit)
_render_architecture_view(lines;filtered_funcs;entry_points;critical_path;module_of;readable_id;get_cc)
code2llm/exporters/project_yaml/__init__.py:
code2llm/exporters/project_yaml/constants.py:
code2llm/exporters/project_yaml/core.py:
e: ProjectYAMLExporter
ProjectYAMLExporter: export(2),_build_project_yaml(2),_detect_primary_language(1) # Export unified project.yaml — single source of truth for dia
code2llm/exporters/project_yaml/evolution.py:
e: build_evolution,load_previous_evolution
build_evolution(health;total_lines;prev_evolution)
load_previous_evolution(output_path)
code2llm/exporters/project_yaml/health.py:
e: build_health,build_alerts,count_duplicates
build_health(result;modules)
build_alerts(result)
count_duplicates(result)
code2llm/exporters/project_yaml/hotspots.py:
e: build_hotspots,hotspot_note,build_refactoring
build_hotspots(result)
hotspot_note(fi;fan_out)
build_refactoring(result;modules;hotspots)
code2llm/exporters/project_yaml/modules.py:
e: build_modules,group_by_file,compute_module_entry,compute_inbound_deps,build_exports,build_class_export,build_function_exports
build_modules(result;line_counts)
group_by_file(result)
compute_module_entry(fpath;result;line_counts;file_funcs;file_classes)
compute_inbound_deps(funcs;fpath;result)
build_exports(funcs;classes;result)
build_class_export(ci;result)
build_function_exports(funcs;classes)
code2llm/exporters/project_yaml_exporter.py:
code2llm/exporters/readme/__init__.py:
code2llm/exporters/readme/content.py:
e: generate_readme_content
generate_readme_content(project_path;output_dir;total_functions;total_classes;total_modules;insights;core_files_section;llm_files_section;viz_files_section)
code2llm/exporters/readme/files.py:
e: get_existing_files
get_existing_files(output_dir)
code2llm/exporters/readme/insights.py:
e: extract_insights
extract_insights(output_dir)
code2llm/exporters/readme/sections.py:
e: build_core_files_section,build_llm_files_section,build_viz_files_section
build_core_files_section(existing;insights)
build_llm_files_section(existing)
build_viz_files_section(existing)
code2llm/exporters/readme_exporter.py:
e: READMEExporter
READMEExporter: export(2) # Export README.md with documentation of all generated files.
code2llm/exporters/report_generators.py:
e: load_project_yaml
load_project_yaml(path)
code2llm/exporters/toon/__init__.py:
e: ToonExporter
ToonExporter: __init__(0),export(2),export_to_yaml(2),_build_header_dict(1),_build_health_dict(1),_build_refactor_dict(1),_build_pipelines_dict(1),_build_layers_dict(1),_build_coupling_dict(1),_build_external_dict(1),_is_excluded(1) # Export to toon v2 plain-text format — scannable, sorted by s
code2llm/exporters/toon/helpers.py:
e: _rel_path,_package_of,_package_of_module,_traits_from_cfg,_dup_file_set,_hotspot_description,_scan_line_counts,_walk_compat
_rel_path(fpath;project_path)
_package_of(rel_path)
_package_of_module(module_name)
_traits_from_cfg(fi;result)
_dup_file_set(ctx)
_hotspot_description(fi;fan_out)
_scan_line_counts(project_path;result)
_walk_compat(path)
code2llm/exporters/toon/metrics.py:
e: MetricsComputer
MetricsComputer: __init__(0),compute_all_metrics(1),_compute_hotspots(1),_get_cycles(1) # Computes all metrics for TOON export.
code2llm/exporters/toon/metrics_core.py:
e: CoreMetricsComputer
CoreMetricsComputer: __init__(2),compute_file_metrics(1),_new_file_record(2),_build_suffix_index(1),_compute_fan_in(2),compute_package_metrics(2),compute_function_metrics(1),compute_class_metrics(1),compute_coupling_matrix(1),_build_function_to_module_map(1),_build_coupling_matrix(2),_resolve_callee_module(4),_compute_package_fan(1) # Computes core structural and complexity metrics.
code2llm/exporters/toon/metrics_duplicates.py:
e: DuplicatesMetricsComputer
DuplicatesMetricsComputer: __init__(1),detect_duplicates(1),_check_class_for_duplicates(5),_calculate_duplicate_info(7) # Detects duplicate classes in the codebase.
code2llm/exporters/toon/metrics_health.py:
e: HealthMetricsComputer
HealthMetricsComputer: __init__(0),compute_health(1),_check_duplicates_health(2),_check_god_modules_health(2),_check_smells_health(2),_check_high_cc_health(2) # Computes health issues and quality alerts.
code2llm/exporters/toon/module_detail.py:
e: ModuleDetailRenderer
ModuleDetailRenderer: render_details(1),_rank_modules_by_cc(1),_render_module_detail(4),_get_module_exports(2),_render_module_classes(4),_get_method_items(2),_find_root_method(1),_render_standalone_funcs(3),_render_call_chain(5) # Renders detailed module information.
code2llm/exporters/toon/renderer.py:
e: ToonRenderer
ToonRenderer: render_header(1),_detect_language_label(1),render_health(1),render_refactor(1),render_coupling(1),_select_top_packages(2),_render_coupling_header(1),_render_coupling_rows(4),_build_coupling_row(4),_coupling_row_tag(2),_render_coupling_summary(3),render_layers(1),_render_layer_package(5),_render_layer_files(4),_format_layer_file_row(2),_render_zero_line_files(2),render_duplicates(1),render_functions(1),_format_function_row(2),_render_cc_summary(3),render_hotspots(1),render_classes(1),render_pipelines(1),_trace_pipeline(3),_calculate_purity(2),render_external(1) # Renders all sections for TOON export.
code2llm/exporters/toon.py:
code2llm/exporters/toon_view.py:
e: ToonViewGenerator
ToonViewGenerator: _render(1),_render_header(1),_render_health(1),_render_alerts(1),_render_modules(1),_render_hotspots(1),_render_refactoring(1),_render_evolution(1) # Generate project.toon.yaml from project.yaml data.
code2llm/exporters/validate_project.py:
e: validate_project_yaml,_check_required_keys,_cross_check_toon
validate_project_yaml(output_dir;verbose)
_check_required_keys(data)
_cross_check_toon(data;toon_path)
code2llm/exporters/yaml_exporter.py:
e: YAMLExporter
YAMLExporter: __init__(0),_get_name_index(1),export(4),export_grouped(2),export_data_flow(3),export_data_structures(3),export_separated(3),export_split(3),export_calls(4),_collect_edges(3),_process_function_calls(8),_should_add_edge(3),_create_edge(3),_build_nodes(2),_create_node(3),_compute_calls_in_counts(1),_group_by_module(2),_build_calls_data(4),_resolve_callee(2),_get_cc(1),export_calls_toon(4),_render_calls_header(4),_render_hubs(1),_render_modules(3),_render_edges(1) # Export to YAML format.
code2llm/generators/__init__.py:
code2llm/generators/_utils.py:
e: dump_yaml
dump_yaml(data)
code2llm/generators/llm_flow/__init__.py:
code2llm/generators/llm_flow/analysis.py:
e: _node_counts_by_function,_pick_relevant_functions,_summarize_functions,_build_call_graph,_reachable,FuncSummary
FuncSummary:
_node_counts_by_function(nodes)
_pick_relevant_functions()
_summarize_functions(nodes;limit_decisions;limit_calls)
_build_call_graph(func_summaries;known_functions)
_reachable(g;roots;max_nodes)
code2llm/generators/llm_flow/cli.py:
e: create_parser,main
create_parser()
main(argv)
code2llm/generators/llm_flow/generator.py:
e: generate_llm_flow,render_llm_flow_md
generate_llm_flow(analysis;max_functions;limit_decisions;limit_calls)
render_llm_flow_md(flow)
code2llm/generators/llm_flow/nodes.py:
e: _collect_nodes,_group_nodes_by_file,_is_entrypoint_file,_extract_entrypoint_info,_deduplicate_entrypoints,_collect_entrypoints,_collect_functions
_collect_nodes(analysis)
_group_nodes_by_file(nodes)
_is_entrypoint_file(filepath)
_extract_entrypoint_info(node;filepath)
_deduplicate_entrypoints(entrypoints)
_collect_entrypoints(nodes)
_collect_functions(nodes)
code2llm/generators/llm_flow/parsing.py:
e: _parse_call_label,_parse_func_label
_parse_call_label(label)
_parse_func_label(label)
code2llm/generators/llm_flow/utils.py:
e: _strip_bom,_safe_read_yaml,_as_dict,_as_list,_shorten
_strip_bom(text)
_safe_read_yaml(path)
_as_dict(d)
_as_list(v)
_shorten(s;max_len)
code2llm/generators/llm_flow.py:
code2llm/generators/llm_task.py:
e: _strip_bom,_ensure_list,_deep_get,normalize_llm_task,_parse_bullets,_parse_sections,_create_empty_task_data,_apply_simple_sections,_apply_bullet_sections,_parse_acceptance_tests,parse_llm_task_text,_load_yaml,_load_json,load_input,create_parser,main
_strip_bom(text)
_ensure_list(value)
_deep_get(d;path)
normalize_llm_task(data)
_parse_bullets(lines)
_parse_sections(lines)
_create_empty_task_data()
_apply_simple_sections(sections;data)
_apply_bullet_sections(sections;data)
_parse_acceptance_tests(sections)
parse_llm_task_text(text)
_load_yaml(raw;path)
_load_json(raw;path)
load_input(path)
create_parser()
main(argv)
code2llm/generators/mermaid/__init__.py:
code2llm/generators/mermaid/fix.py:
e: _sanitize_label_text,_sanitize_node_id,fix_mermaid_file,_fix_edge_line,_fix_edge_label_pipes,_fix_subgraph_line,_fix_class_line
_sanitize_label_text(txt)
_sanitize_node_id(node_id)
fix_mermaid_file(mmd_path)
_fix_edge_line(line)
_fix_edge_label_pipes(line)
_fix_subgraph_line(line)
_fix_class_line(line)
code2llm/generators/mermaid/png.py:
e: _is_png_fresh,_prepare_and_render,generate_pngs,_setup_puppeteer_config,_build_renderers,_run_mmdc_subprocess,generate_single_png,generate_with_puppeteer
_is_png_fresh(mmd_file;output_dir)
_prepare_and_render(mmd_file;output_dir;timeout)
generate_pngs(input_dir;output_dir;timeout;max_workers)
_setup_puppeteer_config()
_build_renderers(mmd_file;output_file;cfg_path)
_run_mmdc_subprocess(renderers;mmd_file;output_file;timeout;max_text_size;max_edges)
generate_single_png(mmd_file;output_file;timeout)
generate_with_puppeteer(mmd_file;output_file;timeout;max_text_size;max_edges)
code2llm/generators/mermaid/validation.py:
e: validate_mermaid_file,_strip_label_segments,_is_balanced_node_line,_check_bracket_balance,_scan_brackets,_check_node_ids
validate_mermaid_file(mmd_path)
_strip_label_segments(s)
_is_balanced_node_line(line)
_check_bracket_balance(lines;errors)
_scan_brackets(text;line_num;bracket_stack;paren_stack;errors)
_check_node_ids(lines;errors)
code2llm/generators/mermaid.py:
e: run_cli
run_cli()
code2llm/nlp/__init__.py:
code2llm/nlp/config.py:
e: NormalizationConfig,IntentMatchingConfig,EntityResolutionConfig,MultilingualConfig,NLPConfig
NormalizationConfig: # Configuration for query normalization.
IntentMatchingConfig: # Configuration for intent matching.
EntityResolutionConfig: # Configuration for entity resolution.
MultilingualConfig: # Configuration for multilingual processing.
NLPConfig: from_yaml(2),to_yaml(1) # Main NLP pipeline configuration.
code2llm/nlp/entity_resolution.py:
e: Entity,EntityResolutionResult,EntityResolver
Entity: # Resolved entity.
EntityResolutionResult: get_by_type(1),get_best_match(0) # Result of entity resolution.
EntityResolver: __init__(2),resolve(3),_extract_candidates(2),_extract_from_patterns(2),_disambiguate(2),_resolve_hierarchical(1),_resolve_aliases(1),_name_similarity(2),load_from_analysis(1),step_3a_extract_entities(2),step_3b_match_threshold(1),step_3c_disambiguate(2),step_3d_hierarchical_resolve(1),step_3e_alias_resolve(1) # Resolve entities (functions, classes, etc.) from queries.
code2llm/nlp/intent_matching.py:
e: IntentMatch,IntentMatchingResult,IntentMatcher
IntentMatch: # Single intent match result.
IntentMatchingResult: get_best_intent(0),get_confidence(0) # Result of intent matching.
IntentMatcher: __init__(2),match(2),_fuzzy_match(1),_keyword_match(1),_apply_context(3),_combine_matches(1),_resolve_multi_intent(1),_calculate_similarity(2),step_2a_fuzzy_match(2),step_2b_semantic_match(2),step_2c_keyword_match(2),step_2d_context_score(2),step_2e_resolve_intents(1) # Match queries to intents using fuzzy and keyword matching.
code2llm/nlp/normalization.py:
e: NormalizationResult,QueryNormalizer
NormalizationResult: # Result of query normalization.
QueryNormalizer: __init__(1),normalize(2),_unicode_normalize(1),_lowercase(1),_remove_punctuation(1),_normalize_whitespace(1),_remove_stopwords(2),_tokenize(1),step_1a_lowercase(1),step_1b_remove_punctuation(1),step_1c_normalize_whitespace(1),step_1d_unicode_normalize(1),step_1e_remove_stopwords(2) # Normalize queries for consistent processing.
code2llm/nlp/pipeline.py:
e: NlpPipelineStage,NLPPipelineResult,NLPPipeline
NlpPipelineStage: # Single NLP pipeline stage result.
NLPPipelineResult: is_successful(0),get_intent(0),get_entities(0),to_dict(0) # Complete NLP pipeline result (4b-4e aggregation).
NLPPipeline: __init__(1),process(2),_step_normalize(2),_step_match_intent(1),_step_resolve_entities(3),_infer_entity_types(1),_calculate_overall_confidence(1),_calculate_entity_confidence(1),_apply_fallback(1),_format_action(1),_format_response(1),step_4a_orchestrate(1),step_4b_aggregate(1),step_4c_confidence(1),step_4d_fallback(1),step_4e_format(1) # Main NLP processing pipeline (4a-4e).
code2llm/parsers/toon_parser.py:
e: _parse_header_line,_parse_stats_line,_parse_health_line,_parse_functions_line,_parse_classes_line,_parse_hotspots_line,_detect_section,parse_toon_content,is_toon_file,load_toon
_parse_header_line(line;data)
_parse_stats_line(line;data)
_parse_health_line(line_stripped;data)
_parse_functions_line(line_stripped;data)
_parse_classes_line(line_stripped;data)
_parse_hotspots_line(line_stripped;data)
_detect_section(line)
parse_toon_content(content)
is_toon_file(filepath)
load_toon(filepath)
code2llm/patterns/__init__.py:
code2llm/patterns/detector.py:
e: PatternDetector
PatternDetector: __init__(1),detect_patterns(1),_detect_recursion(1),_detect_state_machines(1),_detect_factory_pattern(1),_detect_singleton(1),_detect_strategy_pattern(1),_check_returns_classes(2) # Detect behavioral patterns in code.
code2llm/refactor/__init__.py:
code2llm/refactor/prompt_engine.py:
e: PromptEngine
PromptEngine: __init__(2),generate_prompts(0),_generate_prompt_for_smell(1),_get_template_for_type(1),_build_context_for_smell(1),_get_source_context(3),_get_instruction_for_smell(1) # Generate refactoring prompts from analysis results and detec
demo_langs/invalid/sample_bad.py:
demo_langs/valid/sample.py:
e: main,User,UserService
User:
UserService: __init__(0),add_user(1),get_user(1),process_users(0),list_users(0),remove_user(1),count(0)
main()
examples/docker-doql-example/app/main.py:
e: CustomHandler
CustomHandler: do_GET(0),log_message(1)
examples/docker-doql-example/worker/worker.py:
e: process_message,main
process_message(ch;method;properties;body)
main()
examples/functional_refactoring/__init__.py:
examples/functional_refactoring/cache.py:
e: CacheEntry,EvolutionaryCache
CacheEntry: # Single cache entry with evolution metadata.
EvolutionaryCache: __init__(2),_load(0),_save(0),get(2),put(3),report_success(2),report_failure(2),_make_key(2),_calculate_score(1),_evict_worst(0) # Cache that evolves based on usage patterns.
examples/functional_refactoring/cli.py:
e: generate
generate(query;intent;dry_run;cache_dir)
examples/functional_refactoring/entity_preparers.py:
e: EntityPreparer,ShellEntityPreparer,DockerEntityPreparer,SQLEntityPreparer,KubernetesEntityPreparer,EntityPreparationPipeline
EntityPreparer: supports(1),prepare(3) # Protocol for domain-specific entity preparation.
ShellEntityPreparer: supports(1),prepare(3),_apply_path_defaults(4),_apply_pattern_defaults(2),_apply_find_flags(3) # Prepares entities for shell commands.
DockerEntityPreparer: supports(1),prepare(3),_resolve_container_name(1) # Prepares entities for docker commands.
SQLEntityPreparer: supports(1),prepare(3),_sanitize_identifier(1),_sanitize_columns(1) # Prepares entities for SQL commands.
KubernetesEntityPreparer: supports(1),prepare(3) # Prepares entities for kubernetes commands.
EntityPreparationPipeline: __init__(0),prepare(3) # Coordinates entity preparation across domains.
examples/functional_refactoring/generator.py:
e: CommandGenerator
CommandGenerator: __init__(3),generate(3) # Generates commands from natural language intents.
examples/functional_refactoring/models.py:
e: CommandContext,CommandResult
CommandContext: # Context for command generation.
CommandResult: # Result of command generation.
examples/functional_refactoring/template_engine.py:
e: Template,TemplateLoader,TemplateRenderer
Template: # Command template.
TemplateLoader: __init__(1),load(0),_load_templates(0),_load_defaults(0),get_template(1),get_default(2),find_alternative_template(2) # Loads templates from various sources.
TemplateRenderer: render(2),_manual_render(2),render_with_conditionals(2) # Renders templates with entity substitution.
examples/functional_refactoring_example.py:
e: TemplateGenerator
TemplateGenerator: __init__(0),generate(3),_load_templates_from_json(0),_load_defaults_from_json(0),_prepare_shell_entities(0),_prepare_docker_entities(0),_prepare_sql_entities(0),_find_alternative_template(0),_render_template(0) # Original - handles EVERYTHING: loading, matching, rendering,
examples/litellm/run.py:
e: run_analysis,get_refactoring_advice,main
run_analysis(project_path)
get_refactoring_advice(outputs;model)
main()
examples/streaming-analyzer/demo.py:
e: demo_quick_strategy,demo_standard_strategy,demo_deep_strategy,demo_incremental_analysis,demo_memory_limited,demo_custom_progress,main
demo_quick_strategy()
demo_standard_strategy()
demo_deep_strategy()
demo_incremental_analysis()
demo_memory_limited()
demo_custom_progress()
main()
examples/streaming-analyzer/sample_project/__init__.py:
examples/streaming-analyzer/sample_project/api.py:
e: APIHandler
APIHandler: __init__(0),process_request(1),_check_rate_limit(1),_get_stats(0),_get_user_info(1),_health_check(0),format_response(1) # Handles API requests and responses.
examples/streaming-analyzer/sample_project/auth.py:
e: AuthManager
AuthManager: __init__(0),_hash(1),authenticate(2),_verify_password(2),create_session(1),validate_session(1),revoke_session(1),get_user_role(1),has_permission(3),list_active_sessions(0) # Manages user authentication and authorization.
examples/streaming-analyzer/sample_project/database.py:
e: DatabaseConnection
DatabaseConnection: __init__(1),_load_data(0),_save_data(0),get_user(1),get_user_settings(1),get_user_logs(1),update_user_settings(2),update_user_profile(2),delete_user(1),clear_user_data(1),create_user(1),_log_action(3),get_stats(0) # Simple database connection simulator.
examples/streaming-analyzer/sample_project/main.py:
e: main,UserRequest,Application
UserRequest: # User request data structure.
Application: __init__(0),start(0),get_next_request(0),process_request(1),handle_get_request(1),handle_set_request(1),handle_delete_request(1),handle_default_request(1) # Main application class with multiple responsibilities.
main()
examples/streaming-analyzer/sample_project/utils.py:
e: validate_input,format_output,calculate_metrics,filter_data,transform_data
validate_input(data)
format_output(data)
calculate_metrics(data)
filter_data(data;criteria)
transform_data(data;transformations)
examples/streaming-analyzer/test_example.py:
e: test_imports,test_basic_analysis,main
test_imports()
test_basic_analysis()
main()
pipeline.py:
e: _detect_primary_language,run_pipeline
_detect_primary_language(project_dir)
run_pipeline(project_dir;output_dir)
scripts/benchmark_badges.py:
e: get_shield_url,parse_evolution_metrics,parse_format_quality_report,parse_performance_report,generate_badges,generate_format_quality_badges,generate_performance_badges,create_html,main
get_shield_url(label;message;color)
parse_evolution_metrics(toon_content)
parse_format_quality_report(report_path)
parse_performance_report(report_path)
generate_badges(metrics)
generate_format_quality_badges(format_scores)
generate_performance_badges(performance_data)
create_html(badges;title)
main()
scripts/bump_version.py:
e: get_current_version,parse_version,format_version,bump_version,update_pyproject_toml,update_version_file,main
get_current_version()
parse_version(version_str)
format_version(major;minor;patch)
bump_version(version_type)
update_pyproject_toml(new_version)
update_version_file(new_version)
main()
setup.py:
e: read_version,read_readme
read_version()
read_readme()
test_langs/invalid/sample_bad.py:
test_langs/valid/sample.py:
e: main,Product,ProductRepository
Product:
ProductRepository: __init__(0),add(1),find_by_id(1),list_all(0)
main()
test_python_only/invalid/__init__.py:
test_python_only/invalid/sample_bad.py:
test_python_only/valid/__init__.py:
test_python_only/valid/sample.py:
e: main,User,UserService
User:
UserService: __init__(0),add_user(1),get_user(1),process_users(0)
main()
tests/test_advanced_analysis.py:
e: test_radon_complexity,test_graph_metrics,test_circular_dependency
test_radon_complexity()
test_graph_metrics()
test_circular_dependency()
tests/test_analyzer.py:
e: TestProjectAnalyzer,TestConfig,TestExporters
TestProjectAnalyzer: sample_project(0),test_analyze_finds_functions(1),test_analyze_finds_classes(1),test_detects_recursion(1),test_detects_state_machine(1),test_caching_works(1),test_filtering_skips_tests(1) # Test the main ProjectAnalyzer.
TestConfig: test_fast_config_limits_depth(0),test_fast_config_skips_private(0) # Test configuration.
TestExporters: sample_result(0),test_json_export(2),test_mermaid_export(2),test_mermaid_export_sanitizes_unsafe_identifiers(1) # Test export functionality.
tests/test_cache_invalidation_e2e.py:
e: project,_cache_for,_run_full_analysis,test_first_run_populates_manifest,test_run_hash_changes_when_file_modified,test_run_hash_changes_when_file_deleted,test_run_hash_stable_when_nothing_changes
project(tmp_path;monkeypatch)
_cache_for(project_dir;root)
_run_full_analysis(project_dir;cache_root)
test_first_run_populates_manifest(project)
test_run_hash_changes_when_file_modified(project)
test_run_hash_changes_when_file_deleted(project)
test_run_hash_stable_when_nothing_changes(project)
tests/test_calls_toon_export.py:
e: test_export_calls_toon_generates_file,test_export_calls_toon_hubs_section,test_export_calls_toon_modules_section,test_export_calls_toon_edges_section,test_export_calls_toon_header_stats
test_export_calls_toon_generates_file(tmp_path)
test_export_calls_toon_hubs_section(tmp_path)
test_export_calls_toon_modules_section(tmp_path)
test_export_calls_toon_edges_section(tmp_path)
test_export_calls_toon_header_stats(tmp_path)
tests/test_declarative_collection.py:
e: iac_project,test_all_extensions_includes_declarative,test_all_filenames_includes_dockerfile_and_makefile,test_collect_files_discovers_iac,test_modifying_declarative_file_invalidates_cache,test_dockerfile_edit_invalidates_cache,test_dockerfile_variants_matched_by_prefix,test_lockfiles_excluded_by_default
iac_project(tmp_path)
test_all_extensions_includes_declarative()
test_all_filenames_includes_dockerfile_and_makefile()
test_collect_files_discovers_iac(iac_project)
test_modifying_declarative_file_invalidates_cache(iac_project;tmp_path)
test_dockerfile_edit_invalidates_cache(iac_project;tmp_path)
test_dockerfile_variants_matched_by_prefix(tmp_path)
test_lockfiles_excluded_by_default(iac_project;tmp_path)
tests/test_deep_analysis.py:
e: test_astroid_resolution_mock,test_vulture_dead_code
test_astroid_resolution_mock(tmp_path)
test_vulture_dead_code(tmp_path)
tests/test_edge_cases.py:
e: TestEdgeCases,TestFileCache,TestFiltering,TestNLPEdgeCases,TestIntegration,TestBenchmarks
TestEdgeCases: test_empty_project(0),test_nonexistent_path(0),test_syntax_error_file(0),test_very_large_file(0),test_unicode_filenames(0),test_nested_classes(0),test_decorators(0) # Test edge cases and error handling.
TestFileCache: test_cache_hit(0),test_cache_ttl_expiration(0),test_cache_clear(0) # Test caching functionality.
TestFiltering: test_exclude_tests(0),test_exclude_patterns(0),test_skip_private_methods(0),test_skip_properties(0) # Test file and function filtering.
TestNLPEdgeCases: test_empty_query(0),test_gibberish_query(0),test_very_long_query(0),test_mixed_languages(0),test_special_characters(0) # Test NLP pipeline edge cases.
TestIntegration: test_codebase_entity_resolution(0),test_nlp_to_analysis_workflow(0) # Integration tests combining analysis and NLP.
TestBenchmarks: test_analysis_performance(0),test_nlp_performance(0) # Performance benchmarks.
tests/test_file_analyzer_tagging.py:
e: analyzer,test_analyze_file_tags_result_with_path,test_nonexistent_file_returns_empty,test_cached_result_also_tagged
analyzer()
test_analyze_file_tags_result_with_path(tmp_path;analyzer;filename;content)
test_nonexistent_file_returns_empty(analyzer;tmp_path)
test_cached_result_also_tagged(tmp_path)
tests/test_flow_exporter.py:
e: typed_source,untyped_source,_make_fi,TestTypeInferenceEngine,TestSideEffectDetector,TestFlowExporterSprint2,TestEdgeCases
TestTypeInferenceEngine: test_extracts_return_annotation(1),test_extracts_arg_types(1),test_detects_default_args(1),test_typed_signature_format(1),test_name_based_fallback(1),test_no_annotations_no_pattern(1),test_batch_extract(1)
TestSideEffectDetector: test_detects_io(1),test_detects_pure(1),test_detects_mutation(1),test_detects_write_io(1),test_side_effect_summary(1),test_batch_analyze(1),test_heuristic_fallback(0),test_to_dict(1)
TestFlowExporterSprint2: sample_result(1),test_export_creates_file(2),test_contracts_have_in_out(2),test_data_types_has_source_counts(2),test_side_effects_section(2),test_type_annotations_in_signatures(2),test_hub_type_split_recommendations(1),test_pipeline_purity_uses_ast(2)
TestEdgeCases: test_empty_result(1),test_missing_source_file(1),test_type_inference_bad_syntax(1),test_side_effect_detector_bad_syntax(1)
typed_source(tmp_path)
untyped_source(tmp_path)
_make_fi(name;file;line;args;returns;calls;class_name;module;complexity)
tests/test_format_quality.py:
e: ground_truth_project,analysis_result,TestAnalysisToon,TestFlowToon,TestProjectMap,TestContextMd,TestCrossFormat
TestAnalysisToon: toon_content(2),test_detects_god_function(1),test_detects_high_fan_out(1),test_has_health_section(1),test_has_refactor_section(1),test_has_coupling_section(1),test_has_severity_markers(1),test_has_layers(1) # Test that analysis.toon detects known problems.
TestFlowToon: flow_content(2),test_has_pipelines_section(1),test_has_transforms_section(1),test_has_type_info(1),test_detects_etl_pipeline_functions(1),test_has_side_effects_section(1),test_has_contracts_or_data_types(1) # Test that flow.toon detects data-flow information.
TestProjectMap: map_content(2),test_lists_all_modules(1),test_has_import_info(1),test_has_function_signatures(1),test_has_type_annotations(1) # Test that project.map provides structural information.
TestContextMd: context_content(2),test_has_overview(1),test_has_entry_points(1),test_is_markdown(1) # Test that context.md provides LLM-readable narrative.
TestCrossFormat: all_formats(2),test_flow_toon_has_unique_pipeline_info(1),test_analysis_toon_has_unique_health_info(1),test_project_map_has_unique_structure_info(1),test_formats_have_different_sizes(1) # Test that formats are complementary, not redundant.
ground_truth_project(tmp_path_factory)
analysis_result(ground_truth_project)
tests/test_multilanguage_e2e.py:
e: TestMultiLanguageE2E
TestMultiLanguageE2E: test_typescript_analysis(0),test_javascript_analysis(0),test_go_analysis(0),test_rust_analysis(0),test_java_analysis(0),test_multilanguage_project(0),test_language_detection_in_output(0),test_excluded_directories_not_analyzed(0) # E2E tests for multi-language project analysis.
tests/test_nlp_pipeline.py:
e: TestQueryNormalization,TestIntentMatching,TestEntityResolution,TestNLPPipeline,TestNLPConfig,TestMultilingualSupport
TestQueryNormalization: test_step_1a_lowercase(0),test_step_1b_remove_punctuation(0),test_step_1c_normalize_whitespace(0),test_step_1d_unicode_normalize(0),test_step_1e_remove_stopwords(0),test_polish_text_normalization(0) # Test Query Normalization steps 1a-1e.
TestIntentMatching: test_step_2a_fuzzy_match(0),test_step_2c_keyword_match(0),test_step_2d_context_score(0),test_step_2e_multi_intent_resolution(0),test_polish_intent_matching(0) # Test Intent Matching steps 2a-2e.
TestEntityResolution: mock_entities(0),test_step_3a_extract_entities(1),test_step_3b_name_match_threshold(1),test_step_3c_disambiguation(1),test_step_3d_hierarchical_resolution(1),test_step_3e_alias_resolution(1) # Test Entity Resolution steps 3a-3e.
TestNLPPipeline: test_step_4a_orchestration(0),test_step_4c_confidence_scoring(0),test_step_4d_fallback_handling(0),test_step_4e_output_formatting(0),test_polish_query_processing(0) # Test complete NLP Pipeline integration (4a-4e).
TestNLPConfig: test_config_from_yaml(1),test_config_to_yaml(1) # Test YAML-driven configuration.
TestMultilingualSupport: test_english_queries(0),test_polish_queries(0),test_mixed_language_fuzzy_matching(0) # Test multilingual fuzzy matching.
tests/test_nonpython_cc_calls.py:
e: TestTypeScriptComplexityAndCalls,TestGoComplexityAndCalls,TestRustComplexityAndCalls,TestJavaComplexityAndCalls,TestCppComplexityAndCalls,TestCSharpComplexityAndCalls,TestPhpComplexityAndCalls,TestRubyComplexityAndCalls
TestTypeScriptComplexityAndCalls: _analyze(0),test_ts_functions_detected(0),test_ts_complexity_not_zero(0),test_ts_calls_extracted(0),test_ts_cc_avg_not_zero(0) # Verify TS/JS files get CC > 0 and call edges.
TestGoComplexityAndCalls: _analyze(0),test_go_complexity_not_zero(0),test_go_calls_extracted(0) # Verify Go files get CC > 0.
TestRustComplexityAndCalls: _analyze(0),test_rust_complexity_not_zero(0) # Verify Rust files get CC > 0.
TestJavaComplexityAndCalls: _analyze(0),test_java_complexity_not_zero(0),test_java_calls_extracted(0) # Verify Java files get CC > 0.
TestCppComplexityAndCalls: _analyze(0),test_cpp_classes_detected(0),test_cpp_complexity_not_zero(0),test_cpp_includes_extracted(0) # Verify C/C++ files get CC > 0.
TestCSharpComplexityAndCalls: _analyze(0),test_cs_classes_detected(0),test_cs_complexity_not_zero(0),test_cs_usings_extracted(0) # Verify C# files get CC > 0.
TestPhpComplexityAndCalls: _analyze(0),test_php_classes_detected(0),test_php_complexity_not_zero(0),test_php_namespace_extracted(0) # Verify PHP files get CC > 0.
TestRubyComplexityAndCalls: _analyze(0),test_ruby_classes_detected(0),test_ruby_complexity_not_zero(0),test_ruby_requires_extracted(0) # Verify Ruby files get CC > 0.
tests/test_orchestrator_cache_mtime.py:
e: _write,test_copy_cached_export_refreshes_mtime,test_copy_cached_export_preserves_contents
_write(path;content;mtime)
test_copy_cached_export_refreshes_mtime(tmp_path)
test_copy_cached_export_preserves_contents(tmp_path)
tests/test_persistent_cache.py:
e: tmp_project,cache,TestContentHash,TestFileResultRoundtrip,TestAutoCleanup,TestPruneMissing,TestGetChangedFiles,TestExportCache,TestSaveAndReload,TestGC,TestClear,TestModuleLevelHelpers
TestContentHash: test_same_content_same_hash(2),test_different_content_different_hash(2)
TestFileResultRoundtrip: test_put_then_get(2),test_get_missing_returns_none(2),test_manifest_updated_after_put(2),test_put_dataclass_payload(2)
TestAutoCleanup: test_fresh_cache_no_removal(2),test_stale_export_removed(2),test_fresh_export_kept(2),test_abandoned_export_removed(2),test_referenced_file_entry_kept_even_if_old(2),test_orphan_file_entry_removed(2),test_orphan_file_entry_kept_if_fresh(2),test_auto_cleanup_triggered_on_init(2),test_env_var_disables_auto_cleanup(3),test_env_var_sets_ttl(3)
TestPruneMissing: test_no_entries_no_op(2),test_removes_vanished_entries(2),test_pruning_changes_run_hash(2),test_pruning_sets_dirty_flag(2)
TestGetChangedFiles: test_new_files_are_changed(2),test_cached_file_not_changed(2),test_modified_file_is_changed(2)
TestExportCache: test_missing_export_returns_none(1),test_complete_export_returned(2),test_different_config_different_dir(1),test_empty_manifest_refuses_cache_hit(1),test_populated_manifest_allows_cache_hit(2)
TestSaveAndReload: test_save_creates_manifest(2),test_reload_preserves_entries(2),test_version_mismatch_resets_manifest(2)
TestGC: test_gc_removes_old_exports(2),test_gc_keeps_recent_exports(2)
TestClear: test_clear_empties_manifest(2)
TestModuleLevelHelpers: test_get_all_projects_empty(1),test_get_all_projects_after_save(2),test_clear_all(2)
tmp_project(tmp_path)
cache(tmp_project;tmp_path)
tests/test_pipeline_detector.py:
e: _fi,_build_chain_funcs,TestPipelineDetector,TestDomainClassification,TestMultiplePipelines,TestFlowExporterSprint3,TestPipelineEdgeCases
TestPipelineDetector: test_detects_simple_chain(0),test_entry_exit_labeling(0),test_purity_aggregation(1),test_bottleneck_detection(0),test_pipeline_to_dict(0),test_no_pipelines_from_isolated_functions(0),test_empty_input(0)
TestDomainClassification: test_nlp_domain(0),test_analysis_domain(0),test_export_domain(0),test_unknown_domain(0)
TestMultiplePipelines: test_three_independent_pipelines(0),test_four_pipelines_with_domains(0)
TestFlowExporterSprint3: multi_pipeline_result(0),test_output_has_domain_tags(2),test_output_has_entry_exit_markers(2),test_output_has_pipeline_purity(2),test_output_has_all_sections(2),test_contracts_show_domain_pipeline(2)
TestPipelineEdgeCases: test_cyclic_calls(0),test_self_recursive(0),test_diamond_dependency(0),test_very_long_chain(0)
_fi(name;module;args;calls;cc;class_name;file;line)
_build_chain_funcs(chain_spec;module;file)
tests/test_project_toon_export.py:
e: test_export_project_toon_writes_file,test_export_single_project_all_triggers_project_toon
test_export_project_toon_writes_file(tmp_path)
test_export_single_project_all_triggers_project_toon(tmp_path)
tests/test_prompt_engine.py:
e: test_tiktoken_truncation,test_template_rendering_with_metrics,test_tree_sitter_init
test_tiktoken_truncation()
test_template_rendering_with_metrics()
test_tree_sitter_init()
tests/test_prompt_txt.py:
e: TestPromptTxtGeneration,TestCode2logicExport
TestPromptTxtGeneration: temp_output_dir(0),mock_args(0),test_prompt_txt_not_generated_without_code2logic_format(2),test_prompt_txt_generated_with_code2logic_format(2),test_prompt_txt_generated_with_all_format(2),test_prompt_txt_lists_existing_files(2),test_prompt_txt_shows_missing_files(2),test_prompt_txt_contains_task_instructions(2),test_prompt_txt_prioritizes_blockers_when_validation_and_duplication_exist(2),test_prompt_txt_content_structure(2) # Test the _export_prompt_txt function that generates prompt.t
TestCode2logicExport: temp_output_dir(0),test_export_code2logic_adds_quiet_flag_when_not_verbose(1),test_export_code2logic_does_not_add_quiet_flag_when_verbose(1),test_prompt_txt_no_verbose_output(1) # Test the _export_code2logic wrapper.
tests/test_refactoring_engine.py:
e: test_metrics_calculation,test_mutation_tracking,test_smell_detection
test_metrics_calculation()
test_mutation_tracking()
test_smell_detection()
tests/test_toon_v2.py:
e: sample_result,TestToonExporterV2,TestToonExporterEdgeCases
TestToonExporterV2: test_export_creates_file(2),test_header_format(2),test_health_section(2),test_refactor_section(2),test_layers_section(2),test_functions_section_filters_by_cc(2),test_classes_section_with_bar_chart(2),test_hotspots_section(2),test_details_section(2),test_excluded_paths_venv(0),test_excluded_paths_site_packages(0),test_included_paths(0),test_max_health_issues_limit(2),test_coupling_matrix_limited(2),test_inline_markers(2) # Test ToonExporter v2 format.
TestToonExporterEdgeCases: test_empty_result(1),test_single_function(1) # Test edge cases for ToonExporter.
sample_result()
validate_toon.py:
e: load_yaml,load_file,extract_functions_from_yaml,_extract_names_from_toon,extract_functions_from_toon,_extract_keys_from_yaml,extract_classes_from_yaml,extract_classes_from_toon,analyze_class_differences,extract_modules_from_yaml,extract_modules_from_toon,compare_basic_stats,compare_functions,compare_classes,compare_modules,validate_toon_completeness,_run_single_file_mode,_run_comparison_mode,_compare_all_aspects,_print_comparison_summary,main
load_yaml(filepath)
load_file(filepath)
extract_functions_from_yaml(yaml_data)
_extract_names_from_toon(toon_data;key)
extract_functions_from_toon(toon_data)
_extract_keys_from_yaml(yaml_data;key)
extract_classes_from_yaml(yaml_data)
extract_classes_from_toon(toon_data)
analyze_class_differences(yaml_data;toon_data)
extract_modules_from_yaml(yaml_data)
extract_modules_from_toon(toon_data)
compare_basic_stats(yaml_data;toon_data)
compare_functions(yaml_data;toon_data)
compare_classes(yaml_data;toon_data)
compare_modules(yaml_data;toon_data)
validate_toon_completeness(toon_data)
_run_single_file_mode(file_path)
_run_comparison_mode(yaml_path;toon_path)
_compare_all_aspects(yaml_data;toon_data)
_print_comparison_summary(results)
main()
Top 5 modules by symbol density — signatures for LLM orientation.
def handle_special_commands() # CC=9, fan=5
def handle_cache_command(args_list) # CC=12, fan=17 ⚠
def handle_report_command(args_list) # CC=4, fan=9
def validate_and_setup(args) # CC=3, fan=6
def print_start_info(args, source_path, output_dir) # CC=2, fan=1
def validate_chunked_output(output_dir, args) # CC=3, fan=6
def _get_chunk_dirs(output_dir) # CC=3, fan=2
def _validate_chunks(chunk_dirs, required_files) # CC=3, fan=7
def _validate_single_chunk(chunk_dir, required_files) # CC=4, fan=3
def _get_file_sizes(chunk_dir, required_files) # CC=3, fan=3
def _print_chunk_errors(chunk_name, chunk_issues) # CC=2, fan=1
def _print_validation_summary(chunk_dirs, valid_chunks, issues) # CC=3, fan=2
def generate_llm_context(args_list) # CC=3, fan=12def _run_analysis(args, source_path, output_dir) # CC=5, fan=4
def _run_standard_analysis(args, source_path, output_dir) # CC=5, fan=8
def _build_config(args, output_dir) # CC=11, fan=10 ⚠
def _print_analysis_summary(result) # CC=1, fan=2
def _run_chunked_analysis(args, source_path, output_dir) # CC=3, fan=8
def _print_chunked_plan(subprojects) # CC=4, fan=5
def _filter_subprojects(args, subprojects) # CC=10, fan=4 ⚠
def _analyze_all_subprojects(args, subprojects, output_dir) # CC=4, fan=8
def _analyze_subproject(args, subproject, output_dir) # CC=14, fan=16 ⚠
def _merge_chunked_results(all_results, source_path) # CC=9, fan=5
def _run_streaming_analysis(args, config, source_path) # CC=7, fan=9def analyze(project_path, config) # CC=2, fan=2
def analyze_file(file_path, config) # CC=1, fan=4def get_version() # CC=2, fan=5
def create_parser() # CC=1, fan=5def main() # CC=7, fan=9461 nodes · 500 edges · 91 modules · CC̄=2.1
| Function | CC | in | out | total |
|---|---|---|---|---|
print (in Taskfile) |
0 | 527 | 0 | 527 |
run_pipeline (in pipeline) |
9 | 0 | 68 | 68 |
normalize_llm_task (in code2llm.generators.llm_task) |
14 ⚠ | 1 | 43 | 44 |
main (in benchmarks.benchmark_performance) |
1 | 0 | 41 | 41 |
analyze_class_differences (in validate_toon) |
6 | 1 | 39 | 40 |
handle_cache_command (in code2llm.cli_commands) |
12 ⚠ | 1 | 33 | 34 |
run_benchmark (in benchmarks.benchmark_evolution) |
9 | 0 | 34 | 34 |
analyze_rust (in code2llm.core.lang.rust) |
9 | 0 | 31 | 31 |
# code2llm call graph | /home/tom/github/semcod/code2llm
# nodes: 461 | edges: 500 | modules: 91
# CC̄=2.1
HUBS[20]:
Taskfile.print
CC=0 in:527 out:0 total:527
pipeline.run_pipeline
CC=9 in:0 out:68 total:68
code2llm.generators.llm_task.normalize_llm_task
CC=14 in:1 out:43 total:44
benchmarks.benchmark_performance.main
CC=1 in:0 out:41 total:41
validate_toon.analyze_class_differences
CC=6 in:1 out:39 total:40
code2llm.cli_commands.handle_cache_command
CC=12 in:1 out:33 total:34
benchmarks.benchmark_evolution.run_benchmark
CC=9 in:0 out:34 total:34
code2llm.core.lang.rust.analyze_rust
CC=9 in:0 out:31 total:31
benchmarks.benchmark_optimizations.benchmark_cold_vs_warm
CC=7 in:1 out:30 total:31
benchmarks.benchmark_performance.create_test_project
CC=5 in:1 out:29 total:30
code2llm.core.lang.base._extract_declarations
CC=9 in:1 out:28 total:29
code2llm.core.toon_size_manager._split_by_modules
CC=10 in:1 out:27 total:28
code2llm.core.lang.go_lang._analyze_go_regex
CC=10 in:1 out:26 total:27
code2llm.exporters.mermaid.compact.export_compact
CC=13 in:0 out:27 total:27
validate_toon.compare_modules
CC=5 in:1 out:26 total:27
code2llm.exporters.mermaid.calls.export_calls
CC=13 in:0 out:26 total:26
validate_toon.compare_functions
CC=6 in:1 out:24 total:25
code2llm.exporters.project_yaml.core.ProjectYAMLExporter._build_project_yaml
CC=12 in:0 out:25 total:25
code2llm.exporters.toon.metrics_core.CoreMetricsComputer.compute_file_metrics
CC=12 in:0 out:25 total:25
code2llm.exporters.evolution_exporter.EvolutionExporter._is_excluded
CC=1 in:24 out:1 total:25
MODULES:
Taskfile [1 funcs]
print CC=0 out:0
benchmarks.benchmark_evolution [3 funcs]
load_previous CC=3 out:3
run_benchmark CC=9 out:34
save_current CC=1 out:3
benchmarks.benchmark_format_quality [3 funcs]
_print_benchmark_header CC=1 out:4
_print_ground_truth_info CC=1 out:7
run_benchmark CC=2 out:22
benchmarks.benchmark_optimizations [5 funcs]
benchmark_cold_vs_warm CC=7 out:30
clear_caches CC=3 out:7
main CC=3 out:13
print_summary CC=1 out:18
run_analysis CC=1 out:7
benchmarks.benchmark_performance [7 funcs]
benchmark_original_analyzer CC=3 out:14
benchmark_streaming_analyzer CC=5 out:12
benchmark_with_strategies CC=6 out:10
create_test_project CC=5 out:29
main CC=1 out:41
print_comparison CC=2 out:10
save_report CC=2 out:10
benchmarks.format_evaluator [5 funcs]
_check_structural_features CC=1 out:16
_detect_hub_types CC=2 out:2
_detect_pipelines CC=5 out:5
_detect_problems CC=1 out:16
evaluate_format CC=4 out:22
benchmarks.project_generator [6 funcs]
add_validator_to_core CC=1 out:3
create_core_py CC=1 out:2
create_etl_py CC=1 out:2
create_ground_truth_project CC=1 out:6
create_utils_py CC=1 out:2
create_validation_py CC=1 out:2
benchmarks.reporting [8 funcs]
_print_gap_analysis CC=6 out:9
_print_header CC=1 out:3
_print_pipelines_detail CC=5 out:11
_print_problems_detail CC=5 out:13
_print_scores_table CC=3 out:7
_print_structural_features CC=5 out:11
print_results CC=1 out:6
save_report CC=2 out:8
code2llm.analysis.call_graph [2 funcs]
_expr_to_str CC=1 out:1
visit_FunctionDef CC=2 out:4
code2llm.analysis.cfg [2 funcs]
_expr_to_str CC=1 out:1
visit_FunctionDef CC=5 out:8
code2llm.analysis.data_analysis [1 funcs]
_find_data_pipelines CC=7 out:7
code2llm.analysis.dfg [1 funcs]
_expr_to_str CC=1 out:1
code2llm.analysis.side_effects [1 funcs]
analyze_function CC=3 out:6
code2llm.analysis.type_inference [1 funcs]
enrich_function CC=3 out:4
code2llm.api [2 funcs]
analyze CC=2 out:2
analyze_file CC=1 out:4
code2llm.cli [1 funcs]
main CC=7 out:11
code2llm.cli_analysis [11 funcs]
_analyze_all_subprojects CC=4 out:8
_analyze_subproject CC=14 out:19
_build_config CC=11 out:16
_filter_subprojects CC=10 out:5
_merge_chunked_results CC=9 out:7
_print_analysis_summary CC=1 out:9
_print_chunked_plan CC=4 out:9
_run_analysis CC=5 out:4
_run_chunked_analysis CC=3 out:13
_run_standard_analysis CC=5 out:8
code2llm.cli_commands [13 funcs]
_get_chunk_dirs CC=3 out:2
_get_file_sizes CC=3 out:3
_print_chunk_errors CC=2 out:2
_print_validation_summary CC=3 out:12
_validate_chunks CC=3 out:11
_validate_single_chunk CC=4 out:4
generate_llm_context CC=3 out:21
handle_cache_command CC=12 out:33
handle_report_command CC=4 out:17
handle_special_commands CC=9 out:8
code2llm.core.analyzer [8 funcs]
_analyze_parallel CC=11 out:15
_analyze_sequential CC=11 out:9
_build_call_graph CC=3 out:7
_load_from_persistent_cache CC=11 out:19
_post_process CC=5 out:7
_print_summary CC=1 out:10
analyze_files CC=2 out:6
analyze_project CC=6 out:22
code2llm.core.config [1 funcs]
get_workers CC=2 out:1
code2llm.core.file_analyzer [3 funcs]
_calculate_complexity CC=8 out:5
_perform_deep_analysis CC=7 out:9
_route_to_language_analyzer CC=10 out:10
code2llm.core.file_cache [1 funcs]
_get_cache_key CC=1 out:1
code2llm.core.file_filter [1 funcs]
__init__ CC=9 out:13
code2llm.core.incremental [2 funcs]
needs_analysis CC=2 out:5
update CC=1 out:2
code2llm.core.lang.base [10 funcs]
_extract_declarations CC=9 out:28
_match_method_name CC=14 out:9
_process_class_method CC=2 out:7
_process_functions CC=9 out:2
_process_standalone_function CC=10 out:11
_resolve_call CC=7 out:7
analyze_c_family CC=5 out:6
calculate_complexity_regex CC=6 out:5
extract_calls_regex CC=9 out:11
extract_function_body CC=10 out:4
code2llm.core.lang.cpp [1 funcs]
analyze_cpp CC=1 out:1
code2llm.core.lang.csharp [1 funcs]
analyze_csharp CC=1 out:1
code2llm.core.lang.go_lang [2 funcs]
_analyze_go_regex CC=10 out:26
analyze_go CC=4 out:6
code2llm.core.lang.java [1 funcs]
analyze_java CC=1 out:1
code2llm.core.lang.php [4 funcs]
_adjust_qualified_names CC=3 out:6
_extract_php_traits CC=4 out:8
_parse_php_metadata CC=8 out:9
analyze_php CC=2 out:10
code2llm.core.lang.ruby [3 funcs]
analyze CC=1 out:1
_adjust_ruby_module_qualnames CC=4 out:10
analyze_ruby CC=14 out:19
code2llm.core.lang.rust [1 funcs]
analyze_rust CC=9 out:31
code2llm.core.lang.ts_extractors [5 funcs]
_extract_classes_ts CC=1 out:6
_extract_functions_ts CC=1 out:9
_find_name_node CC=7 out:0
_get_node_text CC=1 out:1
extract_declarations_ts CC=1 out:5
code2llm.core.lang.ts_parser [9 funcs]
__init__ CC=1 out:1
parse CC=3 out:3
supports CC=2 out:1
_get_language CC=7 out:6
_get_parser CC=4 out:3
_init_tree_sitter CC=2 out:1
get_parser CC=2 out:1
is_available CC=1 out:1
parse_source CC=1 out:3
code2llm.core.lang.typescript [3 funcs]
analyze_typescript_js CC=1 out:5
get_typescript_lang_config CC=1 out:0
get_typescript_patterns CC=1 out:8
code2llm.core.large_repo [15 funcs]
_calculate_priority CC=1 out:1
_categorize_subdirs CC=7 out:10
_collect_files_in_dir CC=1 out:1
_collect_files_recursive CC=1 out:1
_collect_root_files CC=1 out:1
_contains_python_files CC=1 out:1
_count_py_files CC=1 out:1
_get_level1_dirs CC=1 out:1
_merge_small_l1_dirs CC=7 out:19
_process_level1_files CC=5 out:13
code2llm.core.persistent_cache [2 funcs]
get_file_result CC=4 out:5
put_file_result CC=3 out:7
code2llm.core.refactoring [6 funcs]
_calculate_centrality CC=8 out:9
_detect_communities CC=7 out:10
_detect_cycles CC=6 out:7
_detect_dead_code CC=8 out:15
_map_dead_code_to_items CC=9 out:13
perform_refactoring_analysis CC=8 out:12
code2llm.core.repo_files [7 funcs]
_get_gitignore_parser CC=2 out:2
collect_files_in_dir CC=6 out:10
collect_root_files CC=3 out:5
contains_python_files CC=3 out:4
count_py_files CC=3 out:4
get_level1_dirs CC=8 out:9
should_skip_file CC=7 out:4
code2llm.core.streaming.cache [1 funcs]
_get_cache_key CC=1 out:1
code2llm.core.toon_size_manager [8 funcs]
_parse_modules CC=6 out:7
_split_by_lines CC=8 out:20
_split_by_modules CC=10 out:27
_write_chunk CC=2 out:1
get_file_size_kb CC=1 out:1
manage_toon_size CC=8 out:11
should_split_toon CC=1 out:1
split_toon_file CC=3 out:6
code2llm.exporters.evolution.computation [8 funcs]
aggregate_file_stats CC=7 out:11
build_context CC=10 out:12
compute_func_data CC=3 out:10
compute_god_modules CC=2 out:4
compute_hub_types CC=7 out:8
filter_god_modules CC=3 out:5
make_relative_path CC=3 out:3
scan_file_sizes CC=6 out:7
code2llm.exporters.evolution.yaml_export [1 funcs]
export_to_yaml CC=11 out:24
code2llm.exporters.evolution_exporter [2 funcs]
_is_excluded CC=1 out:1
export CC=1 out:22
code2llm.exporters.flow_exporter [1 funcs]
_is_excluded CC=1 out:1
code2llm.exporters.map.alerts [2 funcs]
_read_previous_cc_avg CC=6 out:6
load_evolution_trend CC=5 out:2
code2llm.exporters.map.details [4 funcs]
_rank_modules CC=5 out:7
_render_map_class CC=7 out:8
_render_map_module CC=13 out:16
render_details CC=2 out:2
code2llm.exporters.map.header [4 funcs]
_render_alerts_line CC=2 out:3
_render_hotspots_line CC=2 out:3
_render_stats_line CC=5 out:7
render_header CC=8 out:18
code2llm.exporters.map.module_list [1 funcs]
render_module_list CC=4 out:8
code2llm.exporters.map.utils [3 funcs]
count_total_lines CC=5 out:5
detect_languages CC=8 out:10
file_line_count CC=2 out:4
code2llm.exporters.map.yaml_export [5 funcs]
_build_module_classes_data CC=6 out:5
_build_module_entry CC=2 out:6
_build_module_exports CC=6 out:4
_build_module_functions_data CC=7 out:2
export_to_yaml CC=8 out:19
code2llm.exporters.map_exporter [1 funcs]
export CC=1 out:10
code2llm.exporters.mermaid.calls [1 funcs]
export_calls CC=13 out:26
code2llm.exporters.mermaid.classic [4 funcs]
_render_cc_styles CC=6 out:12
_render_edges CC=8 out:9
_render_subgraphs CC=6 out:14
export_classic CC=1 out:5
code2llm.exporters.mermaid.compact [1 funcs]
export_compact CC=13 out:27
code2llm.exporters.mermaid.flow_compact [6 funcs]
_longest_path_dfs CC=7 out:5
_select_longest_path CC=4 out:4
build_callers_graph CC=4 out:4
export_flow_compact CC=1 out:9
find_critical_path CC=2 out:6
find_leaves CC=4 out:5
code2llm.exporters.mermaid.flow_detailed [1 funcs]
export_flow_detailed CC=1 out:14
code2llm.exporters.mermaid.flow_full [1 funcs]
export_flow_full CC=1 out:14
code2llm.exporters.mermaid.utils [3 funcs]
_sanitize_identifier CC=4 out:3
readable_id CC=1 out:1
safe_module CC=1 out:1
code2llm.exporters.mermaid_flow_helpers [12 funcs]
_append_entry_styles CC=3 out:3
_append_flow_node CC=4 out:6
_classify_architecture_module CC=4 out:3
_entry_points CC=3 out:2
_filtered_functions CC=4 out:4
_group_architecture_functions CC=2 out:3
_group_functions_by_module CC=2 out:4
_render_architecture_view CC=6 out:13
_render_flow_edges CC=11 out:10
_render_flow_styles CC=6 out:10
code2llm.exporters.project_yaml.core [3 funcs]
_build_project_yaml CC=12 out:25
_detect_primary_language CC=9 out:11
export CC=1 out:6
code2llm.exporters.project_yaml.health [3 funcs]
build_alerts CC=13 out:11
build_health CC=7 out:13
count_duplicates CC=5 out:8
code2llm.exporters.project_yaml.hotspots [3 funcs]
build_hotspots CC=5 out:7
build_refactoring CC=13 out:20
hotspot_note CC=7 out:5
code2llm.exporters.project_yaml.modules [7 funcs]
build_class_export CC=11 out:10
build_exports CC=2 out:3
build_function_exports CC=7 out:6
build_modules CC=5 out:11
compute_inbound_deps CC=5 out:3
compute_module_entry CC=4 out:12
group_by_file CC=5 out:8
code2llm.exporters.readme_exporter [1 funcs]
export CC=5 out:17
code2llm.exporters.toon.helpers [2 funcs]
_scan_line_counts CC=14 out:24
_walk_compat CC=2 out:2
code2llm.exporters.toon.metrics [2 funcs]
_compute_hotspots CC=5 out:7
compute_all_metrics CC=1 out:15
code2llm.exporters.toon.metrics_core [7 funcs]
_build_coupling_matrix CC=9 out:10
_build_function_to_module_map CC=3 out:2
_resolve_callee_module CC=6 out:4
compute_class_metrics CC=7 out:14
compute_file_metrics CC=12 out:25
compute_function_metrics CC=8 out:14
compute_package_metrics CC=5 out:9
code2llm.exporters.toon.metrics_duplicates [2 funcs]
_calculate_duplicate_info CC=6 out:14
detect_duplicates CC=4 out:5
code2llm.exporters.toon.module_detail [1 funcs]
_render_module_detail CC=3 out:10
code2llm.exporters.toon.renderer [2 funcs]
_detect_language_label CC=10 out:12
render_layers CC=2 out:8
code2llm.exporters.validate_project [2 funcs]
_check_required_keys CC=9 out:6
validate_project_yaml CC=11 out:17
code2llm.generators.llm_flow.analysis [2 funcs]
_node_counts_by_function CC=4 out:4
_pick_relevant_functions CC=8 out:11
code2llm.generators.llm_flow.cli [1 funcs]
main CC=3 out:18
code2llm.generators.llm_flow.generator [1 funcs]
generate_llm_flow CC=5 out:12
code2llm.generators.llm_task [14 funcs]
_apply_bullet_sections CC=6 out:10
_apply_simple_sections CC=5 out:4
_create_empty_task_data CC=1 out:0
_ensure_list CC=3 out:1
_load_json CC=2 out:3
_load_yaml CC=9 out:8
_parse_acceptance_tests CC=3 out:4
_parse_bullets CC=4 out:5
_parse_sections CC=7 out:8
_strip_bom CC=2 out:1
code2llm.generators.mermaid [1 funcs]
run_cli CC=1 out:8
examples.docker-doql-example.app.main [1 funcs]
log_message CC=1 out:2
examples.docker-doql-example.java.Main [6 funcs]
ApiHandler CC=1 out:0
HealthHandler CC=1 out:0
handle CC=1 out:2
main CC=1 out:12
mapToJson CC=4 out:6
sendResponse CC=1 out:8
examples.docker-doql-example.worker.worker [2 funcs]
main CC=1 out:9
process_message CC=1 out:4
examples.litellm.run [3 funcs]
get_refactoring_advice CC=2 out:5
main CC=1 out:17
run_analysis CC=4 out:8
examples.streaming-analyzer.demo [7 funcs]
demo_custom_progress CC=3 out:16
demo_deep_strategy CC=5 out:10
demo_incremental_analysis CC=5 out:19
demo_memory_limited CC=4 out:8
demo_quick_strategy CC=2 out:14
demo_standard_strategy CC=5 out:9
main CC=3 out:17
examples.streaming-analyzer.sample_project.main [7 funcs]
handle_default_request CC=2 out:4
handle_delete_request CC=4 out:5
handle_get_request CC=4 out:6
handle_set_request CC=4 out:5
process_request CC=6 out:11
start CC=4 out:4
main CC=3 out:5
map.toon [107 funcs]
_categorize_functions CC=0 out:0
_collect_entrypoints CC=0 out:0
_collect_functions CC=0 out:0
_collect_nodes CC=0 out:0
_dup_file_set CC=0 out:0
_entry_points CC=0 out:0
_export_simple_formats CC=0 out:0
_extract_declarations CC=0 out:0
_file_signature CC=0 out:0
_filtered_functions CC=0 out:0
pipeline [1 funcs]
run_pipeline CC=9 out:68
scripts.benchmark_badges [3 funcs]
create_html CC=4 out:3
get_shield_url CC=1 out:3
main CC=5 out:23
scripts.bump_version [7 funcs]
bump_version CC=4 out:5
format_version CC=1 out:0
get_current_version CC=3 out:9
main CC=3 out:11
parse_version CC=2 out:3
update_pyproject_toml CC=1 out:5
update_version_file CC=1 out:3
test_langs.invalid.sample_bad [2 funcs]
addUser CC=1 out:1
service CC=1 out:1
test_langs.valid.sample [9 funcs]
User CC=1 out:0
getName CC=1 out:0
addUser CC=1 out:0
getUser CC=2 out:1
main CC=2 out:6
service CC=1 out:1
add_user CC=1 out:1
get_user CC=1 out:2
main CC=2 out:3
test_python_only.valid.sample [2 funcs]
process_users CC=2 out:1
main CC=2 out:5
validate_toon [21 funcs]
_compare_all_aspects CC=1 out:5
_extract_keys_from_yaml CC=1 out:2
_extract_names_from_toon CC=3 out:4
_print_comparison_summary CC=5 out:5
_run_comparison_mode CC=7 out:12
_run_single_file_mode CC=6 out:12
analyze_class_differences CC=6 out:39
compare_basic_stats CC=4 out:11
compare_classes CC=1 out:19
compare_functions CC=6 out:24
EDGES:
validate_toon.load_yaml → Taskfile.print
validate_toon.load_file → map.toon.is_toon_file
validate_toon.load_file → validate_toon.load_yaml
validate_toon.load_file → map.toon.load_toon
validate_toon.extract_functions_from_toon → validate_toon._extract_names_from_toon
validate_toon.extract_classes_from_yaml → validate_toon._extract_keys_from_yaml
validate_toon.extract_classes_from_toon → validate_toon._extract_names_from_toon
validate_toon.analyze_class_differences → Taskfile.print
validate_toon.extract_modules_from_yaml → validate_toon._extract_keys_from_yaml
validate_toon.compare_basic_stats → Taskfile.print
validate_toon.compare_functions → Taskfile.print
validate_toon.compare_functions → validate_toon.extract_functions_from_yaml
validate_toon.compare_functions → validate_toon.extract_functions_from_toon
validate_toon.compare_classes → Taskfile.print
validate_toon.compare_classes → validate_toon.extract_classes_from_yaml
validate_toon.compare_classes → validate_toon.extract_classes_from_toon
validate_toon.compare_classes → validate_toon.analyze_class_differences
validate_toon.compare_modules → Taskfile.print
validate_toon.compare_modules → validate_toon.extract_modules_from_yaml
validate_toon.compare_modules → validate_toon.extract_modules_from_toon
validate_toon.validate_toon_completeness → Taskfile.print
validate_toon._run_single_file_mode → Taskfile.print
validate_toon._run_single_file_mode → validate_toon.load_file
validate_toon._run_single_file_mode → validate_toon.validate_toon_completeness
validate_toon._run_comparison_mode → Taskfile.print
validate_toon._run_comparison_mode → validate_toon.load_yaml
validate_toon._run_comparison_mode → validate_toon.load_file
validate_toon._run_comparison_mode → validate_toon._compare_all_aspects
validate_toon._run_comparison_mode → validate_toon._print_comparison_summary
validate_toon._compare_all_aspects → validate_toon.compare_basic_stats
validate_toon._compare_all_aspects → validate_toon.compare_functions
validate_toon._compare_all_aspects → validate_toon.compare_classes
validate_toon._compare_all_aspects → validate_toon.compare_modules
validate_toon._compare_all_aspects → validate_toon.validate_toon_completeness
validate_toon._print_comparison_summary → Taskfile.print
validate_toon.main → validate_toon._run_single_file_mode
validate_toon.main → validate_toon._run_comparison_mode
validate_toon.main → Taskfile.print
pipeline.run_pipeline → Taskfile.print
test_langs.valid.sample.main → test_langs.valid.sample.add_user
test_langs.valid.sample.main → test_langs.valid.sample.get_user
test_langs.valid.sample.UserService.service → test_langs.valid.sample.UserService.addUser
test_langs.valid.sample.UserService.main → test_langs.valid.sample.UserService.addUser
test_langs.valid.sample.UserService.main → test_langs.valid.sample.User.User
test_langs.valid.sample.UserService.main → test_langs.valid.sample.UserService.getUser
test_langs.valid.sample.UserService.main → test_langs.valid.sample.User.getName
test_langs.invalid.sample_bad.UserService.service → test_langs.invalid.sample_bad.UserService.addUser
examples.litellm.run.run_analysis → Taskfile.print
examples.litellm.run.get_refactoring_advice → Taskfile.print
examples.litellm.run.main → examples.litellm.run.run_analysis
Scenarios as contract signatures — what the system guarantees.
Auto-generated API Smoke Tests
- assert
_status < 500 - assert
_status >= 200 - detectors: FlaskDetector, ConfigEndpointDetector
CLI Command Tests
Auto-generated from Python Tests
High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries