Documentation
¶
Overview ¶
Package history analyzes coupling/instability metrics across a sequence of git commits.
Index ¶
- type Analyzer
- func (h *Analyzer) AnalyzeCommit(ctx context.Context, sha plumbing.Hash) (*CommitMetrics, error)
- func (h *Analyzer) AnalyzeCommitFull(ctx context.Context, sha string) ([]LanguageMetrics, error)
- func (h *Analyzer) AnalyzeRange(ctx context.Context, cr *udagit.CommitRange) ([]CommitMetrics, error)
- func (h *Analyzer) CheckoutWorkspace(sha string) (string, error)
- type CommitMetrics
- type LanguageMetrics
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
Analyzer analyzes metrics across git history.
func NewAnalyzer ¶
NewAnalyzer creates a new history analyzer.
func (*Analyzer) AnalyzeCommit ¶
AnalyzeCommit analyzes a single commit and returns its metrics. Uses the cache if available.
func (*Analyzer) AnalyzeCommitFull ¶
AnalyzeCommitFull analyzes a commit and returns full metrics with dependency details. This is more expensive than AnalyzeCommit as it doesn't cache and returns full data.
func (*Analyzer) AnalyzeRange ¶
func (h *Analyzer) AnalyzeRange( ctx context.Context, cr *udagit.CommitRange, ) ([]CommitMetrics, error)
AnalyzeRange analyzes a range of commits and returns metrics for each.
type CommitMetrics ¶
type CommitMetrics struct {
SHA string `json:"sha"`
Timestamp time.Time `json:"timestamp"`
Message string `json:"message"`
Metrics []analyzer.LanguageMetricsSummary `json:"metrics"`
}
CommitMetrics holds metrics for a single commit.
type LanguageMetrics ¶
type LanguageMetrics struct {
Language string `json:"language"`
Metrics []analyzer.Metrics `json:"metrics"`
}
LanguageMetrics holds full metrics for a language, including detailed coupling stats.
type Workspace ¶
type Workspace struct {
// contains filtered or unexported fields
}
Workspace manages a cloned copy of the repository for checkout operations.
func NewWorkspace ¶
func NewWorkspace(originalRepo *udagit.Repository, workspacePath string) (*Workspace, error)
NewWorkspace creates a workspace by cloning the original repository to the given path. If the workspace already exists, it opens the existing clone.