tree-sitter-analyzer 1.8.4__tar.gz → 1.9.0__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.
Potentially problematic release.
This version of tree-sitter-analyzer might be problematic. Click here for more details.
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/CHANGELOG.md +20 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/PKG-INFO +1 -1
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/collect_project_metrics.py +80 -60
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/debug_async_test.py +23 -19
- tree_sitter_analyzer-1.9.0/docs/analysis/technical_debt_analysis_2025-10-16.md +111 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/cache_demo.py +2 -2
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/css_analysis_demo.py +219 -154
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/file_output_demo.py +61 -48
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/file_output_factory_demo.py +80 -56
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/html_analysis_demo.py +90 -81
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/javascript_analysis_demo.py +1 -1
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/suppress_output_demo.py +57 -52
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/pyproject.toml +2 -2
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/run_regression_tests.py +139 -93
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/scripts/gitflow_release_automation.py +1 -1
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/scripts/run_phase7_integration_tests.py +109 -97
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/scripts/sync_version.py +6 -2
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/scripts/update_readme_stats.py +95 -98
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/test_emergency_fix.py +33 -23
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/test_fixes.py +56 -39
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/__init__.py +1 -1
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/api.py +4 -4
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/argument_validator.py +29 -17
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/advanced_command.py +7 -5
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/structure_command.py +7 -5
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/summary_command.py +10 -6
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/table_command.py +8 -7
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/info_commands.py +1 -1
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli_main.py +3 -2
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/core/analysis_engine.py +5 -5
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/core/cache_service.py +3 -1
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/core/query.py +17 -5
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/core/query_service.py +1 -1
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/encoding_utils.py +3 -3
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/exceptions.py +61 -50
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/file_handler.py +3 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/base_formatter.py +10 -5
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/formatter_registry.py +83 -68
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/html_formatter.py +90 -54
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/javascript_formatter.py +21 -16
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/language_formatter_factory.py +7 -6
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/markdown_formatter.py +247 -124
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/python_formatter.py +61 -38
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/typescript_formatter.py +113 -45
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/interfaces/mcp_server.py +2 -2
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/language_detector.py +6 -6
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/language_loader.py +3 -1
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/languages/css_plugin.py +120 -61
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/languages/html_plugin.py +159 -62
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/languages/java_plugin.py +42 -34
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/languages/javascript_plugin.py +59 -30
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/languages/markdown_plugin.py +402 -368
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/languages/python_plugin.py +111 -64
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/languages/typescript_plugin.py +241 -132
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/server.py +22 -18
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py +13 -8
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/base_tool.py +2 -2
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/fd_rg_utils.py +232 -26
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/find_and_grep_tool.py +31 -23
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/list_files_tool.py +21 -19
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/query_tool.py +17 -18
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/read_partial_tool.py +30 -31
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/search_content_tool.py +131 -77
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/table_format_tool.py +29 -16
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/utils/file_output_factory.py +64 -51
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/utils/file_output_manager.py +34 -24
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/utils/gitignore_detector.py +8 -4
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/models.py +7 -5
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/plugins/base.py +9 -7
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/plugins/manager.py +1 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/queries/css.py +2 -21
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/queries/html.py +2 -15
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/queries/markdown.py +30 -41
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/queries/python.py +20 -5
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/query_loader.py +5 -5
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/security/validator.py +114 -86
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/utils/__init__.py +58 -28
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/utils/tree_sitter_compat.py +72 -65
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/utils.py +26 -15
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/upload_to_pypi.py +2 -6
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/uv.lock +1 -1
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.gitattributes +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.gitignore +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.kiro/steering/product.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.kiro/steering/structure.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.kiro/steering/tech.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.pre-commit-config.yaml +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.pre-commit-hooks.yaml +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/AGENTS.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/commands/release.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/commands/speckit.analyze.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/commands/speckit.checklist.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/commands/speckit.clarify.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/commands/speckit.constitution.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/commands/speckit.implement.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/commands/speckit.plan.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/commands/speckit.specify.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/commands/speckit.tasks.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/docs/release.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/docs/speckit.analyze.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/docs/speckit.checklist.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/docs/speckit.clarify.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/docs/speckit.constitution.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/docs/speckit.implement.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/docs/speckit.plan.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/docs/speckit.specify.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/docs/speckit.tasks.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.roo/rules/specify-rules.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/checklists/requirements.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/completion-report-template.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/completion-report.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/contracts/query-service-api.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/data-model.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/implementation-guidelines-part2.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/implementation-guidelines.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/plan.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/progress-management-final.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/progress-management.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/project-overview.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/quickstart.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/research.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/spec.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/async-query-service-fix/tasks.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/memory/constitution.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/scripts/powershell/check-prerequisites.ps1 +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/scripts/powershell/common.ps1 +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/scripts/powershell/create-new-feature.ps1 +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/scripts/powershell/setup-plan.ps1 +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/scripts/powershell/update-agent-context.ps1 +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/templates/agent-file-template.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/templates/checklist-template.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/templates/plan-template.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/templates/spec-template.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/.specify/templates/tasks-template.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/ASYNC_ARCHITECTURE_DESIGN.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/CLI_ARCHITECTURE_REDESIGN.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/CLI_COMMAND_BUG_FIX_SPECIFICATION.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/GITFLOW.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/GITFLOW_ja.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/GITFLOW_zh.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/IMPLEMENTATION_GUIDELINES.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/README.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/README_ja.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/README_zh.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/build_standalone.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/check_quality.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/coverage.json +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/CONTRIBUTING.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/analysis/README.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/analysis/project_metrics_2025-10-16.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/analysis/speckit_analysis_2025-10-16.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/api/data_models.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/api/formatter_registry.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/api/mcp_tools_specification.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/debugging_guide.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/developer_guide.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/file_output_manager_factory_implementation.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/test_fixes/suppress_output_mock_fix_2025-10-16.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/docs/troubleshooting_guide.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/BigService.java +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/BigService.json +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/BigService.summary.json +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/ComprehensiveTypeScript.ts +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/JavaDocTest.java +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/ModernJavaScript.js +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/MultiClass.java +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/ReactComponent.jsx +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/ReactTypeScriptComponent.tsx +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/Sample.java +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/TypeScriptDeclarations.d.ts +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/calculate_token_comparison.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/comprehensive_sample.css +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/comprehensive_sample.html +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/project_root_demo.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/sample.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/security_demo.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/security_integration_demo.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/smart_cache_demo.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/test_markdown.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/examples/total_only_optimization_demo.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/llm_code_checker.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/project_scale_evaluation_report.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/pypirc_example.txt +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/pytest.ini +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/scripts/README.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/scripts/gitflow_helper.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/scripts/sync_version_minimal.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/DEPLOYMENT_GUIDE.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/DOCUMENTATION_INDEX.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/ERROR_HANDLING_SPECIFICATION.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/GLOSSARY.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/PERFORMANCE_BENCHMARKS.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/README.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/checklists/requirements.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/contracts/mcp-resources-api.json +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/contracts/mcp-tools-api.json +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/data-model.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/implementation_status.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/plan.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/quickstart.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/research.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/resources/mcp_resources_specification.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/spec.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/tasks.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/test_environment_status.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/tools/analyze_code_structure_specification.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/tools/check_code_scale_specification.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/tools/extract_code_section_specification.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/tools/find_and_grep_specification.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/tools/list_files_specification.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/tools/query_code_specification.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/tools/search_content_specification.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/001-mcp-tree-sitter/tools/set_project_path_specification.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/002-language-abstraction-spec.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/003-html-css-support-spec.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/004-formatter-extension-spec.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/specs/005-implementation-plan.md +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/start_mcp_server.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/test_output.txt +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/__main__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/__main__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/base_command.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/default_command.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/find_and_grep_cli.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/list_files_cli.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/partial_read_command.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/query_command.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/cli/commands/search_content_cli.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/constants.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/core/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/core/engine.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/core/parser.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/core/query_filter.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/formatter_factory.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/formatters/java_formatter.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/interfaces/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/interfaces/cli.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/interfaces/cli_adapter.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/interfaces/mcp_adapter.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/languages/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/resources/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/resources/code_file_resource.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/resources/project_stats_resource.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/utils/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/utils/error_handler.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/utils/path_resolver.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/mcp/utils/search_cache.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/output_manager.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/plugins/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/project_detector.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/queries/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/queries/java.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/queries/javascript.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/queries/typescript.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/security/__init__.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/security/boundary_manager.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/security/regex_checker.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/tree_sitter_analyzer/table_formatter.py +0 -0
- {tree_sitter_analyzer-1.8.4 → tree_sitter_analyzer-1.9.0}/upload_interactive.py +0 -0
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.9.0] - 2025-10-16
|
|
4
|
+
|
|
5
|
+
### 🚀 新機能
|
|
6
|
+
- **並行処理エンジン**: search_content MCPツールで複数ディレクトリの並行検索対応
|
|
7
|
+
- **パフォーマンス向上**: 最大4倍の検索速度向上
|
|
8
|
+
- **型安全性改善**: mypyエラー7%削減(341個→318個)
|
|
9
|
+
|
|
10
|
+
### 🔧 改善
|
|
11
|
+
- コードスタイル統一(ruff違反大幅削減)
|
|
12
|
+
- 技術的負債の包括的解消
|
|
13
|
+
- テスト実行時間83%短縮の維持
|
|
14
|
+
|
|
15
|
+
### 🧪 テスト
|
|
16
|
+
- 並行処理機能の包括的テストスイート追加
|
|
17
|
+
- エラーハンドリングとタイムアウト制御の強化
|
|
18
|
+
|
|
19
|
+
### 📚 ドキュメント
|
|
20
|
+
- 技術的負債分析レポート追加
|
|
21
|
+
- 次期開発計画の策定
|
|
22
|
+
|
|
3
23
|
## [1.8.4] - 2025-10-16
|
|
4
24
|
|
|
5
25
|
### 🚀 Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tree-sitter-analyzer
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.0
|
|
4
4
|
Summary: AI-era enterprise-grade code analysis tool with comprehensive HTML/CSS support, dynamic plugin architecture, and MCP integration
|
|
5
5
|
Project-URL: Homepage, https://github.com/aimasteracc/tree-sitter-analyzer
|
|
6
6
|
Project-URL: Documentation, https://github.com/aimasteracc/tree-sitter-analyzer#readme
|
|
@@ -2,89 +2,101 @@
|
|
|
2
2
|
"""
|
|
3
3
|
tree-sitter-analyzerプロジェクト固有のメトリクス収集スクリプト
|
|
4
4
|
"""
|
|
5
|
-
|
|
6
|
-
import glob
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
import subprocess
|
|
9
|
-
import sys
|
|
5
|
+
|
|
10
6
|
from collections import defaultdict
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
11
9
|
|
|
12
10
|
def is_project_file(filepath):
|
|
13
11
|
"""プロジェクト固有のファイルかどうかを判定"""
|
|
14
12
|
path_str = str(filepath)
|
|
15
13
|
# 除外するディレクトリ
|
|
16
|
-
exclude_dirs = [
|
|
17
|
-
|
|
14
|
+
exclude_dirs = [
|
|
15
|
+
".venv",
|
|
16
|
+
"__pycache__",
|
|
17
|
+
".git",
|
|
18
|
+
".pytest_cache",
|
|
19
|
+
"node_modules",
|
|
20
|
+
".ruff_cache",
|
|
21
|
+
]
|
|
22
|
+
|
|
18
23
|
for exclude_dir in exclude_dirs:
|
|
19
24
|
if exclude_dir in path_str:
|
|
20
25
|
return False
|
|
21
26
|
return True
|
|
22
27
|
|
|
28
|
+
|
|
23
29
|
def count_lines_in_file(filepath):
|
|
24
30
|
"""ファイルの行数を数える"""
|
|
25
31
|
try:
|
|
26
|
-
with open(filepath,
|
|
32
|
+
with open(filepath, encoding="utf-8", errors="ignore") as f:
|
|
27
33
|
lines = f.readlines()
|
|
28
34
|
total_lines = len(lines)
|
|
29
|
-
empty_lines = sum(1 for line in lines if line.strip() ==
|
|
30
|
-
comment_lines = sum(1 for line in lines if line.strip().startswith(
|
|
35
|
+
empty_lines = sum(1 for line in lines if line.strip() == "")
|
|
36
|
+
comment_lines = sum(1 for line in lines if line.strip().startswith("#"))
|
|
31
37
|
code_lines = total_lines - empty_lines - comment_lines
|
|
32
38
|
return {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
"total": total_lines,
|
|
40
|
+
"empty": empty_lines,
|
|
41
|
+
"comment": comment_lines,
|
|
42
|
+
"code": code_lines,
|
|
37
43
|
}
|
|
38
44
|
except Exception as e:
|
|
39
45
|
print(f"Error reading {filepath}: {e}")
|
|
40
|
-
return {
|
|
46
|
+
return {"total": 0, "empty": 0, "comment": 0, "code": 0}
|
|
47
|
+
|
|
41
48
|
|
|
42
49
|
def collect_file_metrics():
|
|
43
50
|
"""ファイルメトリクスを収集"""
|
|
44
51
|
print("=== プロジェクトファイル統計 ===")
|
|
45
|
-
|
|
52
|
+
|
|
46
53
|
# プロジェクト固有のPythonファイルの統計
|
|
47
|
-
all_py_files = list(Path(
|
|
54
|
+
all_py_files = list(Path(".").rglob("*.py"))
|
|
48
55
|
py_files = [f for f in all_py_files if is_project_file(f)]
|
|
49
|
-
test_files = [
|
|
50
|
-
|
|
56
|
+
test_files = [
|
|
57
|
+
f
|
|
58
|
+
for f in py_files
|
|
59
|
+
if "test_" in f.name or f.name.startswith("test_") or "tests/" in str(f)
|
|
60
|
+
]
|
|
61
|
+
|
|
51
62
|
print(f"プロジェクト内Pythonファイル数: {len(py_files)}")
|
|
52
63
|
print(f"テストファイル数: {len(test_files)}")
|
|
53
64
|
print(f"プロダクションファイル数: {len(py_files) - len(test_files)}")
|
|
54
|
-
|
|
65
|
+
|
|
55
66
|
# 言語別ファイル数(プロジェクト固有のみ)
|
|
56
67
|
extensions = defaultdict(int)
|
|
57
|
-
for file_path in Path(
|
|
68
|
+
for file_path in Path(".").rglob("*"):
|
|
58
69
|
if file_path.is_file() and is_project_file(file_path):
|
|
59
70
|
ext = file_path.suffix.lower()
|
|
60
71
|
if ext:
|
|
61
72
|
extensions[ext] += 1
|
|
62
|
-
|
|
73
|
+
|
|
63
74
|
print("\n=== 言語別ファイル数(プロジェクト固有)===")
|
|
64
75
|
for ext, count in sorted(extensions.items(), key=lambda x: x[1], reverse=True):
|
|
65
76
|
if count > 1: # 2個以上のファイルがある拡張子のみ表示
|
|
66
77
|
print(f"{ext}: {count}")
|
|
67
|
-
|
|
78
|
+
|
|
68
79
|
return py_files, test_files
|
|
69
80
|
|
|
81
|
+
|
|
70
82
|
def collect_line_metrics(py_files, test_files):
|
|
71
83
|
"""行数メトリクスを収集"""
|
|
72
84
|
print("\n=== 行数統計(プロジェクト固有)===")
|
|
73
|
-
|
|
74
|
-
total_metrics = {
|
|
75
|
-
test_metrics = {
|
|
76
|
-
prod_metrics = {
|
|
77
|
-
|
|
85
|
+
|
|
86
|
+
total_metrics = {"total": 0, "empty": 0, "comment": 0, "code": 0}
|
|
87
|
+
test_metrics = {"total": 0, "empty": 0, "comment": 0, "code": 0}
|
|
88
|
+
prod_metrics = {"total": 0, "empty": 0, "comment": 0, "code": 0}
|
|
89
|
+
|
|
78
90
|
file_sizes = []
|
|
79
|
-
|
|
91
|
+
|
|
80
92
|
for py_file in py_files:
|
|
81
93
|
metrics = count_lines_in_file(py_file)
|
|
82
|
-
file_sizes.append((py_file, metrics[
|
|
83
|
-
|
|
94
|
+
file_sizes.append((py_file, metrics["total"]))
|
|
95
|
+
|
|
84
96
|
# 総計に追加
|
|
85
97
|
for key in total_metrics:
|
|
86
98
|
total_metrics[key] += metrics[key]
|
|
87
|
-
|
|
99
|
+
|
|
88
100
|
# テストファイルかプロダクションファイルかで分類
|
|
89
101
|
if py_file in test_files:
|
|
90
102
|
for key in test_metrics:
|
|
@@ -92,98 +104,106 @@ def collect_line_metrics(py_files, test_files):
|
|
|
92
104
|
else:
|
|
93
105
|
for key in prod_metrics:
|
|
94
106
|
prod_metrics[key] += metrics[key]
|
|
95
|
-
|
|
107
|
+
|
|
96
108
|
print("全体:")
|
|
97
109
|
print(f" 総行数: {total_metrics['total']:,}")
|
|
98
110
|
print(f" 実効コード行数: {total_metrics['code']:,}")
|
|
99
111
|
print(f" コメント行数: {total_metrics['comment']:,}")
|
|
100
112
|
print(f" 空行数: {total_metrics['empty']:,}")
|
|
101
|
-
|
|
113
|
+
|
|
102
114
|
print("\nプロダクションコード:")
|
|
103
115
|
print(f" 総行数: {prod_metrics['total']:,}")
|
|
104
116
|
print(f" 実効コード行数: {prod_metrics['code']:,}")
|
|
105
|
-
|
|
117
|
+
|
|
106
118
|
print("\nテストコード:")
|
|
107
119
|
print(f" 総行数: {test_metrics['total']:,}")
|
|
108
120
|
print(f" 実効コード行数: {test_metrics['code']:,}")
|
|
109
|
-
|
|
121
|
+
|
|
110
122
|
# 最大ファイルサイズ(プロジェクト固有のみ)
|
|
111
123
|
file_sizes.sort(key=lambda x: x[1], reverse=True)
|
|
112
124
|
print("\n=== 最大ファイル(上位10件)===")
|
|
113
125
|
for i, (file_path, lines) in enumerate(file_sizes[:10]):
|
|
114
|
-
print(f"{i+1:2d}. {file_path} ({lines:,} 行)")
|
|
115
|
-
|
|
126
|
+
print(f"{i + 1:2d}. {file_path} ({lines:,} 行)")
|
|
127
|
+
|
|
116
128
|
return total_metrics, prod_metrics, test_metrics
|
|
117
129
|
|
|
130
|
+
|
|
118
131
|
def analyze_project_structure():
|
|
119
132
|
"""プロジェクト構造を分析"""
|
|
120
133
|
print("\n=== プロジェクト構造分析 ===")
|
|
121
|
-
|
|
134
|
+
|
|
122
135
|
# メインパッケージのディレクトリ構造
|
|
123
|
-
main_package = Path(
|
|
136
|
+
main_package = Path("tree_sitter_analyzer")
|
|
124
137
|
if main_package.exists():
|
|
125
138
|
print(f"メインパッケージ: {main_package}")
|
|
126
|
-
subdirs = [d for d in main_package.rglob(
|
|
139
|
+
subdirs = [d for d in main_package.rglob("*") if d.is_dir()]
|
|
127
140
|
print(f"サブディレクトリ数: {len(subdirs)}")
|
|
128
|
-
|
|
141
|
+
|
|
129
142
|
# 主要なサブモジュール
|
|
130
143
|
main_subdirs = [d for d in main_package.iterdir() if d.is_dir()]
|
|
131
144
|
print("主要サブモジュール:")
|
|
132
145
|
for subdir in sorted(main_subdirs):
|
|
133
|
-
py_files_in_subdir = list(subdir.rglob(
|
|
146
|
+
py_files_in_subdir = list(subdir.rglob("*.py"))
|
|
134
147
|
print(f" {subdir.name}: {len(py_files_in_subdir)} ファイル")
|
|
135
148
|
|
|
149
|
+
|
|
136
150
|
def check_dependencies():
|
|
137
151
|
"""依存関係を確認"""
|
|
138
152
|
print("\n=== 依存関係確認 ===")
|
|
139
|
-
|
|
153
|
+
|
|
140
154
|
# pyproject.tomlから依存関係を読み取り
|
|
141
|
-
pyproject_path = Path(
|
|
155
|
+
pyproject_path = Path("pyproject.toml")
|
|
142
156
|
if pyproject_path.exists():
|
|
143
157
|
print("pyproject.tomlから依存関係を確認:")
|
|
144
158
|
try:
|
|
145
|
-
with open(pyproject_path,
|
|
159
|
+
with open(pyproject_path, encoding="utf-8") as f:
|
|
146
160
|
content = f.read()
|
|
147
|
-
if
|
|
148
|
-
lines = content.split(
|
|
161
|
+
if "[tool.poetry.dependencies]" in content:
|
|
162
|
+
lines = content.split("\n")
|
|
149
163
|
in_deps = False
|
|
150
164
|
for line in lines:
|
|
151
|
-
if
|
|
165
|
+
if "[tool.poetry.dependencies]" in line:
|
|
152
166
|
in_deps = True
|
|
153
167
|
continue
|
|
154
|
-
elif line.startswith(
|
|
168
|
+
elif line.startswith("[") and in_deps:
|
|
155
169
|
break
|
|
156
|
-
elif in_deps and
|
|
170
|
+
elif in_deps and "=" in line:
|
|
157
171
|
print(f" {line.strip()}")
|
|
158
172
|
except Exception as e:
|
|
159
173
|
print(f"pyproject.toml読み取りエラー: {e}")
|
|
160
174
|
|
|
175
|
+
|
|
161
176
|
def main():
|
|
162
177
|
"""メイン関数"""
|
|
163
178
|
print("tree-sitter-analyzer プロジェクト固有メトリクス収集")
|
|
164
179
|
print("=" * 60)
|
|
165
|
-
|
|
180
|
+
|
|
166
181
|
# ファイルメトリクス収集
|
|
167
182
|
py_files, test_files = collect_file_metrics()
|
|
168
|
-
|
|
183
|
+
|
|
169
184
|
# 行数メトリクス収集
|
|
170
|
-
total_metrics, prod_metrics, test_metrics = collect_line_metrics(
|
|
171
|
-
|
|
185
|
+
total_metrics, prod_metrics, test_metrics = collect_line_metrics(
|
|
186
|
+
py_files, test_files
|
|
187
|
+
)
|
|
188
|
+
|
|
172
189
|
# プロジェクト構造分析
|
|
173
190
|
analyze_project_structure()
|
|
174
|
-
|
|
191
|
+
|
|
175
192
|
# 依存関係確認
|
|
176
193
|
check_dependencies()
|
|
177
|
-
|
|
194
|
+
|
|
178
195
|
print("\n" + "=" * 60)
|
|
179
196
|
print("プロジェクト固有メトリクス収集完了")
|
|
180
|
-
|
|
197
|
+
|
|
181
198
|
# サマリー
|
|
182
199
|
print("\n=== サマリー ===")
|
|
183
200
|
print(f"プロジェクト規模: {len(py_files)} Pythonファイル")
|
|
184
201
|
print(f"総コード行数: {total_metrics['code']:,} 行")
|
|
185
202
|
print(f"テストカバレッジ対象: {len(test_files)} テストファイル")
|
|
186
|
-
print(
|
|
203
|
+
print(
|
|
204
|
+
f"平均ファイルサイズ: {total_metrics['total'] // len(py_files) if py_files else 0} 行/ファイル"
|
|
205
|
+
)
|
|
206
|
+
|
|
187
207
|
|
|
188
208
|
if __name__ == "__main__":
|
|
189
|
-
main()
|
|
209
|
+
main()
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
import asyncio
|
|
5
5
|
import tempfile
|
|
6
6
|
from pathlib import Path
|
|
7
|
+
|
|
7
8
|
from tree_sitter_analyzer.core.query_service import QueryService
|
|
8
9
|
|
|
10
|
+
|
|
9
11
|
async def debug_test():
|
|
10
12
|
"""デバッグテスト"""
|
|
11
13
|
print("🔍 Debugging async QueryService...")
|
|
12
|
-
|
|
14
|
+
|
|
13
15
|
# テストファイルを作成
|
|
14
|
-
with tempfile.NamedTemporaryFile(mode=
|
|
16
|
+
with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f:
|
|
15
17
|
test_content = """
|
|
16
18
|
def test_function():
|
|
17
19
|
return 42
|
|
@@ -22,59 +24,61 @@ class TestClass:
|
|
|
22
24
|
"""
|
|
23
25
|
f.write(test_content)
|
|
24
26
|
test_file = f.name
|
|
25
|
-
|
|
27
|
+
|
|
26
28
|
try:
|
|
27
29
|
service = QueryService()
|
|
28
|
-
|
|
30
|
+
|
|
29
31
|
# 1. ファイル読み込みテスト
|
|
30
32
|
print(f"📁 Testing file reading: {test_file}")
|
|
31
|
-
if hasattr(service,
|
|
33
|
+
if hasattr(service, "_read_file_async"):
|
|
32
34
|
content, encoding = await service._read_file_async(test_file)
|
|
33
35
|
print(f"📄 File content length: {len(content)}")
|
|
34
36
|
print(f"📄 File encoding: {encoding}")
|
|
35
37
|
print(f"📄 File content preview: {content[:100]}...")
|
|
36
38
|
else:
|
|
37
39
|
print("❌ _read_file_async method not found")
|
|
38
|
-
|
|
40
|
+
|
|
39
41
|
# 2. 利用可能なクエリの確認
|
|
40
|
-
print(
|
|
42
|
+
print("🔍 Available queries for Python:")
|
|
41
43
|
available_queries = service.get_available_queries("python")
|
|
42
44
|
print(f"📋 Available queries: {available_queries}")
|
|
43
|
-
|
|
45
|
+
|
|
44
46
|
# 3. クエリ実行テスト
|
|
45
|
-
print(
|
|
47
|
+
print("🚀 Testing query execution...")
|
|
46
48
|
try:
|
|
47
49
|
results = await service.execute_query(
|
|
48
|
-
file_path=test_file,
|
|
49
|
-
language="python",
|
|
50
|
-
query_key="function"
|
|
50
|
+
file_path=test_file, language="python", query_key="function"
|
|
51
51
|
)
|
|
52
52
|
print(f"✅ Query results: {len(results) if results else 0} items")
|
|
53
53
|
if results:
|
|
54
54
|
for i, result in enumerate(results[:3]): # 最初の3つを表示
|
|
55
|
-
print(f" {i+1}. {result}")
|
|
55
|
+
print(f" {i + 1}. {result}")
|
|
56
56
|
else:
|
|
57
57
|
print(" No results found")
|
|
58
58
|
except Exception as e:
|
|
59
59
|
print(f"❌ Query execution failed: {e}")
|
|
60
60
|
import traceback
|
|
61
|
+
|
|
61
62
|
traceback.print_exc()
|
|
62
|
-
|
|
63
|
+
|
|
63
64
|
# 4. カスタムクエリテスト
|
|
64
|
-
print(
|
|
65
|
+
print("🔧 Testing custom query...")
|
|
65
66
|
try:
|
|
66
67
|
custom_results = await service.execute_query(
|
|
67
68
|
file_path=test_file,
|
|
68
69
|
language="python",
|
|
69
|
-
query_string="(function_definition) @function"
|
|
70
|
+
query_string="(function_definition) @function",
|
|
71
|
+
)
|
|
72
|
+
print(
|
|
73
|
+
f"✅ Custom query results: {len(custom_results) if custom_results else 0} items"
|
|
70
74
|
)
|
|
71
|
-
print(f"✅ Custom query results: {len(custom_results) if custom_results else 0} items")
|
|
72
75
|
except Exception as e:
|
|
73
76
|
print(f"❌ Custom query failed: {e}")
|
|
74
|
-
|
|
77
|
+
|
|
75
78
|
finally:
|
|
76
79
|
# クリーンアップ
|
|
77
80
|
Path(test_file).unlink(missing_ok=True)
|
|
78
81
|
|
|
82
|
+
|
|
79
83
|
if __name__ == "__main__":
|
|
80
|
-
asyncio.run(debug_test())
|
|
84
|
+
asyncio.run(debug_test())
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# 技術的負債分析レポートと改善計画
|
|
2
|
+
|
|
3
|
+
**作成日:** 2025-10-16
|
|
4
|
+
|
|
5
|
+
## 1. はじめに
|
|
6
|
+
|
|
7
|
+
本レポートは、`tree-sitter-analyzer` プロジェクトに存在する技術的負債を定量的に分析し、その解決に向けた具体的な改善計画を提示するものです。分析は、静的解析ツール(mypy, ruff)、テスト実行時間、コード行数、コメント率の観点から実施しました。
|
|
8
|
+
|
|
9
|
+
## 2. 技術的負債の現状分析
|
|
10
|
+
|
|
11
|
+
### 🔴 緊急対応が必要
|
|
12
|
+
|
|
13
|
+
#### 2.1. 型安全性問題 (mypyエラー)
|
|
14
|
+
|
|
15
|
+
- **現状**: `mypy`による解析の結果、**341個**の型エラーが検出されました。
|
|
16
|
+
- **エラーの傾向**:
|
|
17
|
+
- `[attr-defined]`: 存在しない属性へのアクセスが最も多い。特に、動的に属性が追加されるデータモデルクラス(`MarkdownElement`など)や、Extractorクラスの設計に起因する問題が多数見られます。
|
|
18
|
+
- `[assignment]`, `[return-value]`: 型の不整合。特に、`list[SubClass]`を`list[SuperClass]`として扱う際の型共変性の問題が散見されます。
|
|
19
|
+
- `[override]`: スーパークラスとサブクラスでのメソッドシグネチャの不一致。
|
|
20
|
+
- `[no-untyped-def]`: 型ヒントが付与されていない関数定義。
|
|
21
|
+
- **影響**: 型安全性が低いコードは、リファクタリング時の安全性低下、IDEによるサポート(補完、静的解析)の質の低下、実行時エラーのリスク増大に繋がります。
|
|
22
|
+
|
|
23
|
+
#### 2.2. パフォーマンス問題
|
|
24
|
+
|
|
25
|
+
- **テスト実行時間**: `pytest`の実行結果から、特に時間のかかるテストが特定されました。
|
|
26
|
+
- `tests/performance/test_mcp_performance.py`: **66.55秒**
|
|
27
|
+
- `tests/integration/test_phase7_integration_suite.py`: **61.45秒**
|
|
28
|
+
- `tests/integration/test_phase7_performance_integration.py`: **60.82秒**
|
|
29
|
+
- **ボトルネック**: 上位のテストは、MCP(Model Context Protocol)関連の統合テストやパフォーマンステストに集中しており、特に`search_content`や複合的なワークフローのテストに時間がかかっています。これは、実際の検索機能のパフォーマンスに課題がある可能性を示唆しています。
|
|
30
|
+
|
|
31
|
+
### 🟡 中期対応
|
|
32
|
+
|
|
33
|
+
#### 2.3. コードスタイル (ruff違反)
|
|
34
|
+
|
|
35
|
+
- **現状**: `ruff`によるチェックで多数の違反が検出されました。
|
|
36
|
+
- **主な違反**:
|
|
37
|
+
- `W293`: 不要な空白
|
|
38
|
+
- `I001`: importの順序が不正
|
|
39
|
+
- `F401`: 未使用のimport
|
|
40
|
+
- `UP045`: `Optional[X]` を `X | None` にすべき
|
|
41
|
+
- **影響**: コードの一貫性が損なわれ、可読性が低下します。多くは自動修正可能ですが、放置するとコードベース全体の品質が徐々に劣化します。
|
|
42
|
+
|
|
43
|
+
#### 2.4. 大規模ファイル
|
|
44
|
+
|
|
45
|
+
- **現状**: `tests`ディレクトリ内に5,000行を超えるテストファイルは確認されませんでしたが、**4,393行**の `test_mcp_fd_rg_tools.py` が突出して大きいことが判明しました。
|
|
46
|
+
- **影響**:
|
|
47
|
+
- **可読性の低下**: ファイル全体の見通しが悪く、特定のテストケースを探すのが困難です。
|
|
48
|
+
- **メンテナンス性の悪化**: 関連性の低いテストが混在し、変更時の影響範囲の特定が難しくなります。
|
|
49
|
+
- **テストの実行効率**: 一部のテストだけを実行したい場合に不便です。
|
|
50
|
+
|
|
51
|
+
### 🟢 長期対応
|
|
52
|
+
|
|
53
|
+
#### 2.5. ドキュメント (コメント率)
|
|
54
|
+
|
|
55
|
+
- **現状**: プロジェクト全体のコメント率は**63.6%**と非常に高く、当初の懸念(6.5%)は誤りでした。
|
|
56
|
+
- **評価**: コメント率は健全な状態であり、現時点では大きな問題ではありません。ただし、コードの変更に追随していない古いコメントが存在する可能性はあります。
|
|
57
|
+
|
|
58
|
+
## 3. 改善ロードマップ
|
|
59
|
+
|
|
60
|
+
以下に、分析結果に基づく改善ロードマップを提案します。
|
|
61
|
+
|
|
62
|
+
```mermaid
|
|
63
|
+
gantt
|
|
64
|
+
title 技術的負債 改善ロードマップ
|
|
65
|
+
dateFormat YYYY-MM-DD
|
|
66
|
+
axisFormat %m-%d
|
|
67
|
+
section 緊急対応 (フェーズ1)
|
|
68
|
+
mypyエラー修正(基盤) :active, crit, a1, 2025-10-20, 7d
|
|
69
|
+
パフォーマンス改善(検索機能) :crit, a2, after a1, 5d
|
|
70
|
+
section 中期対応 (フェーズ2)
|
|
71
|
+
ruff違反の自動修正 :a3, after a2, 2d
|
|
72
|
+
大規模テストファイルの分割 :a4, after a3, 5d
|
|
73
|
+
section 長期対応 (フェーズ3)
|
|
74
|
+
ドキュメントとコードの同期 :a5, after a4, 14d
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### フェーズ1: 緊急対応 (〜2週間)
|
|
78
|
+
|
|
79
|
+
1. **mypyエラーの段階的修正 (7日間)**
|
|
80
|
+
- **Step 1: 基盤モデルの修正**: `MarkdownElement`などの動的に属性が追加されるクラスに、`__slots__`や`@dataclass`を導入し、型定義を明確化します。
|
|
81
|
+
- **Step 2: `[attr-defined]`エラーの解消**: Step 1の修正に基づき、属性アクセスに関するエラーを解消します。
|
|
82
|
+
- **Step 3: `[assignment]`, `[return-value]`エラーの解消**: `Sequence`や`TypeVar`を活用し、型共変性に関する問題を解決します。
|
|
83
|
+
- **成功指標**: mypyエラー数を341個から100個以下に削減する。
|
|
84
|
+
|
|
85
|
+
2. **パフォーマンスボトルネックの改善 (5日間)**
|
|
86
|
+
- **Step 1: プロファイリング**: `pytest-profiling`などを利用して、`test_mcp_performance.py`内のボトルネックとなっている関数を特定します。
|
|
87
|
+
- **Step 2: 検索ロジックの最適化**: `search_content`ツール内のキャッシュ戦略や正規表現の見直し、アルゴリズムの改善を行います。
|
|
88
|
+
- **成功指標**: 最も遅いテストの実行時間を20%以上短縮する。
|
|
89
|
+
|
|
90
|
+
### フェーズ2: 中期対応 (〜2週間)
|
|
91
|
+
|
|
92
|
+
3. **ruff違反の自動修正 (2日間)**
|
|
93
|
+
- **Step 1**: `ruff check . --fix` を実行し、自動修正可能な違反を一括で修正します。
|
|
94
|
+
- **Step 2**: `pre-commit`フックに`ruff`を組み込み、新たな違反の混入を防止します。
|
|
95
|
+
- **成功指標**: ruff違反の数を90%以上削減する。
|
|
96
|
+
|
|
97
|
+
4. **大規模テストファイルの分割 (5日間)**
|
|
98
|
+
- **Step 1: `test_mcp_fd_rg_tools.py`の分割計画**: `fd`関連のテスト、`rg`関連のテスト、両者を組み合わせたテストなど、機能ごとにファイルを分割する計画を立てます。
|
|
99
|
+
- **Step 2: ファイル分割の実施**: 計画に基づき、ファイルを複数の小さなファイルに分割します。
|
|
100
|
+
- **成功指標**: `tests`ディレクトリ内のファイルが全て1,000行未満になる。
|
|
101
|
+
|
|
102
|
+
### フェーズ3: 長期対応 (継続的)
|
|
103
|
+
|
|
104
|
+
5. **ドキュメントとコードの同期 (14日間〜)**
|
|
105
|
+
- **Step 1**: コードレビュープロセスにおいて、コードの変更と同時にコメントやドキュメントが更新されているかを確認する文化を醸成します。
|
|
106
|
+
- **Step 2**: 古いドキュメントやコメントを定期的に見直し、現状と合わない部分を修正します。
|
|
107
|
+
- **成功指標**: コードとドキュメントの乖離に関するIssueが起票されなくなる。
|
|
108
|
+
|
|
109
|
+
## 4. まとめ
|
|
110
|
+
|
|
111
|
+
本プロジェクトは、コメント率の高さなど優れた点も多い一方で、型安全性とパフォーマンスに緊急性の高い課題を抱えています。提案したロードマップに基づき、まずは**フェーズ1の「mypyエラー修正」と「パフォーマンス改善」**に集中的に取り組むことを推奨します。これにより、コードベースの健全性が大幅に向上し、将来の開発速度と安定性に大きく貢献します。
|
|
@@ -111,7 +111,7 @@ async def demo_cache_performance():
|
|
|
111
111
|
elapsed = time.time() - start_time
|
|
112
112
|
cached_times.append(elapsed)
|
|
113
113
|
cache_hit = result.get("cache_hit", False)
|
|
114
|
-
print(f" Run {i+1}: {elapsed:.3f}s (cache hit: {cache_hit})")
|
|
114
|
+
print(f" Run {i + 1}: {elapsed:.3f}s (cache hit: {cache_hit})")
|
|
115
115
|
|
|
116
116
|
avg_cached_time = sum(cached_times) / len(cached_times)
|
|
117
117
|
print(f" 📊 Average: {avg_cached_time:.3f}s")
|
|
@@ -125,7 +125,7 @@ async def demo_cache_performance():
|
|
|
125
125
|
await tool_without_cache.execute(search_args)
|
|
126
126
|
elapsed = time.time() - start_time
|
|
127
127
|
non_cached_times.append(elapsed)
|
|
128
|
-
print(f" Run {i+1}: {elapsed:.3f}s")
|
|
128
|
+
print(f" Run {i + 1}: {elapsed:.3f}s")
|
|
129
129
|
|
|
130
130
|
avg_non_cached_time = sum(non_cached_times) / len(non_cached_times)
|
|
131
131
|
print(f" 📊 Average: {avg_non_cached_time:.3f}s")
|