analysis

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatAbsChurn

func FormatAbsChurn(results []ChurnResult, _ model.Options) [][]string

func FormatAge

func FormatAge(results []AgeResult, _ 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 FormatIdentity

func FormatIdentity(results []model.Commit, _ 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

func Identity

func Identity(commits []model.Commit, _ model.Options) []model.Commit

Identity passes commits through unchanged, producing a raw revision listing.

Types

type AgeResult

type AgeResult struct {
	Entity    string
	AgeMonths int
}

func Age

func Age(commits []model.Commit, opts model.Options) []AgeResult

Age calculates months since last modification for each entity.

type AuthorsResult

type AuthorsResult struct {
	Entity  string
	Authors int
	Revs    int
}

func Authors

func Authors(commits []model.Commit, _ model.Options) []AuthorsResult

Authors counts the distinct authors and revisions for each entity.

type ChurnResult

type ChurnResult struct {
	Key     string
	Added   int
	Deleted int
	Commits int
}

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

type CommunicationResult struct {
	Author   string
	Peer     string
	Shared   int
	Average  int
	Strength int
}

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):

  1. Find distinct authors per entity.
  2. For each entity, generate all 2-selections (with replacement) of its authors: [A,A], [A,B], [B,A], [B,B] etc.
  3. Count frequencies across all entities.
  4. Self-pairs [A,A] give A's total entity count ("total commits").
  5. Non-self pairs [A,B] give the count of entities both A and B touched ("shared").
  6. average = ceil((self_A + self_B) / 2)
  7. 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 CouplingResult struct {
	Entity  string
	Coupled string
	Degree  int
	AvgRevs int
	RevA    int
	RevB    int
	Shared  int
}

func Coupling

func Coupling(commits []model.Commit, opts model.Options) []CouplingResult

Coupling detects modules that tend to change together (temporal coupling).

type EntityEffortResult

type EntityEffortResult struct {
	Entity     string
	Author     string
	AuthorRevs int
	TotalRevs  int
}

func EntityEffort

func EntityEffort(commits []model.Commit, _ model.Options) []EntityEffortResult

EntityEffort returns revision count per (entity, author) pair.

type EntityOwnershipResult

type EntityOwnershipResult struct {
	Entity  string
	Author  string
	Added   int
	Deleted int
}

func EntityOwnership

func EntityOwnership(commits []model.Commit, _ model.Options) []EntityOwnershipResult

EntityOwnership returns churn per (entity, author) pair.

type FragmentationResult

type FragmentationResult struct {
	Entity    string
	Fractal   float64
	TotalRevs int
}

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 RevisionsResult struct {
	Entity string
	Revs   int
}

func Revisions

func Revisions(commits []model.Commit, _ model.Options) []RevisionsResult

Revisions counts the number of revisions for each entity.

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

type SumOfCouplingResult struct {
	Entity string
	Soc    int
}

func SumOfCoupling

func SumOfCoupling(commits []model.Commit, opts model.Options) []SumOfCouplingResult

SumOfCoupling aggregates coupling counts per entity (how many co-changes it participates in).

type SummaryResult

type SummaryResult struct {
	Commits         int
	Entities        int
	EntitiesChanged int
	Authors         int
}

func Summary

func Summary(commits []model.Commit, _ model.Options) SummaryResult

Summary computes repo-wide totals: number of commits, entities, entities changed, and authors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL