analyzer

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package analyzer provides the core analysis pipeline for external use. This is a library-friendly version without CLI dependencies (no spinner, color, cache).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGitRepos

func FindGitRepos(root string, maxDepth int) ([]string, error)

FindGitRepos walks a directory tree up to maxDepth and returns paths containing .git.

func ResolveRepoDomain

func ResolveRepoDomain(ctx context.Context, repoPath, repoName string, cfg *config.Config) domain.Domain

ResolveRepoDomain determines the domain for a repo.

Types

type Callbacks

type Callbacks struct {
	OnRepoStart     func(repoName string, d domain.Domain)
	OnRepoSkipped   func(repoName, reason string)
	OnBlameProgress ProgressFunc
	OnDebtProgress  ProgressFunc
	OnVerbose       func(msg string)
}

Callbacks allows callers to hook into pipeline progress.

type DomainResults

type DomainResults struct {
	Domain    domain.Domain
	Results   []scorer.Result
	Risks     []metric.ModuleRisk
	RepoCount int
	PerRepo   []RepoResult

	// Module Topology (3-axis)
	Cochange       metric.CochangeResult
	Ownership      []metric.ModuleOwnership
	ModuleSurvival map[string]float64 // module → survival rate (0-1)
}

DomainResults holds scored results for a single domain.

func Run

func Run(opts Options, repoPaths []string, cfg *config.Config, cb *Callbacks) ([]DomainResults, error)

Run executes the full analysis pipeline on the given repository paths.

type Options

type Options struct {
	Tau          float64
	SampleSize   int
	Workers      int
	PressureMode string // "include" or "ignore"
	ActiveDays   int
	DomainFilter string
	PerRepo      bool
	CacheEnabled bool
	CacheDir     string // custom cache dir (empty = default ~/.eis/cache)
}

Options controls the analysis pipeline behavior.

type ProgressFunc

type ProgressFunc func(done, total int)

ProgressFunc is called with (done, total) during long-running operations.

type RepoResult

type RepoResult struct {
	RepoName       string
	Domain         domain.Domain
	Results        []scorer.Result
	Cochange       metric.CochangeResult
	Ownership      []metric.ModuleOwnership
	ModuleSurvival map[string]float64
}

RepoResult holds scored results for a single repository.

Jump to

Keyboard shortcuts

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