From 0ebc4e250007c65c1988e191700a359b1ce26246 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sun, 1 Feb 2026 08:28:17 +0000 Subject: [PATCH] Add commit pattern, code churn, risky commit, and velocity analyzers --- src/analyzers/commit_pattern.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/analyzers/commit_pattern.py b/src/analyzers/commit_pattern.py index 22e625a..fd1f966 100644 --- a/src/analyzers/commit_pattern.py +++ b/src/analyzers/commit_pattern.py @@ -3,7 +3,7 @@ from dataclasses import dataclass from typing import Dict, List, Optional from src.analyzers.git_repository import GitRepository -from src.models.data_structures import CommitAnalysis +from src.models.data_structures import CommitAnalysis, Author @dataclass @@ -24,8 +24,6 @@ class CommitPatternAnalyzer: commits_by_day: Dict[str, int] = defaultdict(int) commits_by_week: Dict[str, int] = defaultdict(int) - author_commits: Dict[str, List[str]] = defaultdict(list) - for commit in commits: hour_key = commit.timestamp.strftime("%H:00") day_key = commit.timestamp.strftime("%A") @@ -35,17 +33,7 @@ class CommitPatternAnalyzer: commits_by_day[day_key] += 1 commits_by_week[week_key] += 1 - author_commits[commit.author_email].append(commit.sha) - - authors = [] - for email, commit_shas in author_commits.items(): - author = self.repo.get_authors() - for a in author: - if a.email == email: - a.commit_count = len(commit_shas) - authors.append(a) - break - + authors = self.repo.get_authors() authors.sort(key=lambda a: a.commit_count, reverse=True) top_authors = authors[:10]