- Project: .
- Primary Language: python
- Languages: python: 126, shell: 4, java: 1
- Analysis Mode: static
- Total Functions: 1006
- Total Classes: 111
- Modules: 131
- Entry Points: 0
- Functions: 50
- Classes: 15
- File:
functional_refactoring_example.py
- Functions: 27
- Classes: 1
- File:
metrics.py
- Functions: 26
- Classes: 1
- File:
renderer.py
- Functions: 25
- Classes: 1
- File:
map_exporter.py
- Functions: 24
- Classes: 1
- File:
llm_flow.py
- Functions: 20
- Classes: 2
- File:
large_repo.py
- Functions: 20
- Classes: 3
- File:
pipeline.py
- Functions: 19
- Classes: 1
- File:
mermaid_exporter.py
- Functions: 18
- Classes: 1
- File:
data_analysis.py
- Functions: 18
- Classes: 3
- File:
pipeline_detector.py
- Functions: 18
- Classes: 1
- File:
file_analyzer.py
- Functions: 18
- Classes: 1
- File:
project_yaml_exporter.py
- Functions: 18
- File:
prompt.py
- Functions: 17
- Classes: 1
- File:
type_inference.py
- Functions: 17
- Classes: 1
- File:
cfg.py
- Functions: 17
- Classes: 1
- File:
evolution_exporter.py
- Functions: 16
- Classes: 3
- File:
entity_resolution.py
- Functions: 16
- File:
mermaid.py
- Functions: 15
- File:
validate_toon.py
- Functions: 15
- Classes: 2
- File:
side_effects.py
Main execution flows into the system:
Key execution flows identified:
Computes all metrics for TOON export.
- Methods: 27
- Key Methods: code2llm.exporters.toon.metrics.MetricsComputer.init, code2llm.exporters.toon.metrics.MetricsComputer.compute_all_metrics, code2llm.exporters.toon.metrics.MetricsComputer._compute_file_metrics, code2llm.exporters.toon.metrics.MetricsComputer._new_file_record, code2llm.exporters.toon.metrics.MetricsComputer._compute_fan_in, code2llm.exporters.toon.metrics.MetricsComputer._process_function_calls, code2llm.exporters.toon.metrics.MetricsComputer._process_called_by, code2llm.exporters.toon.metrics.MetricsComputer._process_callee_calls, code2llm.exporters.toon.metrics.MetricsComputer._handle_suffix_match, code2llm.exporters.toon.metrics.MetricsComputer._compute_package_metrics
Renders all sections for TOON export.
- Methods: 26
- Key Methods: code2llm.exporters.toon.renderer.ToonRenderer.render_header, code2llm.exporters.toon.renderer.ToonRenderer._detect_language_label, code2llm.exporters.toon.renderer.ToonRenderer.render_health, code2llm.exporters.toon.renderer.ToonRenderer.render_refactor, code2llm.exporters.toon.renderer.ToonRenderer.render_coupling, code2llm.exporters.toon.renderer.ToonRenderer._select_top_packages, code2llm.exporters.toon.renderer.ToonRenderer._render_coupling_header, code2llm.exporters.toon.renderer.ToonRenderer._render_coupling_rows, code2llm.exporters.toon.renderer.ToonRenderer._build_coupling_row, code2llm.exporters.toon.renderer.ToonRenderer._coupling_row_tag
Export to map.toon.yaml — structural map with a compact project header.
Keys: M=modules, D=details,
- Methods: 25
- Key Methods: code2llm.exporters.map_exporter.MapExporter.export, code2llm.exporters.map_exporter.MapExporter.export_to_yaml, code2llm.exporters.map_exporter.MapExporter._build_module_entry, code2llm.exporters.map_exporter.MapExporter._build_module_exports, code2llm.exporters.map_exporter.MapExporter._build_module_classes_data, code2llm.exporters.map_exporter.MapExporter._build_module_functions_data, code2llm.exporters.map_exporter.MapExporter._render_header, code2llm.exporters.map_exporter.MapExporter._render_stats_line, code2llm.exporters.map_exporter.MapExporter._render_alerts_line, code2llm.exporters.map_exporter.MapExporter._render_hotspots_line
- Inherits: Exporter
Export call graph to Mermaid format.
- Methods: 19
- Key Methods: code2llm.exporters.mermaid_exporter.MermaidExporter.export, code2llm.exporters.mermaid_exporter.MermaidExporter._render_subgraphs, code2llm.exporters.mermaid_exporter.MermaidExporter._render_edges, code2llm.exporters.mermaid_exporter.MermaidExporter._render_cc_styles, code2llm.exporters.mermaid_exporter.MermaidExporter._get_cc, code2llm.exporters.mermaid_exporter.MermaidExporter.export_call_graph, code2llm.exporters.mermaid_exporter.MermaidExporter.export_compact, code2llm.exporters.mermaid_exporter.MermaidExporter._should_skip_module, code2llm.exporters.mermaid_exporter.MermaidExporter._is_entry_point, code2llm.exporters.mermaid_exporter.MermaidExporter._find_critical_path
- Inherits: Exporter
Splits large repositories using hierarchical approach.
Strategy:
- First pass: level 1 folders
- Methods: 18
- Key Methods: code2llm.core.large_repo.HierarchicalRepoSplitter.init, code2llm.core.large_repo.HierarchicalRepoSplitter.get_analysis_plan, code2llm.core.large_repo.HierarchicalRepoSplitter._split_hierarchically, code2llm.core.large_repo.HierarchicalRepoSplitter._merge_small_l1_dirs, code2llm.core.large_repo.HierarchicalRepoSplitter._split_level2_consolidated, code2llm.core.large_repo.HierarchicalRepoSplitter._categorize_subdirs, code2llm.core.large_repo.HierarchicalRepoSplitter._process_large_dirs, code2llm.core.large_repo.HierarchicalRepoSplitter._process_level1_files, code2llm.core.large_repo.HierarchicalRepoSplitter._merge_small_dirs, code2llm.core.large_repo.HierarchicalRepoSplitter._chunk_by_files
Export unified project.yaml — single source of truth for diagnostics.
Combines data from analysis.t
- Methods: 18
- Key Methods: code2llm.exporters.project_yaml_exporter.ProjectYAMLExporter.export, code2llm.exporters.project_yaml_exporter.ProjectYAMLExporter._build_project_yaml, code2llm.exporters.project_yaml_exporter.ProjectYAMLExporter._build_health, code2llm.exporters.project_yaml_exporter.ProjectYAMLExporter._build_alerts, code2llm.exporters.project_yaml_exporter.ProjectYAMLExporter._count_duplicates, code2llm.exporters.project_yaml_exporter.ProjectYAMLExporter._build_modules, code2llm.exporters.project_yaml_exporter.ProjectYAMLExporter._group_by_file, code2llm.exporters.project_yaml_exporter.ProjectYAMLExporter._compute_module_entry, code2llm.exporters.project_yaml_exporter.ProjectYAMLExporter._compute_inbound_deps, code2llm.exporters.project_yaml_exporter.ProjectYAMLExporter._build_exports
- Inherits: Exporter
Extract and infer type information from Python source files.
Operates on source files referenced by
- Methods: 17
- Key Methods: code2llm.analysis.type_inference.TypeInferenceEngine.init, code2llm.analysis.type_inference.TypeInferenceEngine.enrich_function, code2llm.analysis.type_inference.TypeInferenceEngine.get_arg_types, code2llm.analysis.type_inference.TypeInferenceEngine.get_return_type, code2llm.analysis.type_inference.TypeInferenceEngine.get_typed_signature, code2llm.analysis.type_inference.TypeInferenceEngine.extract_all_types, code2llm.analysis.type_inference.TypeInferenceEngine._extract_from_node, code2llm.analysis.type_inference.TypeInferenceEngine._extract_args, code2llm.analysis.type_inference.TypeInferenceEngine._annotation_to_str, code2llm.analysis.type_inference.TypeInferenceEngine._ann_constant
Detect pipelines in a codebase using networkx graph analysis.
Builds a call graph as a DiGraph, fin
- Methods: 17
- Key Methods: code2llm.analysis.pipeline_detector.PipelineDetector.init, code2llm.analysis.pipeline_detector.PipelineDetector.detect, code2llm.analysis.pipeline_detector.PipelineDetector._build_graph, code2llm.analysis.pipeline_detector.PipelineDetector._find_pipeline_paths, code2llm.analysis.pipeline_detector.PipelineDetector._longest_path_from, code2llm.analysis.pipeline_detector.PipelineDetector._longest_path_in_dag, code2llm.analysis.pipeline_detector.PipelineDetector._build_pipelines, code2llm.analysis.pipeline_detector.PipelineDetector._build_stages, code2llm.analysis.pipeline_detector.PipelineDetector._classify_domain, code2llm.analysis.pipeline_detector.PipelineDetector._derive_pipeline_name
Extract Control Flow Graph from AST.
- Methods: 17
- Key Methods: code2llm.analysis.cfg.CFGExtractor.init, code2llm.analysis.cfg.CFGExtractor.extract, code2llm.analysis.cfg.CFGExtractor.new_node, code2llm.analysis.cfg.CFGExtractor.connect, code2llm.analysis.cfg.CFGExtractor.visit_FunctionDef, code2llm.analysis.cfg.CFGExtractor.visit_AsyncFunctionDef, code2llm.analysis.cfg.CFGExtractor.visit_If, code2llm.analysis.cfg.CFGExtractor.visit_For, code2llm.analysis.cfg.CFGExtractor.visit_While, code2llm.analysis.cfg.CFGExtractor.visit_Try
- Inherits: ast.NodeVisitor
Analyzes a single file.
- Methods: 17
- Key Methods: code2llm.core.file_analyzer.FileAnalyzer.init, code2llm.core.file_analyzer.FileAnalyzer._route_to_language_analyzer, code2llm.core.file_analyzer.FileAnalyzer.analyze_file, code2llm.core.file_analyzer.FileAnalyzer._analyze_python, code2llm.core.file_analyzer.FileAnalyzer._analyze_ast, code2llm.core.file_analyzer.FileAnalyzer._calculate_complexity, code2llm.core.file_analyzer.FileAnalyzer._perform_deep_analysis, code2llm.core.file_analyzer.FileAnalyzer._process_class, code2llm.core.file_analyzer.FileAnalyzer._process_function, code2llm.core.file_analyzer.FileAnalyzer._build_cfg
Export evolution.toon.yaml — prioritized refactoring queue.
- Methods: 17
- Key Methods: code2llm.exporters.evolution_exporter.EvolutionExporter._is_excluded, code2llm.exporters.evolution_exporter.EvolutionExporter.export, code2llm.exporters.evolution_exporter.EvolutionExporter.export_to_yaml, code2llm.exporters.evolution_exporter.EvolutionExporter._build_context, code2llm.exporters.evolution_exporter.EvolutionExporter._compute_func_data, code2llm.exporters.evolution_exporter.EvolutionExporter._scan_file_sizes, code2llm.exporters.evolution_exporter.EvolutionExporter._aggregate_file_stats, code2llm.exporters.evolution_exporter.EvolutionExporter._make_relative_path, code2llm.exporters.evolution_exporter.EvolutionExporter._filter_god_modules, code2llm.exporters.evolution_exporter.EvolutionExporter._compute_god_modules
- Inherits: Exporter
Analyze data flows, structures, and optimization opportunities.
- Methods: 16
- Key Methods: code2llm.analysis.data_analysis.DataAnalyzer.analyze_data_flow, code2llm.analysis.data_analysis.DataAnalyzer.analyze_data_structures, code2llm.analysis.data_analysis.DataAnalyzer._find_data_pipelines, code2llm.analysis.data_analysis.DataAnalyzer._find_state_patterns, code2llm.analysis.data_analysis.DataAnalyzer._find_data_dependencies, code2llm.analysis.data_analysis.DataAnalyzer._find_event_flows, code2llm.analysis.data_analysis.DataAnalyzer._detect_types_from_name, code2llm.analysis.data_analysis.DataAnalyzer._create_type_entry, code2llm.analysis.data_analysis.DataAnalyzer._update_type_stats, code2llm.analysis.data_analysis.DataAnalyzer._analyze_data_types
Main NLP processing pipeline (4a-4e).
- Methods: 16
- Key Methods: code2llm.nlp.pipeline.NLPPipeline.init, code2llm.nlp.pipeline.NLPPipeline.process, code2llm.nlp.pipeline.NLPPipeline._step_normalize, code2llm.nlp.pipeline.NLPPipeline._step_match_intent, code2llm.nlp.pipeline.NLPPipeline._step_resolve_entities, code2llm.nlp.pipeline.NLPPipeline._infer_entity_types, code2llm.nlp.pipeline.NLPPipeline._calculate_overall_confidence, code2llm.nlp.pipeline.NLPPipeline._calculate_entity_confidence, code2llm.nlp.pipeline.NLPPipeline._apply_fallback, code2llm.nlp.pipeline.NLPPipeline._format_action
Export LLM-ready analysis summary with architecture and flows.
Output: context.md — architecture na
- Methods: 15
- Key Methods: code2llm.exporters.context_exporter.ContextExporter.export, code2llm.exporters.context_exporter.ContextExporter._get_overview, code2llm.exporters.context_exporter.ContextExporter._detect_languages, code2llm.exporters.context_exporter.ContextExporter._get_architecture_by_module, code2llm.exporters.context_exporter.ContextExporter._get_important_entries, code2llm.exporters.context_exporter.ContextExporter._get_key_entry_points, code2llm.exporters.context_exporter.ContextExporter._get_process_flows, code2llm.exporters.context_exporter.ContextExporter._get_key_classes, code2llm.exporters.context_exporter.ContextExporter._get_data_transformations, code2llm.exporters.context_exporter.ContextExporter._get_behavioral_patterns
- Inherits: Exporter
Resolve entities (functions, classes, etc.) from queries.
- Methods: 14
- Key Methods: code2llm.nlp.entity_resolution.EntityResolver.init, code2llm.nlp.entity_resolution.EntityResolver.resolve, code2llm.nlp.entity_resolution.EntityResolver._extract_candidates, code2llm.nlp.entity_resolution.EntityResolver._extract_from_patterns, code2llm.nlp.entity_resolution.EntityResolver._disambiguate, code2llm.nlp.entity_resolution.EntityResolver._resolve_hierarchical, code2llm.nlp.entity_resolution.EntityResolver._resolve_aliases, code2llm.nlp.entity_resolution.EntityResolver._name_similarity, code2llm.nlp.entity_resolution.EntityResolver.load_from_analysis, code2llm.nlp.entity_resolution.EntityResolver.step_3a_extract_entities
Generate dashboard.html from project.yaml data.
- Methods: 14
- Key Methods: code2llm.exporters.html_dashboard.HTMLDashboardGenerator.generate, code2llm.exporters.html_dashboard.HTMLDashboardGenerator._render, code2llm.exporters.html_dashboard.HTMLDashboardGenerator._health_verdict, code2llm.exporters.html_dashboard.HTMLDashboardGenerator._build_evolution_section, code2llm.exporters.html_dashboard.HTMLDashboardGenerator._build_language_breakdown, code2llm.exporters.html_dashboard.HTMLDashboardGenerator._build_module_lines_chart, code2llm.exporters.html_dashboard.HTMLDashboardGenerator._build_module_funcs_chart, code2llm.exporters.html_dashboard.HTMLDashboardGenerator._build_top_modules_html, code2llm.exporters.html_dashboard.HTMLDashboardGenerator._build_alerts_html, code2llm.exporters.html_dashboard.HTMLDashboardGenerator._build_hotspots_html
Export to flow.toon — data-flow focused format.
Sections: PIPELINES, TRANSFORMS, CONTRACTS, DATA_TY
- Methods: 14
- Key Methods: code2llm.exporters.flow_exporter.FlowExporter.init, code2llm.exporters.flow_exporter.FlowExporter.export, code2llm.exporters.flow_exporter.FlowExporter._build_context, code2llm.exporters.flow_exporter.FlowExporter._pipeline_to_dict, code2llm.exporters.flow_exporter.FlowExporter._compute_transforms, code2llm.exporters.flow_exporter.FlowExporter._transform_label, code2llm.exporters.flow_exporter.FlowExporter._compute_type_usage, code2llm.exporters.flow_exporter.FlowExporter._normalize_type, code2llm.exporters.flow_exporter.FlowExporter._type_label, code2llm.exporters.flow_exporter.FlowExporter._classify_side_effects
- Inherits: Exporter
Simple database connection simulator.
- Methods: 13
- Key Methods: examples.streaming-analyzer.sample_project.database.DatabaseConnection.init, examples.streaming-analyzer.sample_project.database.DatabaseConnection._load_data, examples.streaming-analyzer.sample_project.database.DatabaseConnection._save_data, examples.streaming-analyzer.sample_project.database.DatabaseConnection.get_user, examples.streaming-analyzer.sample_project.database.DatabaseConnection.get_user_settings, examples.streaming-analyzer.sample_project.database.DatabaseConnection.get_user_logs, examples.streaming-analyzer.sample_project.database.DatabaseConnection.update_user_settings, examples.streaming-analyzer.sample_project.database.DatabaseConnection.update_user_profile, examples.streaming-analyzer.sample_project.database.DatabaseConnection.delete_user, examples.streaming-analyzer.sample_project.database.DatabaseConnection.clear_user_data
Detect side effects in Python functions via AST analysis.
Scans function bodies for IO operations,
- Methods: 13
- Key Methods: code2llm.analysis.side_effects.SideEffectDetector.init, code2llm.analysis.side_effects.SideEffectDetector.analyze_function, code2llm.analysis.side_effects.SideEffectDetector.analyze_all, code2llm.analysis.side_effects.SideEffectDetector.get_purity_score, code2llm.analysis.side_effects.SideEffectDetector._scan_node, code2llm.analysis.side_effects.SideEffectDetector._check_calls, code2llm.analysis.side_effects.SideEffectDetector._check_assignments, code2llm.analysis.side_effects.SideEffectDetector._check_globals, code2llm.analysis.side_effects.SideEffectDetector._check_yield, code2llm.analysis.side_effects.SideEffectDetector._check_delete
Extract call graph from AST.
- Methods: 13
- Key Methods: code2llm.analysis.call_graph.CallGraphExtractor.init, code2llm.analysis.call_graph.CallGraphExtractor.extract, code2llm.analysis.call_graph.CallGraphExtractor._calculate_metrics, code2llm.analysis.call_graph.CallGraphExtractor.visit_Import, code2llm.analysis.call_graph.CallGraphExtractor.visit_ImportFrom, code2llm.analysis.call_graph.CallGraphExtractor.visit_ClassDef, code2llm.analysis.call_graph.CallGraphExtractor.visit_FunctionDef, code2llm.analysis.call_graph.CallGraphExtractor.visit_AsyncFunctionDef, code2llm.analysis.call_graph.CallGraphExtractor.visit_Call, code2llm.analysis.call_graph.CallGraphExtractor._qualified_name
- Inherits: ast.NodeVisitor
Key functions that process and transform data:
Validate session and return user ID.
- Output to: self.sessions.get
Process API request.
- Output to: self._check_rate_limit, self._get_stats, self._get_user_info, self._health_check
Format API response.
- Output to: json.dumps
Validate input data.
- Output to: isinstance, isinstance
Format output data.
- Output to: isinstance, json.dumps, isinstance, json.dumps, str
Transform data fields.
- Output to: item.copy, transformations.items, transformed.append, None.upper, None.lower
Validate toon format structure.
- Output to: print, print, bool, bool, bool
Extract metrics from evolution.toon content.
- Output to: toon_content.splitlines, re.search, line.strip, line.startswith, int
Process a user request with complex logic.
- Output to: request.action.startswith, examples.streaming-analyzer.sample_project.utils.validate_input, print, self.auth.authenticate, print
Oceń pojedynczy format względem ground truth.
- Output to: FormatScore, benchmarks.format_evaluator._detect_problems, sum, benchmarks.format_evaluator._detect_pipelines, sum
Extract metrics from evolution.toon content.
- Output to: toon_content.splitlines, re.search, line.strip, line.startswith, m.group
Parse format quality JSON report.
- Output to: report_path.exists, json.loads, data.get, report_path.read_text
Parse performance JSON report.
- Output to: report_path.exists, json.loads, report_path.read_text
Generate badges from format quality scores.
- Output to: enumerate, badges.append, sorted, badges.append, format_scores.items
Parse version string into tuple of (major, minor, patch)
- Output to: version_str.split, tuple, int
Format version tuple as string
Create CLI argument parser.
- Output to: argparse.ArgumentParser, parser.add_argument, parser.add_argument, parser.add_argument, parser.add_argument
Validate source path and setup output directory.
- Output to: Path, Path, output_dir.mkdir, print, print
Validate generated chunked output.
Checks:
- All chunks have required files (analysis.toon, contex
- Output to: print, print, sorted, print, print
- Output to: result.functions.items, patterns.items, sorted, func.name.lower, indicators.items
Generate all format outputs and evaluate them.
- Output to: format_configs.items, import, getattr, exporter_cls, time.time
Remove cached AST and source for filepath (e.g. after file write).
- Output to: self._trees.pop, self._sources.pop
Remove cached state for a file (e.g. after deletion).
- Output to: self._normalize_key
Load gitignore parser for project if available (cached per path).
- Output to: lru_cache, code2llm.core.gitignore.load_gitignore_patterns
Parse a single gitignore pattern into regex.
- Output to: pattern.startswith, pattern.endswith, pattern.startswith, self._wildcard_to_regex, re.compile
Functions exposed as public API (no underscore prefix):
validate_toon.main- 45 callscode2llm.generators.llm_task.normalize_llm_task- 43 callscode2llm.generators.llm_flow.render_llm_flow_md- 42 callsbenchmarks.benchmark_performance.main- 41 callsvalidate_toon.analyze_class_differences- 39 callscode2llm.core.analyzer.ProjectAnalyzer.analyze_project- 39 callscode2llm.cli_parser.create_parser- 38 callsbenchmarks.benchmark_evolution.run_benchmark- 34 callscode2llm.cli_commands.validate_chunked_output- 34 callscode2llm.core.lang.php.analyze_php- 33 callscode2llm.core.lang.rust.analyze_rust- 31 callsbenchmarks.benchmark_optimizations.benchmark_cold_vs_warm- 30 callsbenchmarks.benchmark_performance.create_test_project- 29 callscode2llm.nlp.pipeline.NLPPipeline.process- 29 callsvalidate_toon.compare_modules- 26 callscode2llm.core.streaming_analyzer.StreamingAnalyzer.analyze_streaming- 26 callscode2llm.exporters.mermaid_exporter.MermaidExporter.export_compact- 26 callscode2llm.exporters.toon.ToonExporter.export- 26 callsbenchmarks.benchmark_evolution.parse_evolution_metrics- 25 callscode2llm.exporters.mermaid_exporter.MermaidExporter.export_call_graph- 25 callscode2llm.exporters.context_exporter.ContextExporter.export- 25 callsvalidate_toon.compare_functions- 24 callscode2llm.generators.mermaid.generate_single_png- 24 callsscripts.benchmark_badges.main- 23 callscode2llm.exporters.evolution_exporter.EvolutionExporter.export- 23 callscode2llm.exporters.flow_exporter.FlowExporter.export- 23 callsbenchmarks.format_evaluator.evaluate_format- 22 callsbenchmarks.benchmark_format_quality.run_benchmark- 22 callscode2llm.exporters.evolution_exporter.EvolutionExporter.export_to_yaml- 22 callscode2llm.cli_commands.generate_llm_context- 21 callscode2llm.core.analyzer.ProjectAnalyzer.analyze_files- 20 callscode2llm.core.lang.generic.analyze_generic- 20 callsexamples.streaming-analyzer.demo.demo_incremental_analysis- 19 callsvalidate_toon.compare_classes- 19 callsscripts.benchmark_badges.parse_evolution_metrics- 19 callscode2llm.core.streaming.prioritizer.SmartPrioritizer.prioritize_files- 19 callscode2llm.core.streaming.scanner.StreamingScanner.quick_scan_file- 19 callscode2llm.core.lang.ruby.analyze_ruby- 19 callscode2llm.exporters.map_exporter.MapExporter.export_to_yaml- 19 callscode2llm.exporters.yaml_exporter.YAMLExporter.export_grouped- 19 calls
How components interact:
graph TD
- Entry Points: Start analysis from the entry points listed above
- Core Logic: Focus on classes with many methods
- Data Flow: Follow data transformation functions
- Process Flows: Use the flow diagrams for execution paths
- API Surface: Public API functions reveal the interface
Maintain the identified architectural patterns and public API surface when suggesting changes.