UNPKG

git-contributor-stats

Version:

CLI to compute contributor and repository statistics from a Git repository (commits, lines added/deleted, frequency, heatmap, bus-factor), with filters and multiple output formats.

79 lines 2.27 kB
export interface FileStats { changes: number; added: number; deleted: number; } export interface TopFileEntry { filename: string; changes: number; added: number; deleted: number; } export interface TopContributor { name?: string; email?: string; commits: number; added: number; deleted: number; net: number; changes: number; files: Record<string, FileStats>; topFiles: TopFileEntry[]; } export interface ContributorsMapEntry { name?: string; email?: string; commits: number; added: number; deleted: number; files: Record<string, FileStats>; } export interface TopStatsSummary { byCommits: TopContributor | null; byAdditions: TopContributor | null; byDeletions: TopContributor | null; byNet: TopContributor | null; byChanges: TopContributor | null; } type Commit = { authorName?: string; authorEmail?: string; date?: string | Date; files?: Array<{ filename: string; added: number; deleted: number; }>; }; export declare function mergeSimilarContributors(contribMap: Record<string, ContributorsMapEntry>, threshold: number): Record<string, ContributorsMapEntry & { normalized?: string; }>; export declare function analyze(commits: Commit[], similarityThreshold: number, aliasResolver: ((n: string, name?: string, email?: string) => string) | null, canonicalDetails?: Map<string, { name?: string; email?: string; }>, groupBy?: 'email' | 'name'): { readonly contributors: Record<string, ContributorsMapEntry & { normalized?: string; }>; readonly topContributors: TopContributor[]; readonly totalCommits: number; readonly commitFrequency: { readonly monthly: Record<string, number>; readonly weekly: Record<string, number>; }; readonly heatmap: number[][]; readonly heatmapContributors: Record<string, Record<string, number>>; readonly busFactor: { busFactor: number; candidates: never[]; details: undefined; filesSingleOwner: { file: string; owner: string; changes: number; }[]; }; readonly topStats: TopStatsSummary; }; export {}; //# sourceMappingURL=analyzer.d.ts.map