🛑 The Problem
We need the actual mathematical business logic to calculate the 'Bus Factor' (the minimum number of developers responsible for 50% of the repository's total commits or lines changed).
💡 The Solution
Write a pure, testable TypeScript function that takes raw commit data and returns the exact integer representing the Bus Factor.
🛠️ Implementation Details
- Create the function in
packages/domain-analytics/src/busFactor.ts.
- Group the total commits by author.
- Sum the commits (or lines changed) per author.
- Sort the authors descending by volume.
- Iterate through the list, keeping a running tally of commits.
- The moment the tally exceeds
Total Commits / 2, return the current index + 1 as the Bus Factor.
✅ Acceptance Criteria
Ready to tackle this? Comment .take below to get automatically assigned!
🛑 The Problem
We need the actual mathematical business logic to calculate the 'Bus Factor' (the minimum number of developers responsible for 50% of the repository's total commits or lines changed).
💡 The Solution
Write a pure, testable TypeScript function that takes raw commit data and returns the exact integer representing the Bus Factor.
🛠️ Implementation Details
packages/domain-analytics/src/busFactor.ts.Total Commits / 2, return the current index + 1 as the Bus Factor.✅ Acceptance Criteria
Ready to tackle this? Comment
.takebelow to get automatically assigned!