@zubenelakrab/gitstats
Version:
Powerful Git repository analyzer with comprehensive statistics and insights
75 lines • 2.15 kB
TypeScript
import type { Branch, AnalysisConfig, Analyzer } from '../types/index.js';
export interface BranchesStats {
totalBranches: number;
localBranches: number;
remoteBranches: number;
staleBranches: StaleBranch[];
activeBranches: ActiveBranch[];
orphanBranches: OrphanBranch[];
namingPatterns: NamingPattern[];
averageBranchAge: number;
oldestBranch: {
name: string;
age: number;
} | null;
newestBranch: {
name: string;
age: number;
} | null;
branchHealthScore: number;
branchLifecycle: BranchLifecycle;
}
export interface StaleBranch {
name: string;
lastCommitDate: Date;
daysSinceCommit: number;
isRemote: boolean;
recommendation: string;
}
export interface ActiveBranch {
name: string;
lastCommitDate: Date;
daysSinceCommit: number;
isRemote: boolean;
isCurrent: boolean;
}
export interface OrphanBranch {
name: string;
lastCommitDate: Date;
daysSinceCommit: number;
reason: string;
}
export interface NamingPattern {
pattern: string;
count: number;
examples: string[];
description: string;
}
export interface BranchLifecycle {
activeCount: number;
inactiveCount: number;
staleCount: number;
activePercentage: number;
mergedBranches: number;
unmergedBranches: number;
mergeRate: number;
estimatedAvgLifespan: number;
shortLivedBranches: number;
longLivedBranches: number;
hasGitFlow: boolean;
hasTrunkBased: boolean;
workflowType: 'gitflow' | 'trunk-based' | 'feature-branch' | 'mixed' | 'unknown';
branchesCreatedLast30Days: number;
branchesCreatedLast90Days: number;
}
export declare class BranchesAnalyzer implements Analyzer<BranchesStats> {
name: string;
description: string;
analyze(_commits: unknown, config: AnalysisConfig, branches?: Branch[]): Promise<BranchesStats>;
private analyzeNamingPatterns;
private calculateHealthScore;
private calculateBranchLifecycle;
private emptyStats;
}
export declare function createBranchesAnalyzer(): BranchesAnalyzer;
//# sourceMappingURL=branches-analyzer.d.ts.map