start_coverage
Begin tracking code coverage during PHP debugging to identify which lines of code are executed during tests or runtime.
Instructions
Start tracking code coverage during debugging
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/advanced.ts:437-455 (registration)Registers the 'start_coverage' MCP tool with empty input schema and an inline handler that delegates to CodeCoverageTracker.startTracking() and returns a success message.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/session/code-coverage.ts:34-45 (handler)The core handler logic in CodeCoverageTracker.startTracking(): initializes the coverage report structure, starts tracking, logs the event, and returns the report.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; }