code2llm 0.5.156__tar.gz → 0.5.157__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. {code2llm-0.5.156/code2llm.egg-info → code2llm-0.5.157}/PKG-INFO +5 -5
  2. {code2llm-0.5.156 → code2llm-0.5.157}/README.md +4 -4
  3. code2llm-0.5.157/VERSION +1 -0
  4. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/__init__.py +1 -1
  5. code2llm-0.5.157/code2llm/analysis/_data_impl.py +360 -0
  6. code2llm-0.5.157/code2llm/analysis/data_analysis.py +177 -0
  7. code2llm-0.5.157/code2llm/exporters/toon/_render_coupling_helpers.py +152 -0
  8. code2llm-0.5.157/code2llm/exporters/toon/_render_section_helpers.py +186 -0
  9. code2llm-0.5.157/code2llm/exporters/toon/constants.py +9 -0
  10. code2llm-0.5.157/code2llm/exporters/toon/renderer.py +161 -0
  11. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/nlp/__init__.py +1 -1
  12. {code2llm-0.5.156 → code2llm-0.5.157/code2llm.egg-info}/PKG-INFO +5 -5
  13. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm.egg-info/SOURCES.txt +4 -0
  14. {code2llm-0.5.156 → code2llm-0.5.157}/pyproject.toml +1 -1
  15. code2llm-0.5.156/VERSION +0 -1
  16. code2llm-0.5.156/code2llm/analysis/data_analysis.py +0 -565
  17. code2llm-0.5.156/code2llm/exporters/toon/renderer.py +0 -499
  18. {code2llm-0.5.156 → code2llm-0.5.157}/LICENSE +0 -0
  19. {code2llm-0.5.156 → code2llm-0.5.157}/MANIFEST.in +0 -0
  20. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/__main__.py +0 -0
  21. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/__init__.py +0 -0
  22. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/call_graph.py +0 -0
  23. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/cfg.py +0 -0
  24. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/coupling.py +0 -0
  25. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/dfg.py +0 -0
  26. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/pipeline_classifier.py +0 -0
  27. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/pipeline_detector.py +0 -0
  28. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/pipeline_resolver.py +0 -0
  29. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/side_effects.py +0 -0
  30. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/smells.py +0 -0
  31. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/type_inference.py +0 -0
  32. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/utils/__init__.py +0 -0
  33. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/analysis/utils/ast_helpers.py +0 -0
  34. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/api.py +0 -0
  35. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli.py +0 -0
  36. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_analysis.py +0 -0
  37. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_commands.py +0 -0
  38. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_exports/__init__.py +0 -0
  39. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_exports/code2logic.py +0 -0
  40. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_exports/formats.py +0 -0
  41. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_exports/orchestrator.py +0 -0
  42. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_exports/orchestrator_chunked.py +0 -0
  43. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_exports/orchestrator_constants.py +0 -0
  44. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_exports/orchestrator_handlers.py +0 -0
  45. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_exports/prompt.py +0 -0
  46. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/cli_parser.py +0 -0
  47. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/__init__.py +0 -0
  48. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/analyzer.py +0 -0
  49. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/ast_registry.py +0 -0
  50. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/config.py +0 -0
  51. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/export_pipeline.py +0 -0
  52. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/file_analyzer.py +0 -0
  53. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/file_cache.py +0 -0
  54. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/file_filter.py +0 -0
  55. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/gitignore.py +0 -0
  56. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/incremental.py +0 -0
  57. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/__init__.py +0 -0
  58. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/_c_parser.py +0 -0
  59. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/_calls.py +0 -0
  60. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/_complexity.py +0 -0
  61. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/base.py +0 -0
  62. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/cpp.py +0 -0
  63. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/csharp.py +0 -0
  64. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/generic.py +0 -0
  65. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/go_lang.py +0 -0
  66. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/java.py +0 -0
  67. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/php.py +0 -0
  68. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/ruby.py +0 -0
  69. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/rust.py +0 -0
  70. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/ts_extractors.py +0 -0
  71. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/ts_parser.py +0 -0
  72. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/lang/typescript.py +0 -0
  73. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/large_repo.py +0 -0
  74. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/models.py +0 -0
  75. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/persistent_cache.py +0 -0
  76. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/refactoring.py +0 -0
  77. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/repo_files.py +0 -0
  78. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/source_classifier.py +0 -0
  79. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/streaming/__init__.py +0 -0
  80. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/streaming/cache.py +0 -0
  81. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/streaming/incremental.py +0 -0
  82. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/streaming/prioritizer.py +0 -0
  83. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/streaming/scanner.py +0 -0
  84. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/streaming/strategies.py +0 -0
  85. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/streaming_analyzer.py +0 -0
  86. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/core/toon_size_manager.py +0 -0
  87. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/__init__.py +0 -0
  88. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/article_view.py +0 -0
  89. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/base.py +0 -0
  90. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/context_exporter.py +0 -0
  91. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/context_view.py +0 -0
  92. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/dashboard_data.py +0 -0
  93. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/dashboard_renderer.py +0 -0
  94. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/evolution/__init__.py +0 -0
  95. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/evolution/computation.py +0 -0
  96. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/evolution/constants.py +0 -0
  97. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/evolution/exclusion.py +0 -0
  98. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/evolution/render.py +0 -0
  99. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/evolution/yaml_export.py +0 -0
  100. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/evolution_exporter.py +0 -0
  101. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/flow_constants.py +0 -0
  102. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/flow_exporter.py +0 -0
  103. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/flow_renderer.py +0 -0
  104. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/html_dashboard.py +0 -0
  105. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/index_generator/__init__.py +0 -0
  106. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/index_generator/renderer.py +0 -0
  107. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/index_generator/scanner.py +0 -0
  108. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/index_generator.py +0 -0
  109. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/json_exporter.py +0 -0
  110. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/llm_exporter.py +0 -0
  111. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/map/__init__.py +0 -0
  112. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/map/alerts.py +0 -0
  113. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/map/details.py +0 -0
  114. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/map/header.py +0 -0
  115. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/map/module_list.py +0 -0
  116. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/map/utils.py +0 -0
  117. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/map/yaml_export.py +0 -0
  118. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/map_exporter.py +0 -0
  119. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/mermaid/__init__.py +0 -0
  120. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/mermaid/calls.py +0 -0
  121. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/mermaid/classic.py +0 -0
  122. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/mermaid/compact.py +0 -0
  123. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/mermaid/flow_compact.py +0 -0
  124. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/mermaid/flow_detailed.py +0 -0
  125. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/mermaid/flow_full.py +0 -0
  126. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/mermaid/utils.py +0 -0
  127. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/mermaid_exporter.py +0 -0
  128. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/mermaid_flow_helpers.py +0 -0
  129. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/planfile_tickets.py +0 -0
  130. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/project_yaml/__init__.py +0 -0
  131. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/project_yaml/constants.py +0 -0
  132. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/project_yaml/core.py +0 -0
  133. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/project_yaml/evolution.py +0 -0
  134. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/project_yaml/health.py +0 -0
  135. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/project_yaml/hotspots.py +0 -0
  136. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/project_yaml/modules.py +0 -0
  137. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/project_yaml_exporter.py +0 -0
  138. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/readme/__init__.py +0 -0
  139. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/readme/content.py +0 -0
  140. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/readme/files.py +0 -0
  141. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/readme/insights.py +0 -0
  142. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/readme/sections.py +0 -0
  143. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/readme_exporter.py +0 -0
  144. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/report_generators.py +0 -0
  145. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/toon/__init__.py +0 -0
  146. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/toon/helpers.py +0 -0
  147. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/toon/metrics.py +0 -0
  148. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/toon/metrics_core.py +0 -0
  149. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/toon/metrics_duplicates.py +0 -0
  150. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/toon/metrics_health.py +0 -0
  151. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/toon/module_detail.py +0 -0
  152. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/toon.py +0 -0
  153. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/toon_view.py +0 -0
  154. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/validate_project.py +0 -0
  155. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/exporters/yaml_exporter.py +0 -0
  156. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/__init__.py +0 -0
  157. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/_utils.py +0 -0
  158. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/llm_flow/__init__.py +0 -0
  159. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/llm_flow/analysis.py +0 -0
  160. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/llm_flow/cli.py +0 -0
  161. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/llm_flow/generator.py +0 -0
  162. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/llm_flow/nodes.py +0 -0
  163. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/llm_flow/parsing.py +0 -0
  164. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/llm_flow/utils.py +0 -0
  165. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/llm_flow.py +0 -0
  166. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/llm_task.py +0 -0
  167. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/mermaid/__init__.py +0 -0
  168. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/mermaid/fix.py +0 -0
  169. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/mermaid/png.py +0 -0
  170. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/mermaid/validation.py +0 -0
  171. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/generators/mermaid.py +0 -0
  172. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/nlp/config.py +0 -0
  173. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/nlp/entity_resolution.py +0 -0
  174. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/nlp/intent_matching.py +0 -0
  175. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/nlp/normalization.py +0 -0
  176. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/nlp/pipeline.py +0 -0
  177. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/parsers/toon_parser.py +0 -0
  178. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/patterns/__init__.py +0 -0
  179. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/patterns/detector.py +0 -0
  180. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/refactor/__init__.py +0 -0
  181. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm/refactor/prompt_engine.py +0 -0
  182. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm.egg-info/dependency_links.txt +0 -0
  183. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm.egg-info/entry_points.txt +0 -0
  184. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm.egg-info/requires.txt +0 -0
  185. {code2llm-0.5.156 → code2llm-0.5.157}/code2llm.egg-info/top_level.txt +0 -0
  186. {code2llm-0.5.156 → code2llm-0.5.157}/setup.cfg +0 -0
  187. {code2llm-0.5.156 → code2llm-0.5.157}/setup.py +0 -0
  188. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_advanced_analysis.py +0 -0
  189. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_analyzer.py +0 -0
  190. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_cache_invalidation_e2e.py +0 -0
  191. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_calls_toon_export.py +0 -0
  192. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_declarative_collection.py +0 -0
  193. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_deep_analysis.py +0 -0
  194. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_edge_cases.py +0 -0
  195. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_export_cache_flags.py +0 -0
  196. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_file_analyzer_tagging.py +0 -0
  197. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_flow_exporter.py +0 -0
  198. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_format_quality.py +0 -0
  199. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_multilanguage_e2e.py +0 -0
  200. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_nlp_pipeline.py +0 -0
  201. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_nonpython_cc_calls.py +0 -0
  202. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_orchestrator_cache_mtime.py +0 -0
  203. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_persistent_cache.py +0 -0
  204. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_pipeline_detector.py +0 -0
  205. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_planfile_tickets_exporter.py +0 -0
  206. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_project_toon_export.py +0 -0
  207. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_prompt_engine.py +0 -0
  208. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_prompt_txt.py +0 -0
  209. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_refactoring_engine.py +0 -0
  210. {code2llm-0.5.156 → code2llm-0.5.157}/tests/test_toon_v2.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code2llm
