11<!-- code2docs:start --> # code2llm
22
3- ![ version] ( https://img.shields.io/badge/version-0.1.0-blue ) ![ python] ( https://img.shields.io/badge/python-%3E%3D3.8-blue ) ![ coverage] ( https://img.shields.io/badge/coverage-unknown-lightgrey ) ![ functions] ( https://img.shields.io/badge/functions-1233 -green )
4- > ** 1233 ** functions | ** 143** classes | ** 289 ** files | CC̄ = 3.9
3+ ![ version] ( https://img.shields.io/badge/version-0.1.0-blue ) ![ python] ( https://img.shields.io/badge/python-%3E%3D3.8-blue ) ![ coverage] ( https://img.shields.io/badge/coverage-unknown-lightgrey ) ![ functions] ( https://img.shields.io/badge/functions-1242 -green )
4+ > ** 1242 ** functions | ** 143** classes | ** 297 ** files | CC̄ = 3.9
55
66> Auto-generated project documentation from source code analysis.
77
@@ -74,11 +74,14 @@ docs = generate_docs("./my-project", config=config)
7474code2llm/
7575 ├── toon
7676├── redsl
77+ ├── deps
7778├── orchestrator
7879├── goal
80+ ├── regix
7981├── planfile
8082├── Makefile
8183 ├── toon
84+ ├── wup
8285├── setup
8386├── validate_toon
8487├── pyqual
@@ -133,8 +136,6 @@ code2llm/
133136 ├── bump_version
134137 ├── server
135138 ├── toon
136- ├── toon
137- ├── toon
138139 ├── valid/
139140 ├── sample
140141 ├── cli
@@ -152,6 +153,7 @@ code2llm/
152153 ├── dfg
153154 ├── call_graph
154155 ├── pipeline_classifier
156+ ├── _data_impl
155157 ├── coupling
156158 ├── cfg
157159 ├── side_effects
@@ -186,6 +188,8 @@ code2llm/
186188 ├── ruby
187189 ├── base
188190 ├── cpp
191+ ├── _complexity
192+ ├── _calls
189193 ├── lang/
190194 ├── ts_extractors
191195 ├── ts_parser
@@ -195,6 +199,7 @@ code2llm/
195199 ├── java
196200 ├── generic
197201 ├── typescript
202+ ├── _c_parser
198203 ├── config
199204 ├── nlp/
200205 ├── intent_matching
@@ -232,13 +237,16 @@ code2llm/
232237 ├── readme/
233238 ├── insights
234239 ├── sections
240+ ├── _render_section_helpers
235241 ├── helpers
236242 ├── metrics_duplicates
237243 ├── metrics
238244 ├── module_detail
239245 ├── metrics_health
246+ ├── _render_coupling_helpers
240247 ├── metrics_core
241248 ├── renderer
249+ ├── constants
242250 ├── evolution
243251 ├── project_yaml/
244252 ├── health
@@ -296,48 +304,48 @@ code2llm/
296304 ├── toon_parser
297305 ├── detector
298306 ├── sample
299- ├── prompt_sumd_sumr_feature
300307├── redsl_refactor_report
301- ├── redsl_refactor_plan
302- ├── REFACTORING_PLAN
303- ├── ROADMAP
304- ├── CHANGELOG
308+ ├── prompt_sumd_sumr_feature
305309├── TODO
306- ├── context
307- ├── context
310+ ├── ROADMAP
311+ ├── redsl_refactor_plan
308312 ├── context
309313 ├── README
314+ ├── context
315+ ├── context
316+ ├── context
317+ ├── CHANGELOG
318+ ├── context
310319 ├── context
320+ ├── REFACTORING_PLAN
311321 ├── LLM_USAGE
322+ ├── README
312323 ├── API
313324 ├── PROJECT_SUMMARY
314- ├── README
315325 ├── README
326+ ├── METHODOLOGY
316327 ├── README
317328 ├── README
318- ├── context
329+ ├── README
319330 ├── README
331+ ├── README
332+ ├── ANALYSIS
333+ ├── SUMMARY
320334 ├── README
321335 ├── README
322- ├── DEPENDENCY_ANALYSIS
336+ ├── README
337+ ├── context
338+ ├── context
323339 ├── COMPARISON_AND_OPTIMIZATION
324340 ├── context
325- ├── SUMMARY
326- ├── ANALYSIS
327- ├── context
328- ├── README
329341 ├── context
330- ├── context
331- ├── README
332342 ├── context
343+ ├── context
344+ ├── DEPENDENCY_ANALYSIS
333345 ├── extract_method
346+ ├── context
334347 ├── move_method
335- ├── context
336348 ├── README
337- ├── context
338- ├── context
339- ├── METHODOLOGY
340- ├── README
341349```
342350
343351## API Overview
@@ -479,7 +487,7 @@ code2llm/
479487- ** ` IndexHTMLGenerator ` ** — Generate index.html for browsing all generated files.
480488- ** ` FileScanner ` ** — Scan output directory and collect file metadata.
481489- ** ` HTMLRenderer ` ** — Render the index.html page with CSS and JavaScript.
482- - ** ` FuncSummary ` ** — —
490+ - ** ` FuncSummary ` ** — Immutable summary of a single function's decisions and outgoing calls.
483491- ** ` PromptEngine ` ** — Generate refactoring prompts from analysis results and detected smells.
484492- ** ` PatternDetector ` ** — Detect behavioral patterns in code.
485493- ** ` User ` ** — —
@@ -507,7 +515,6 @@ code2llm/
507515- ` validate_toon_completeness(toon_data) ` — Validate toon format structure.
508516- ` main() ` — Main validation function.
509517- ` run_pipeline(project_dir, output_dir) ` — Run unified pipeline in single process.
510- - ` print() ` — —
511518- ` NewUserService() ` — —
512519- ` AddUser() ` — —
513520- ` GetUser() ` — —
@@ -629,19 +636,19 @@ code2llm/
629636- ` clear_all(cache_root) ` — Delete entire ~ /.code2llm/ cache.
630637- ` analyze_rust(content, file_path, module_name, ext) ` — Analyze Rust files using regex-based parsing.
631638- ` analyze_ruby(content, file_path, module_name, ext) ` — Analyze Ruby files using shared extraction.
639+ - ` analyze_c_family(content, file_path, module_name, stats) ` — Shared analyzer for C-family languages (Java, C#, C++, etc.).
640+ - ` analyze_cpp(content, file_path, module_name, ext) ` — Analyze C++ files using shared C-family extraction.
632641- ` extract_function_body(content, start_line) ` — Extract the body of a function between braces from a start line (1-indexed).
633642- ` calculate_complexity_regex(content, result, lang) ` — Estimate cyclomatic complexity for every function using regex keyword counting.
634643- ` extract_calls_regex(content, module_name, result) ` — Extract function calls from function bodies using regex.
635- - ` analyze_c_family(content, file_path, module_name, stats) ` — Shared analyzer for C-family languages (Java, C#, C++, etc.).
636- - ` analyze_cpp(content, file_path, module_name, ext) ` — Analyze C++ files using shared C-family extraction.
637644- ` register_language() ` — Decorator to register a language parser.
638645- ` get_parser(extension) ` — Get parser for a file extension.
639646- ` list_parsers() ` — List all registered parsers.
640647- ` extract_declarations_ts(tree, source_bytes, ext, file_path) ` — Extract all declarations from a tree-sitter tree.
641648- ` get_parser() ` — Get global TreeSitterParser instance.
642649- ` parse_source(content, ext) ` — Convenience function: parse string content for given extension.
643650- ` is_available() ` — Check if tree-sitter is available.
644- - ` analyze_php(content, file_path, module_name, ext) ` — —
651+ - ` analyze_php(content, file_path, module_name, ext) ` — Analyze a PHP source file and return declarations, complexity, and call info.
645652- ` analyze_csharp(content, file_path, module_name, ext) ` — Analyze C# files using shared C-family extraction.
646653- ` analyze_go(content, file_path, module_name, ext) ` — Analyze Go files. Uses tree-sitter when available, regex fallback.
647654- ` analyze_java(content, file_path, module_name, ext) ` — Analyze Java files using shared C-family extraction.
@@ -663,6 +670,12 @@ code2llm/
663670- ` build_core_files_section(existing, insights) ` — Build the Core Analysis Files section dynamically.
664671- ` build_llm_files_section(existing) ` — Build the LLM-Ready Documentation section dynamically.
665672- ` build_viz_files_section(existing) ` — Build the Visualizations section dynamically.
673+ - ` render_health_section(ctx) ` — Render health section.
674+ - ` render_refactor_section(ctx) ` — Generate numbered refactoring steps from health issues.
675+ - ` render_hotspots_section(ctx) ` — Render hotspots section.
676+ - ` render_classes_section(ctx) ` — Render CLASSES section with visual bar chart proportional to method count.
677+ - ` render_external_section(_ctx) ` — Render EXTERNAL section - cross-references to other tools.
678+ - ` render_pipelines_section(ctx) ` — Render PIPELINES section - data flow pipelines from entry points.
666679- ` build_evolution(health, total_lines, prev_evolution) ` — Build append-only evolution history.
667680- ` load_previous_evolution(output_path) ` — Load previous evolution entries from existing project.yaml.
668681- ` build_health(result, modules) ` — Build health section with CC metrics, alerts, and issues.
@@ -727,16 +740,16 @@ code2llm/
727740- ` get_cc(fi) ` — Extract cyclomatic complexity from FunctionInfo.
728741- ` export_flow_full(result, output_path, include_examples) ` — Export full debug view with all nodes (original flow.mmd).
729742- ` dump_yaml(data) ` — Shared YAML serialiser (sort_keys=False, unicode, width=100).
730- - ` normalize_llm_task(data) ` — —
743+ - ` normalize_llm_task(data) ` — Normalise a raw LLM task dict into a canonical structure with all required keys.
731744- ` parse_llm_task_text(text) ` — Parse LLM task text into structured data.
732745- ` load_input(path) ` — Load input file with detailed YAML/JSON error reporting.
733- - ` create_parser() ` — —
734- - ` main(argv) ` — —
746+ - ` create_parser() ` — Build and return the CLI argument parser for the LLM task generator.
747+ - ` main(argv) ` — Entry point for the LLM task generator CLI.
735748- ` run_cli() ` — Run the CLI interface for generating PNGs from Mermaid files.
736- - ` create_parser() ` — —
737- - ` main(argv) ` — —
738- - ` generate_llm_flow(analysis, max_functions, limit_decisions, limit_calls) ` — —
739- - ` render_llm_flow_md(flow) ` — —
749+ - ` create_parser() ` — Build and return the argument parser for the llm-flow-generator CLI.
750+ - ` main(argv) ` — Entry point: parse args, run flow generation, write output files.
751+ - ` generate_llm_flow(analysis, max_functions, limit_decisions, limit_calls) ` — Build a compact LLM-friendly flow dict from a code2llm analysis result.
752+ - ` render_llm_flow_md(flow) ` — Render a flow dict (from generate_llm_flow) as a Markdown summary string.
740753- ` validate_mermaid_file(mmd_path) ` — Validate Mermaid file and return list of errors.
741754- ` generate_pngs(input_dir, output_dir, timeout, max_workers) ` — Generate PNG files from all .mmd files in input_dir (parallel).
742755- ` generate_single_png(mmd_file, output_file, timeout) ` — Generate PNG from single Mermaid file using available renderers.
@@ -755,7 +768,7 @@ code2llm/
755768📄 ` REFACTORING_PLAN `
756769📄 ` ROADMAP `
757770📄 ` TODO `
758- 📄 ` Taskfile ` (2 functions)
771+ 📄 ` Taskfile `
759772📄 ` badges.server ` (3 functions)
760773📄 ` benchmarks.benchmark_constants `
761774📄 ` benchmarks.benchmark_evolution ` (4 functions)
@@ -768,10 +781,11 @@ code2llm/
768781📦 ` code2llm ` (1 functions)
769782📄 ` code2llm.__main__ `
770783📦 ` code2llm.analysis ` (1 functions)
784+ 📄 ` code2llm.analysis._data_impl ` (14 functions)
771785📄 ` code2llm.analysis.call_graph ` (12 functions, 1 classes)
772786📄 ` code2llm.analysis.cfg ` (16 functions, 1 classes)
773787📄 ` code2llm.analysis.coupling ` (5 functions, 1 classes)
774- 📄 ` code2llm.analysis.data_analysis ` (28 functions, 3 classes)
788+ 📄 ` code2llm.analysis.data_analysis ` (14 functions, 3 classes)
775789📄 ` code2llm.analysis.dfg ` (12 functions, 1 classes)
776790📄 ` code2llm.analysis.pipeline_classifier ` (5 functions, 1 classes)
777791📄 ` code2llm.analysis.pipeline_detector ` (9 functions, 3 classes)
@@ -788,7 +802,7 @@ code2llm/
788802📦 ` code2llm.cli_exports `
789803📄 ` code2llm.cli_exports.code2logic ` (8 functions)
790804📄 ` code2llm.cli_exports.formats ` (16 functions)
791- 📄 ` code2llm.cli_exports.orchestrator ` (15 functions)
805+ 📄 ` code2llm.cli_exports.orchestrator ` (17 functions)
792806📄 ` code2llm.cli_exports.orchestrator_chunked ` (3 functions)
793807📄 ` code2llm.cli_exports.orchestrator_constants `
794808📄 ` code2llm.cli_exports.orchestrator_handlers ` (8 functions)
@@ -805,7 +819,10 @@ code2llm/
805819📄 ` code2llm.core.gitignore ` (8 functions, 2 classes)
806820📄 ` code2llm.core.incremental ` (10 functions, 1 classes)
807821📦 ` code2llm.core.lang ` (5 functions, 1 classes)
808- 📄 ` code2llm.core.lang.base ` (14 functions)
822+ 📄 ` code2llm.core.lang._c_parser ` (9 functions)
823+ 📄 ` code2llm.core.lang._calls ` (2 functions)
824+ 📄 ` code2llm.core.lang._complexity ` (2 functions)
825+ 📄 ` code2llm.core.lang.base ` (1 functions)
809826📄 ` code2llm.core.lang.cpp ` (1 functions)
810827📄 ` code2llm.core.lang.csharp ` (1 functions)
811828📄 ` code2llm.core.lang.generic ` (1 functions)
@@ -839,7 +856,7 @@ code2llm/
839856📄 ` code2llm.exporters.dashboard_data ` (9 functions, 1 classes)
840857📄 ` code2llm.exporters.dashboard_renderer ` (4 functions, 1 classes)
841858📦 ` code2llm.exporters.evolution `
842- 📄 ` code2llm.exporters.evolution.computation ` (8 functions)
859+ 📄 ` code2llm.exporters.evolution.computation ` (10 functions)
843860📄 ` code2llm.exporters.evolution.constants `
844861📄 ` code2llm.exporters.evolution.exclusion ` (1 functions)
845862📄 ` code2llm.exporters.evolution.render ` (6 functions)
@@ -889,13 +906,16 @@ code2llm/
889906📄 ` code2llm.exporters.readme_exporter ` (1 functions, 1 classes)
890907📄 ` code2llm.exporters.report_generators ` (1 functions)
891908📦 ` code2llm.exporters.toon ` (11 functions, 1 classes)
909+ 📄 ` code2llm.exporters.toon._render_coupling_helpers ` (10 functions)
910+ 📄 ` code2llm.exporters.toon._render_section_helpers ` (9 functions)
911+ 📄 ` code2llm.exporters.toon.constants `
892912📄 ` code2llm.exporters.toon.helpers ` (9 functions)
893913📄 ` code2llm.exporters.toon.metrics ` (4 functions, 1 classes)
894914📄 ` code2llm.exporters.toon.metrics_core ` (13 functions, 1 classes)
895915📄 ` code2llm.exporters.toon.metrics_duplicates ` (4 functions, 1 classes)
896916📄 ` code2llm.exporters.toon.metrics_health ` (6 functions, 1 classes)
897917📄 ` code2llm.exporters.toon.module_detail ` (9 functions, 1 classes)
898- 📄 ` code2llm.exporters.toon.renderer ` (26 functions, 1 classes)
918+ 📄 ` code2llm.exporters.toon.renderer ` (13 functions, 1 classes)
899919📄 ` code2llm.exporters.toon_view ` (8 functions, 1 classes)
900920📄 ` code2llm.exporters.validate_project ` (3 functions)
901921📄 ` code2llm.exporters.yaml_exporter ` (25 functions, 1 classes)
@@ -926,6 +946,7 @@ code2llm/
926946📄 ` code2llm.templates.extract_method `
927947📄 ` code2llm.templates.move_method `
928948📄 ` demo_langs.valid.sample ` (7 functions, 2 classes)
949+ 📄 ` deps `
929950📄 ` docs.API `
930951📄 ` docs.COMPARISON_AND_OPTIMIZATION `
931952📄 ` docs.LLM_USAGE `
@@ -988,6 +1009,7 @@ code2llm/
9881009📄 ` redsl_refactor_plan.toon `
9891010📄 ` redsl_refactor_report `
9901011📄 ` redsl_refactor_report.toon `
1012+ 📄 ` regix `
9911013📄 ` requirements `
9921014📄 ` scripts.benchmark_badges ` (9 functions)
9931015📄 ` scripts.bump_version ` (7 functions)
@@ -1012,10 +1034,9 @@ code2llm/
10121034📄 ` test_prompt.root.context `
10131035📦 ` test_python_only.valid `
10141036📄 ` test_python_only.valid.sample ` (5 functions, 2 classes)
1015- 📄 ` testql-scenarios.generated-api-smoke.testql.toon `
10161037📄 ` testql-scenarios.generated-cli-tests.testql.toon `
1017- 📄 ` testql-scenarios.generated-from-pytests.testql.toon `
10181038📄 ` validate_toon ` (21 functions)
1039+ 📄 ` wup `
10191040
10201041## Requirements
10211042
0 commit comments