/** * Agentic QE v3 - Git Analyzer * Provides real git history analysis for defect prediction * * Features: * - File change frequency analysis * - Developer experience scoring based on git blame * - Code age calculation * - Bug history from commit messages */ /** * Git commit information */ export interface GitCommit { hash: string; author: string; email: string; date: Date; message: string; filesChanged: string[]; } /** * Git blame information for a file */ export interface GitBlameInfo { authors: Map; primaryAuthor: string; primaryAuthorPercentage: number; totalLines: number; mostRecentChange: Date; oldestChange: Date; } /** * File history analysis */ export interface FileHistory { filePath: string; totalCommits: number; uniqueAuthors: number; firstCommit: Date | null; lastCommit: Date | null; changeFrequency: number; isRecentlyModified: boolean; bugFixCommits: number; } /** * Configuration for GitAnalyzer */ export interface GitAnalyzerConfig { /** Repository root path (default: process.cwd()) */ repoRoot?: string; /** Maximum commits to analyze per file (default: 100) */ maxCommits?: number; /** Bug keywords to search for in commit messages */ bugKeywords?: string[]; /** Enable caching of git results */ enableCache?: boolean; /** Cache TTL in milliseconds (default: 5 minutes) */ cacheTtl?: number; } /** * Git Analyzer for defect prediction metrics */ export declare class GitAnalyzer { private readonly config; private readonly cache; private isGitRepo; constructor(config?: GitAnalyzerConfig); /** * Check if current directory is a git repository */ isGitRepository(): Promise; /** * Get file change frequency (commits in last 90 days / 3) * Returns normalized value 0-1 */ getChangeFrequency(filePath: string): Promise; /** * Get developer experience score for a file based on git blame * Returns inverted score: high experience = low risk (0), low experience = high risk (1) */ getDeveloperExperience(filePath: string): Promise; /** * Get code age - how old is the file * Returns risk score: very new (0.7), very old stable (0.3), middle-aged (0.4) */ getCodeAge(filePath: string): Promise; /** * Get bug history - how many bug fix commits have touched this file * Returns normalized score 0-1 */ getBugHistory(filePath: string): Promise; /** * Get comprehensive file history analysis */ getFileHistory(filePath: string): Promise; /** * Get files changed since a specific date * @param since - Date to check changes from (default: 24 hours ago) * @returns Array of changed file paths relative to repo root */ getChangedFiles(since?: Date): Promise; /** * Get files changed in a specific commit * @param commitHash - Git commit hash (default: HEAD) * @returns Array of changed file paths relative to repo root */ getCommitFiles(commitHash?: string): Promise; /** * Get files with uncommitted changes (staged + unstaged) * @returns Array of modified file paths relative to repo root */ getUncommittedFiles(): Promise; /** * Get relative path from repo root */ private getRelativePath; /** * Get cached value */ private getFromCache; /** * Set cache value */ private setCache; /** * Get default file history for non-git repos */ private getDefaultFileHistory; /** * Clear the cache */ clearCache(): void; } //# sourceMappingURL=git-analyzer.d.ts.map