start_coverage
Begin tracking code coverage during PHP debugging sessions to identify untested code paths and improve test quality.
Instructions
Start tracking code coverage during debugging
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/advanced.ts:437-455 (registration)Registers the 'start_coverage' MCP tool with the server, defining its description, empty input schema, and inline handler function that initializes code coverage tracking via the CodeCoverageTracker.server.tool( 'start_coverage', 'Start tracking code coverage during debugging', {}, async () => { const report = ctx.coverageTracker.startTracking(); return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Code coverage tracking started', }), }, ], }; } );
- src/tools/advanced.ts:441-454 (handler)The inline handler function for the 'start_coverage' tool, which calls coverageTracker.startTracking() and returns a success message.async () => { const report = ctx.coverageTracker.startTracking(); return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Code coverage tracking started', }), }, ], }; }
- src/session/code-coverage.ts:34-45 (helper)The core implementation of starting code coverage tracking in the CodeCoverageTracker class, initializing the report structure and setting tracking state.startTracking(): CoverageReport { this.currentReport = { startedAt: new Date(), files: new Map(), totalFiles: 0, totalLinesExecuted: 0, uniqueLinesExecuted: 0, }; this.isTracking = true; logger.info('Code coverage tracking started'); return this.currentReport; }