Documentation
¶
Index ¶
- func FormatAbsChurn(results []ChurnResult, _ model.Options) [][]string
- func FormatAge(results []AgeResult, _ model.Options) [][]string
- func FormatAuthorChurn(results []ChurnResult, _ model.Options) [][]string
- func FormatAuthors(results []AuthorsResult, _ model.Options) [][]string
- func FormatCommunication(results []CommunicationResult, _ model.Options) [][]string
- func FormatCoupling(results []CouplingResult, opts model.Options) [][]string
- func FormatEntityChurn(results []ChurnResult, _ model.Options) [][]string
- func FormatEntityEffort(results []EntityEffortResult, _ model.Options) [][]string
- func FormatEntityOwnership(results []EntityOwnershipResult, _ model.Options) [][]string
- func FormatFragmentation(results []FragmentationResult, _ model.Options) [][]string
- func FormatIdentity(results []model.Commit, _ model.Options) [][]string
- func FormatMainDev(results []ContributorResult, _ model.Options) [][]string
- func FormatMainDevByRevs(results []ContributorResult, _ model.Options) [][]string
- func FormatRefactoringMainDev(results []ContributorResult, _ model.Options) [][]string
- func FormatRevisions(results []RevisionsResult, _ model.Options) [][]string
- func FormatStatistics(results []StatisticsResult, _ model.Options) [][]string
- func FormatSumOfCoupling(results []SumOfCouplingResult, _ model.Options) [][]string
- func FormatSummary(result SummaryResult, _ model.Options) [][]string
- func Identity(commits []model.Commit, _ model.Options) []model.Commit
- type AgeResult
- type AuthorsResult
- type ChurnResult
- type CommunicationResult
- type ContributorResult
- type CouplingResult
- type EntityEffortResult
- type EntityOwnershipResult
- type FragmentationResult
- type RevisionsResult
- type StatisticsResult
- type SumOfCouplingResult
- type SummaryResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatAbsChurn ¶
func FormatAbsChurn(results []ChurnResult, _ model.Options) [][]string
func FormatAuthorChurn ¶
func FormatAuthorChurn(results []ChurnResult, _ model.Options) [][]string
func FormatAuthors ¶
func FormatAuthors(results []AuthorsResult, _ model.Options) [][]string
func FormatCommunication ¶
func FormatCommunication(results []CommunicationResult, _ model.Options) [][]string
func FormatCoupling ¶
func FormatCoupling(results []CouplingResult, opts model.Options) [][]string
func FormatEntityChurn ¶
func FormatEntityChurn(results []ChurnResult, _ model.Options) [][]string
func FormatEntityEffort ¶
func FormatEntityEffort(results []EntityEffortResult, _ model.Options) [][]string
func FormatEntityOwnership ¶
func FormatEntityOwnership(results []EntityOwnershipResult, _ model.Options) [][]string
func FormatFragmentation ¶
func FormatFragmentation(results []FragmentationResult, _ model.Options) [][]string
func FormatMainDev ¶
func FormatMainDev(results []ContributorResult, _ model.Options) [][]string
func FormatMainDevByRevs ¶
func FormatMainDevByRevs(results []ContributorResult, _ model.Options) [][]string
func FormatRefactoringMainDev ¶
func FormatRefactoringMainDev(results []ContributorResult, _ model.Options) [][]string
func FormatRevisions ¶
func FormatRevisions(results []RevisionsResult, _ model.Options) [][]string
func FormatStatistics ¶
func FormatStatistics(results []StatisticsResult, _ model.Options) [][]string
func FormatSumOfCoupling ¶
func FormatSumOfCoupling(results []SumOfCouplingResult, _ model.Options) [][]string
func FormatSummary ¶
func FormatSummary(result SummaryResult, _ model.Options) [][]string
Types ¶
type AuthorsResult ¶
type ChurnResult ¶
ChurnResult holds added/deleted line totals and distinct commit count for one key. Used by AbsChurn (key=date), AuthorChurn (key=author), and EntityChurn (key=entity).
func AbsChurn ¶
func AbsChurn(commits []model.Commit, _ model.Options) []ChurnResult
AbsChurn returns lines added/deleted aggregated by date.
func AuthorChurn ¶
func AuthorChurn(commits []model.Commit, _ model.Options) []ChurnResult
AuthorChurn returns lines added/deleted aggregated by author.
func EntityChurn ¶
func EntityChurn(commits []model.Commit, _ model.Options) []ChurnResult
EntityChurn returns lines added/deleted aggregated by entity, sorted by added desc.
type CommunicationResult ¶
func Communication ¶
func Communication(commits []model.Commit, _ model.Options) []CommunicationResult
Communication maps team collaboration needs based on shared entities.
Algorithm (mirrors the original Clojure implementation):
- Find distinct authors per entity.
- For each entity, generate all 2-selections (with replacement) of its authors: [A,A], [A,B], [B,A], [B,B] etc.
- Count frequencies across all entities.
- Self-pairs [A,A] give A's total entity count ("total commits").
- Non-self pairs [A,B] give the count of entities both A and B touched ("shared").
- average = ceil((self_A + self_B) / 2)
- strength = int((shared / average) * 100)
type ContributorResult ¶
type ContributorResult struct {
Entity string
Contributor string
Count int
Total int
Ownership float64
}
ContributorResult holds the top contributor per entity and their ownership percentage. Used by MainDev, RefactoringMainDev, and MainDevByRevs.
func MainDev ¶
func MainDev(commits []model.Commit, _ model.Options) []ContributorResult
MainDev returns the author with the most lines added per entity.
func MainDevByRevs ¶
func MainDevByRevs(commits []model.Commit, _ model.Options) []ContributorResult
MainDevByRevs returns the author with the most revisions per entity.
func RefactoringMainDev ¶
func RefactoringMainDev(commits []model.Commit, _ model.Options) []ContributorResult
RefactoringMainDev returns the author with the most lines deleted per entity.
type CouplingResult ¶
type EntityEffortResult ¶
func EntityEffort ¶
func EntityEffort(commits []model.Commit, _ model.Options) []EntityEffortResult
EntityEffort returns revision count per (entity, author) pair.
type EntityOwnershipResult ¶
func EntityOwnership ¶
func EntityOwnership(commits []model.Commit, _ model.Options) []EntityOwnershipResult
EntityOwnership returns churn per (entity, author) pair.
type FragmentationResult ¶
func Fragmentation ¶
func Fragmentation(commits []model.Commit, _ model.Options) []FragmentationResult
Fragmentation calculates the fractal value (author distribution) per entity. fractal = 1 - Σ(author_revs/total_revs)² 0 = single author, approaching 1 = many equal contributors.
type RevisionsResult ¶
type StatisticsResult ¶
type StatisticsResult struct {
Metric string
Count int
Min float64
Q1 float64
Median float64
Q3 float64
Max float64
Mean float64
Stddev float64
}
func Statistics ¶
func Statistics(commits []model.Commit, _ model.Options) []StatisticsResult
Statistics computes descriptive statistics (count/min/q1/median/q3/max/ mean/sample-stddev) for a curated set of core metrics. It intentionally ignores opts: this is a whole-codebase health report, not a filtered query, so none of model.Options' threshold fields (MinRevs, MaxChangesetSize, etc.) apply. Entity/author remapping via -g/-p still applies normally, since runAnalysis rewrites commits before Statistics ever sees them.
type SumOfCouplingResult ¶
func SumOfCoupling ¶
func SumOfCoupling(commits []model.Commit, opts model.Options) []SumOfCouplingResult
SumOfCoupling aggregates coupling counts per entity (how many co-changes it participates in).