analyze_test_coverage
Analyze code test coverage by comparing source files with test files to identify untested code sections and improve testing effectiveness.
Instructions
Analyze test coverage for code files (simplified)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | File paths to analyze | |
| testFiles | No | Test file paths |
Implementation Reference
- src/tools/code-quality.ts:240-250 (handler)Handler for the 'analyze_test_coverage' tool. Provides a simplified response indicating that full test coverage analysis requires external tools like Istanbul, returning basic counts and 'N/A' for coverage.case 'analyze_test_coverage': { // Simplified implementation const files = params.files as string[]; const testFiles = (params.testFiles as string[]) || []; return { message: 'Test coverage analysis is simplified. For full analysis, use coverage tools like Istanbul.', filesAnalyzed: files.length, testFilesFound: testFiles.length, coverage: 'N/A', }; }
- src/tools/code-quality.ts:118-137 (registration)Registration of the 'analyze_test_coverage' tool in the codeQualityTools array, including name, description, and input schema.{ name: 'analyze_test_coverage', description: 'Analyze test coverage for code files (simplified)', inputSchema: { type: 'object', properties: { files: { type: 'array', items: { type: 'string' }, description: 'File paths to analyze', }, testFiles: { type: 'array', items: { type: 'string' }, description: 'Test file paths', }, }, required: ['files'], }, },
- src/tools/code-quality.ts:121-136 (schema)Input schema definition for the 'analyze_test_coverage' tool, specifying properties for files and testFiles.inputSchema: { type: 'object', properties: { files: { type: 'array', items: { type: 'string' }, description: 'File paths to analyze', }, testFiles: { type: 'array', items: { type: 'string' }, description: 'Test file paths', }, }, required: ['files'], },