### Install PhpCodeArcheology Source: https://phpcodearcheology.github.io/ Install the tool as a development dependency using Composer. ```bash composer require --dev php-code-archeology/php-code-archeology ``` -------------------------------- ### Setup MCP Server for PhpCodeArcheology Source: https://phpcodearcheology.github.io/ Command to add PhpCodeArcheology as an MCP source. This allows MCP-compatible clients to query the codebase. ```bash claude mcp add phpcodearcheology \ -- vendor/bin/phpcodearcheology mcp ``` -------------------------------- ### MCP Tool Calls for Codebase Interaction Source: https://phpcodearcheology.github.io/ Examples of MCP tool calls to query codebase information. These commands can be used with MCP-compatible clients like Claude or Cursor. ```bash get_hotspots {"limit": 5, "min_complexity": 15} ``` ```bash get_refactoring_priorities {"threshold": "high"} ``` ```bash get_impact_analysis {"class": "OrderService"} ``` ```bash get_dependencies {"depth": 2} ``` -------------------------------- ### Composer Configuration for Framework Detection Source: https://phpcodearcheology.github.io/ Example `composer.json` snippet demonstrating how PhpCodeArcheology detects frameworks like Symfony and Doctrine. This detection influences metric thresholds and exclusion rules. ```json "require": { "symfony/framework-bundle": "^7.0", "doctrine/orm": "^3.0" } ``` -------------------------------- ### Run Quick Terminal Output Analysis Source: https://phpcodearcheology.github.io/ Use the --quick flag for a concise, CI-friendly output directly in the terminal, suitable for automated environments. ```bash php vendor/bin/phpcodearcheology --quick src/ ``` -------------------------------- ### Run Basic Code Analysis Source: https://phpcodearcheology.github.io/ Execute the primary code analysis command on your source directory. The report will be generated in the tmp/report/html/ directory. ```bash php vendor/bin/phpcodearcheology src/ ``` -------------------------------- ### Compare Code Analysis Results Source: https://phpcodearcheology.github.io/ Use the --compare flag to analyze two different points in time or branches and view a structured diff of metric changes. Ensure you have a baseline JSON report generated previously. ```bash php vendor/bin/phpcodearcheology --compare=baseline.json src/ ``` -------------------------------- ### Run Analysis with Test Coverage Data Source: https://phpcodearcheology.github.io/ Integrate PhpCodeArcheology with PHPUnit's code coverage reports. First, generate a Clover XML coverage file, then use it with the analysis tool. ```bash XDEBUG_MODE=coverage vendor/bin/phpunit \ --coverage-clover clover.xml ``` ```bash php vendor/bin/phpcodearcheology \ --coverage-file clover.xml src/ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.