UNPKG

@bobmatnyc/ai-code-review

Version:

A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter

38 lines (37 loc) 1.65 kB
/** * @fileoverview Code tracing strategy for identifying unused code with high confidence. * * This strategy uses a multi-pass approach to trace code paths and identify unused code: * 1. Maps entry points and dependencies * 2. Traces references through the codebase * 3. Verifies findings and assesses confidence * * It collects detailed evidence for each identified unused element to ensure high confidence * in recommendations for removal. */ import { BaseReviewStrategy, IReviewStrategy } from './ReviewStrategy'; import { FileInfo, ReviewOptions, ReviewResult } from '../types/review'; import { ProjectDocs } from '../utils/files/projectDocs'; import { ApiClientConfig } from '../core/ApiClientSelector'; /** * Strategy for performing code tracing based unused code review */ export declare class CodeTracingUnusedCodeReviewStrategy extends BaseReviewStrategy implements IReviewStrategy { constructor(); /** * Execute the review strategy * @param files Files to review * @param projectName Project name * @param projectDocs Project documentation * @param options Review options * @param apiClientConfig API client configuration * @returns Promise resolving to the review result */ execute(files: FileInfo[], projectName: string, projectDocs: ProjectDocs | null, options: ReviewOptions, apiClientConfig: ApiClientConfig): Promise<ReviewResult>; /** * Check if there are any high confidence unused elements * @param review The review to check * @returns Whether there are high confidence unused elements */ private hasHighConfidenceUnusedElements; }