3
- Version: 0.5.156
3
+ Version: 0.5.157
4
4
  Summary: High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
5
5
  Home-page: https://github.com/wronai/stts
6
6
  Author: STTS Project
@@ -66,11 +66,11 @@ Dynamic: requires-python
66
66
 
67
67
  ## AI Cost Tracking
68
68
 
69
- ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.5.156-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
70
- ![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-79.7h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
69
+ ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.5.157-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
70
+ ![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-80.7h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
71
71
 
72
- - 🤖 **LLM usage:** $7.5000 (211 commits)
73
- - 👤 **Human dev:** ~$7972 (79.7h @ $100/h, 30min dedup)
72
+ - 🤖 **LLM usage:** $7.5000 (212 commits)
73
+ - 👤 **Human dev:** ~$8072 (80.7h @ $100/h, 30min dedup)
74
74
 
75
75
  Generated on 2026-05-25 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
76
76
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  ## AI Cost Tracking
4
4
 
5
- ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.5.156-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
6
- ![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-79.7h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
5
+ ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.5.157-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
6
+ ![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-80.7h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
7
7
 
8
- - 🤖 **LLM usage:** $7.5000 (211 commits)
9
- - 👤 **Human dev:** ~$7972 (79.7h @ $100/h, 30min dedup)
8
+ - 🤖 **LLM usage:** $7.5000 (212 commits)
9
+ - 👤 **Human dev:** ~$8072 (80.7h @ $100/h, 30min dedup)
10
10
 
11
11
  Generated on 2026-05-25 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
12
12
 
@@ -0,0 +1 @@
1
+ 0.5.157
@@ -8,7 +8,7 @@ Includes NLP Processing Pipeline for query normalization, intent matching,
8
8
  and entity resolution with multilingual support.
9
9
  """
10
10
 
11
- __version__ = "0.5.156"
11
+ __version__ = "0.5.157"
12
12
  __author__ = "STTS Project"
13
13
 
14
14
  # Core analysis components (lightweight, always needed)
@@ -0,0 +1,360 @@
1
+ """Private implementation helpers for DataAnalyzer.
2
+
3
+ Extracted to keep data_analysis.py under the MI hard-gate threshold.
4
+ All functions here are module-private (leading underscore) and called
5
+ exclusively from DataAnalyzer in data_analysis.py.
6
+ """
7
+
8
+ from typing import Any, Dict, List
9
+ from code2llm.core.models import AnalysisResult
10
+
11
+
12
+ # ---------------------------------------------------------------------------
13
+ # Flow finders
14
+ # ---------------------------------------------------------------------------
15
+
16
+
17
+ def _find_data_pipelines(result: AnalysisResult, categorize_fn, make_stage_fn, max_pipelines: int) -> list:
18
+ """Find data transformation pipelines in the codebase."""
19
+ input_funcs, transform_funcs, output_funcs = categorize_fn(result)
20
+
21
+ pipelines: list = []
22
+ for in_name, in_func in input_funcs[:20]:
23
+ for t_name, t_func in transform_funcs[:30]:
24
+ if t_name not in in_func.calls:
25
+ continue
26
+ for out_name, out_func in output_funcs[:20]:
27
+ if out_name not in t_func.calls:
28
+ continue
29
+ pipelines.append(
30
+ {
31
+ "pipeline_id": f"pipeline_{len(pipelines) + 1}",
32
+ "stages": [
33
+ make_stage_fn("input", in_name, in_func),
34
+ make_stage_fn("transform", t_name, t_func),
35
+ make_stage_fn("output", out_name, out_func),
36
+ ],
37
+ "data_flow": f"{in_name} → {t_name} → {out_name}",
38
+ }
39
+ )
40
+ if len(pipelines) >= max_pipelines:
41
+ return pipelines
42
+ return pipelines
43
+
44
+
45
+ def _find_state_patterns(result: AnalysisResult) -> list:
46
+ """Find state management patterns."""
47
+ patterns: list = []
48
+ state_indicators = ["state", "status", "mode", "phase", "lifecycle", "session", "context"]
49
+ transition_indicators = ["transition", "change", "update", "set_state", "switch"]
50
+
51
+ for func_name, func in result.functions.items():
52
+ name_lower = func.name.lower()
53
+ if any(ind in name_lower for ind in state_indicators + transition_indicators):
54
+ affected_states = []
55
+ for call in list(func.calls)[:10]:
56
+ call_func = result.functions.get(call)
57
+ if call_func and any(ind in call_func.name.lower() for ind in state_indicators):
58
+ affected_states.append(call)
59
+ patterns.append(
60
+ {
61
+ "function": func_name,
62
+ "type": "state_manager"
63
+ if "set" in name_lower or "update" in name_lower
64
+ else "state_reader",
65
+ "affects_states": affected_states[:5],
66
+ "description": func.docstring[:150] if func.docstring else "N/A",
67
+ }
68
+ )
69
+ if len(patterns) >= 20:
70
+ break
71
+ return patterns
72
+
73
+
74
+ def _find_data_dependencies(result: AnalysisResult) -> list:
75
+ """Find cross-module data dependencies."""
76
+ module_data_flow: Dict[Any, Any] = {}
77
+ for func_name, func in result.functions.items():
78
+ func_module = func_name.rsplit(".", 1)[0] if "." in func_name else "root"
79
+ for called in list(func.calls)[:15]:
80
+ called_module = called.rsplit(".", 1)[0] if "." in called else "root"
81
+ if func_module != called_module and called in result.functions:
82
+ key = (func_module, called_module)
83
+ if key not in module_data_flow:
84
+ module_data_flow[key] = {
85
+ "from_module": func_module,
86
+ "to_module": called_module,
87
+ "data_functions": [],
88
+ "call_count": 0,
89
+ }
90
+ module_data_flow[key]["data_functions"].append({"caller": func_name, "callee": called})
91
+ module_data_flow[key]["call_count"] += 1
92
+ deps = sorted(module_data_flow.values(), key=lambda x: x["call_count"], reverse=True)
93
+ for dep in deps:
94
+ dep["data_functions"] = dep["data_functions"][:10]
95
+ return deps[:15]
96
+
97
+
98
+ def _find_event_flows(result: AnalysisResult) -> list:
99
+ """Find event-driven patterns."""
100
+ flows: list = []
101
+ event_indicators = ["event", "emit", "trigger", "notify", "callback", "handler", "listen", "subscribe"]
102
+ hook_indicators = ["hook", "on_", "before_", "after_", "pre_", "post_"]
103
+ for func_name, func in result.functions.items():
104
+ name_lower = func.name.lower()
105
+ if any(ind in name_lower for ind in event_indicators) or any(
106
+ name_lower.startswith(ind) for ind in hook_indicators
107
+ ):
108
+ handlers = []
109
+ for called in list(func.calls)[:10]:
110
+ called_func = result.functions.get(called)
111
+ if called_func and any(
112
+ ind in called_func.name.lower() for ind in event_indicators + ["handle", "process"]
113
+ ):
114
+ handlers.append(called)
115
+ flows.append(
116
+ {
117
+ "event_source": func_name,
118
+ "type": "emitter" if "emit" in name_lower or "trigger" in name_lower else "handler",
119
+ "handlers": handlers[:5],
120
+ "description": func.docstring[:150] if func.docstring else "N/A",
121
+ }
122
+ )
123
+ if len(flows) >= 20:
124
+ break
125
+ return flows
126
+
127
+
128
+ # ---------------------------------------------------------------------------
129
+ # Type analysis helpers
130
+ # ---------------------------------------------------------------------------
131
+
132
+
133
+ def _detect_types_from_name(func_name: str, doc: str) -> list:
134
+ """Detect data types from function name and docstring."""
135
+ type_indicators = {
136
+ "list": ["list", "array", "items", "elements", "collection", "sequence"],
137
+ "dict": ["dict", "map", "mapping", "key_value", "record", "object"],
138
+ "str": ["string", "text", "content", "message"],
139
+ "int": ["int", "count", "index", "number", "id"],
140
+ "float": ["float", "decimal", "score", "probability"],
141
+ "bool": ["bool", "flag", "is_", "has_"],
142
+ "tuple": ["tuple", "pair"],
143
+ "set": ["set", "unique"],
144
+ }
145
+ name_lower = func_name.lower()
146
+ return [t for t, inds in type_indicators.items() if any(ind in name_lower or ind in doc for ind in inds)]
147
+
148
+
149
+ def _create_type_entry(type_key: str, detected: list, params: list, returns: list) -> dict:
150
+ """Create a new data type entry."""
151
+ return {
152
+ "type_name": type_key,
153
+ "detected_types": list(set(detected)),
154
+ "parameter_types": list(set(params)),
155
+ "return_types": list(set(returns)),
156
+ "functions": [],
157
+ "usage_count": 0,
158
+ "cross_module_usage": 0,
159
+ }
160
+
161
+
162
+ def _update_type_stats(entry: dict, func_name: str, func_module: str, calls: list) -> None:
163
+ """Update type entry with function info and check cross-module usage."""
164
+ entry["functions"].append(func_name)
165
+ entry["usage_count"] += 1
166
+ for called in list(calls)[:10]:
167
+ called_module = called.rsplit(".", 1)[0] if "." in called else "root"
168
+ if called_module != func_module:
169
+ entry["cross_module_usage"] += 1
170
+ break
171
+
172
+
173
+ def _infer_parameter_types(func) -> list:
174
+ """Infer parameter types from function name patterns."""
175
+ params: List[str] = []
176
+ name = func.name.lower()
177
+ if "list" in name or "items" in name:
178
+ params.append("list")
179
+ if "dict" in name or "map" in name:
180
+ params.append("dict")
181
+ if "text" in name or "string" in name:
182
+ params.append("str")
183
+ if "count" in name or "index" in name:
184
+ params.append("int")
185
+ return params
186
+
187
+
188
+ def _infer_return_types(func) -> list:
189
+ """Infer return types from function name patterns."""
190
+ returns: List[str] = []
191
+ name = func.name.lower()
192
+ if name.startswith(("get_", "find_")):
193
+ returns.append("dict")
194
+ if name.startswith(("is_", "has_")):
195
+ returns.append("bool")
196
+ if name.startswith(("count_", "len_")):
197
+ returns.append("int")
198
+ if name.startswith(("list_", "get_all_")):
199
+ returns.append("list")
200
+ return returns
201
+
202
+
203
+ def _analyze_data_types(result: AnalysisResult) -> list:
204
+ """Analyze data types and usage across all functions."""
205
+ data_types: Dict[str, Any] = {}
206
+ for func_name, func in result.functions.items():
207
+ doc = func.docstring.lower() if func.docstring else ""
208
+ detected = _detect_types_from_name(func.name, doc)
209
+ params = _infer_parameter_types(func)
210
+ returns = _infer_return_types(func)
211
+ if detected or params or returns:
212
+ type_key = ",".join(sorted(set(detected + params + returns)))
213
+ if type_key not in data_types:
214
+ data_types[type_key] = _create_type_entry(type_key, detected, params, returns)
215
+ func_module = func_name.rsplit(".", 1)[0] if "." in func_name else "root"
216
+ _update_type_stats(data_types[type_key], func_name, func_module, func.calls)
217
+ return sorted(data_types.values(), key=lambda x: x["usage_count"], reverse=True)
218
+
219
+
220
+ # ---------------------------------------------------------------------------
221
+ # Graph and process analysis helpers
222
+ # ---------------------------------------------------------------------------
223
+
224
+
225
+ def _get_function_data_types(func) -> list:
226
+ """Derive data type labels for a function from its name and docstring."""
227
+ types: List[str] = []
228
+ name = func.name.lower()
229
+ if "list" in name or "items" in name:
230
+ types.append("list")
231
+ if "dict" in name or "map" in name:
232
+ types.append("dict")
233
+ if "text" in name or "string" in name:
234
+ types.append("str")
235
+ if "count" in name or "index" in name:
236
+ types.append("int")
237
+ if func.docstring:
238
+ doc = func.docstring.lower()
239
+ if "list" in doc:
240
+ types.append("list")
241
+ if "dict" in doc:
242
+ types.append("dict")
243
+ if "string" in doc or "text" in doc:
244
+ types.append("str")
245
+ return list(set(types))
246
+
247
+
248
+ def _build_data_flow_graph(result: AnalysisResult) -> dict:
249
+ """Build data flow graph from function relationships."""
250
+ nodes: Dict[str, Any] = {}
251
+ edges: list = []
252
+ for func_name, func in result.functions.items():
253
+ nodes[func_name] = {
254
+ "id": func_name,
255
+ "name": func.name.split(".")[-1],
256
+ "module": func_name.rsplit(".", 1)[0] if "." in func_name else "root",
257
+ "data_types": _get_function_data_types(func),
258
+ "in_degree": len(func.called_by),
259
+ "out_degree": len(func.calls),
260
+ "is_hub": len(func.calls) > 5 or len(func.called_by) > 5,
261
+ }
262
+ for func_name, func in result.functions.items():
263
+ for called in list(func.calls)[:15]:
264
+ if called in result.functions:
265
+ edges.append({"from": func_name, "to": called, "data_flow": True, "weight": 1})
266
+ return {
267
+ "nodes": nodes,
268
+ "edges": edges,
269
+ "stats": {
270
+ "total_nodes": len(nodes),
271
+ "total_edges": len(edges),
272
+ "hub_nodes": sum(1 for n in nodes.values() if n["is_hub"]),
273
+ },
274
+ }
275
+
276
+
277
+ def _identify_process_patterns(result: AnalysisResult) -> list:
278
+ """Identify common data processing patterns (filter, map, reduce, etc.)."""
279
+ patterns: Dict[str, list] = {
280
+ "filter": [], "map": [], "reduce": [], "aggregate": [], "transform": [], "validate": [],
281
+ }
282
+ indicators = {
283
+ "filter": ["filter", "select", "where", "find"],
284
+ "map": ["map", "transform", "process"],
285
+ "reduce": ["reduce", "sum", "count", "aggregate"],
286
+ "aggregate": ["group", "bucket", "cluster"],
287
+ "transform": ["transform", "convert", "normalize"],
288
+ "validate": ["validate", "check", "verify"],
289
+ }
290
+ for func_name, func in result.functions.items():
291
+ name = func.name.lower()
292
+ doc = func.docstring.lower() if func.docstring else ""
293
+ for p_type, inds in indicators.items():
294
+ if any(ind in name or ind in doc for ind in inds):
295
+ patterns[p_type].append(
296
+ {
297
+ "function": func_name,
298
+ "description": func.docstring[:100] if func.docstring else "N/A",
299
+ "data_flow": f"{len(func.called_by)} → {func_name} → {len(func.calls)}",
300
+ }
301
+ )
302
+ break
303
+ res = []
304
+ for p_type, funcs in patterns.items():
305
+ res.append({"pattern_type": p_type, "functions": funcs[:10], "count": len(funcs)})
306
+ return sorted(res, key=lambda x: x["count"], reverse=True)
307
+
308
+
309
+ def _analyze_optimization_opportunities(
310
+ result: AnalysisResult, data_types: list, dfg: dict
311
+ ) -> dict:
312
+ """Analyze optimization opportunities in data handling."""
313
+ opt: Dict[str, Any] = {
314
+ "potential_score": 0.0,
315
+ "type_consolidation": [],
316
+ "process_consolidation": [],
317
+ "hub_optimization": [],
318
+ "recommendations": [],
319
+ }
320
+ similar: Dict[str, list] = {}
321
+ for dt in data_types:
322
+ sig = ",".join(sorted(dt["detected_types"]))
323
+ if sig not in similar:
324
+ similar[sig] = []
325
+ similar[sig].append(dt)
326
+ for _sig, sims in similar.items():
327
+ if len(sims) > 1:
328
+ usage = sum(s["usage_count"] for s in sims)
329
+ if usage > 10:
330
+ opt["type_consolidation"].append(
331
+ {
332
+ "type_signature": _sig,
333
+ "similar_types": [s["type_name"] for s in sims],
334
+ "total_usage": usage,
335
+ "potential_reduction": len(sims) - 1,
336
+ }
337
+ )
338
+ for p in _identify_process_patterns(result):
339
+ if p["count"] > 5:
340
+ opt["process_consolidation"].append(
341
+ {
342
+ "pattern_type": p["pattern_type"],
343
+ "function_count": p["count"],
344
+ "potential_reduction": p["count"] // 3,
345
+ }
346
+ )
347
+ for hub in [n for n in dfg["nodes"].values() if n["is_hub"]][:10]:
348
+ opt["hub_optimization"].append(
349
+ {
350
+ "function": hub["id"],
351
+ "connections": hub["in_degree"] + hub["out_degree"],
352
+ "optimization_type": "split" if hub["out_degree"] > 10 else "cache",
353
+ }
354
+ )
355
+ opt["potential_score"] = (
356
+ len(opt["type_consolidation"]) * 10
357
+ + len(opt["process_consolidation"]) * 15
358
+ + len(opt["hub_optimization"]) * 5
359
+ ) / 100.0
360
+ return opt
@@ -0,0 +1,177 @@
1
+ """Data Analysis logic for code2llm - split into focused analyzers.
2
+
3
+ This module provides three analyzers:
4
+ - DataFlowAnalyzer: data pipelines, state patterns, dependencies, event flows
5
+ - OptimizationAdvisor: data types, optimization opportunities, process patterns
6
+ - DataAnalyzer: facade combining both analyzers (backward compatibility)
7
+
8
+ Heavy implementation details live in _data_impl to keep this file's MI above
9
+ the regix hard-gate threshold.
10
+ """
11
+
12
+ from typing import Any, Dict, Tuple
13
+ from code2llm.core.models import AnalysisResult
14
+ from code2llm.analysis._data_impl import (
15
+ _find_data_pipelines,
16
+ _find_state_patterns,
17
+ _find_data_dependencies,
18
+ _find_event_flows,
19
+ _analyze_data_types,
20
+ _build_data_flow_graph,
21
+ _identify_process_patterns,
22
+ _analyze_optimization_opportunities,
23
+ )
24
+
25
+
26
+ _INPUT_INDICATORS = [
27
+ "parse",
28
+ "load",
29
+ "read",
30
+ "fetch",
31
+ "get",
32
+ "input",
33
+ "receive",
34
+ "extract",
35
+ ]
36
+ _TRANSFORM_INDICATORS = [
37
+ "transform",
38
+ "convert",
39
+ "process",
40
+ "validate",
41
+ "filter",
42
+ "map",
43
+ "reduce",
44
+ "compute",
45
+ ]
46
+ _OUTPUT_INDICATORS = [
47
+ "serialize",
48
+ "format",
49
+ "write",
50
+ "save",
51
+ "send",
52
+ "output",
53
+ "render",
54
+ "encode",
55
+ ]
56
+ _MAX_PIPELINES = 15
57
+
58
+
59
+ def _categorize_functions(result: "AnalysisResult") -> Tuple[list, list, list]:
60
+ """Categorize functions into input/transform/output based on name patterns."""
61
+ input_funcs, transform_funcs, output_funcs = [], [], []
62
+ for func_name, func in result.functions.items():
63
+ name_lower = func.name.lower()
64
+ if any(ind in name_lower for ind in _INPUT_INDICATORS):
65
+ input_funcs.append((func_name, func))
66
+ elif any(ind in name_lower for ind in _TRANSFORM_INDICATORS):
67
+ transform_funcs.append((func_name, func))
68
+ elif any(ind in name_lower for ind in _OUTPUT_INDICATORS):
69
+ output_funcs.append((func_name, func))
70
+ return input_funcs, transform_funcs, output_funcs
71
+
72
+
73
+ def _make_stage(label: str, func_name: str, func) -> Dict[str, str]:
74
+ """Build a single pipeline stage dict."""
75
+ return {
76
+ "stage": label,
77
+ "function": func_name,
78
+ "description": func.docstring[:100] if func.docstring else "N/A",
79
+ }
80
+
81
+
82
+ class DataAnalyzer:
83
+ """Analyze data flows, structures, and optimization opportunities."""
84
+
85
+ def analyze_data_flow(self, result: AnalysisResult) -> Dict[str, Any]:
86
+ """Perform detailed data flow analysis."""
87
+ return {
88
+ "data_pipelines": _find_data_pipelines(result, _categorize_functions, _make_stage, _MAX_PIPELINES),
89
+ "state_patterns": _find_state_patterns(result),
90
+ "data_dependencies": _find_data_dependencies(result),
91
+ "event_flows": _find_event_flows(result),
92
+ }
93
+
94
+ def analyze_data_structures(self, result: AnalysisResult) -> Dict[str, Any]:
95
+ """Analyze data structures and optimization opportunities."""
96
+ data_types = _analyze_data_types(result)
97
+ data_flow_graph = _build_data_flow_graph(result)
98
+ process_patterns = _identify_process_patterns(result)
99
+ optimization_analysis = _analyze_optimization_opportunities(
100
+ result, data_types, data_flow_graph
101
+ )
102
+ return {
103
+ "data_types": data_types,
104
+ "data_flow_graph": data_flow_graph,
105
+ "process_patterns": process_patterns,
106
+ "optimization_analysis": optimization_analysis,
107
+ }
108
+
109
+
110
+
111
+ # ---------------------------------------------------------------------------
112
+ # Focused analyzer classes
113
+ # ---------------------------------------------------------------------------
114
+
115
+
116
+ class DataFlowAnalyzer:
117
+ """Analyze data flows: pipelines, state patterns, dependencies, and event flows."""
118
+
119
+ def analyze(self, result: AnalysisResult) -> Dict[str, Any]:
120
+ """Perform complete data flow analysis."""
121
+ return {
122
+ "data_pipelines": self.find_data_pipelines(result),
123
+ "state_patterns": self.find_state_patterns(result),
124
+ "data_dependencies": self.find_data_dependencies(result),
125
+ "event_flows": self.find_event_flows(result),
126
+ }
127
+
128
+ def find_data_pipelines(self, result: AnalysisResult) -> list:
129
+ """Find data transformation pipelines."""
130
+ return _find_data_pipelines(result, _categorize_functions, _make_stage, _MAX_PIPELINES)
131
+
132
+ def find_state_patterns(self, result: AnalysisResult) -> list:
133
+ """Find state management patterns."""
134
+ return _find_state_patterns(result)
135
+
136
+ def find_data_dependencies(self, result: AnalysisResult) -> list:
137
+ """Find cross-module data dependencies."""
138
+ return _find_data_dependencies(result)
139
+
140
+ def find_event_flows(self, result: AnalysisResult) -> list:
141
+ """Find event-driven patterns."""
142
+ return _find_event_flows(result)
143
+
144
+
145
+ class OptimizationAdvisor:
146
+ """Analyze optimization opportunities: data types and process patterns."""
147
+
148
+ def analyze(self, result: AnalysisResult) -> Dict[str, Any]:
149
+ """Perform complete optimization analysis."""
150
+ data_types = _analyze_data_types(result)
151
+ data_flow_graph = _build_data_flow_graph(result)
152
+ process_patterns = _identify_process_patterns(result)
153
+ optimization_analysis = _analyze_optimization_opportunities(result, data_types, data_flow_graph)
154
+ return {
155
+ "data_types": data_types,
156
+ "data_flow_graph": data_flow_graph,
157
+ "process_patterns": process_patterns,
158
+ "optimization_analysis": optimization_analysis,
159
+ }
160
+
161
+ def analyze_data_types(self, result: AnalysisResult) -> list:
162
+ """Analyze data types and usage."""
163
+ return _analyze_data_types(result)
164
+
165
+ def build_data_flow_graph(self, result: AnalysisResult) -> dict:
166
+ """Build data flow graph from function relationships."""
167
+ return _build_data_flow_graph(result)
168
+
169
+ def identify_process_patterns(self, result: AnalysisResult) -> list:
170
+ """Identify common data processing patterns."""
171
+ return _identify_process_patterns(result)
172
+
173
+ def analyze_optimization_opportunities(
174
+ self, result: AnalysisResult, data_types: list, dfg: dict
175
+ ) -> dict:
176
+ """Analyze optimization opportunities in data handling."""
177
+ return _analyze_optimization_opportunities(result, data_types, dfg)