Documentation
¶
Index ¶
- type ChurnOptions
- type CohesionOptions
- type ComplexityOptions
- type DeadCodeOptions
- type DefectOptions
- type DuplicatesOptions
- type GraphOptions
- type HotspotOptions
- type Option
- type OwnershipOptions
- type PatternConfig
- type PatternError
- type RepoMapOptions
- type SATDOptions
- type Service
- func (s *Service) AnalyzeChurn(repoPath string, opts ChurnOptions) (*models.ChurnAnalysis, error)
- func (s *Service) AnalyzeCohesion(files []string, opts CohesionOptions) (*models.CohesionAnalysis, error)
- func (s *Service) AnalyzeComplexity(files []string, opts ComplexityOptions) (*models.ComplexityAnalysis, error)
- func (s *Service) AnalyzeDeadCode(files []string, opts DeadCodeOptions) (*models.DeadCodeAnalysis, error)
- func (s *Service) AnalyzeDefects(repoPath string, files []string, opts DefectOptions) (*models.DefectAnalysis, error)
- func (s *Service) AnalyzeDuplicates(files []string, opts DuplicatesOptions) (*models.CloneAnalysis, error)
- func (s *Service) AnalyzeGraph(files []string, opts GraphOptions) (*models.DependencyGraph, *models.GraphMetrics, error)
- func (s *Service) AnalyzeHotspots(repoPath string, files []string, opts HotspotOptions) (*models.HotspotAnalysis, error)
- func (s *Service) AnalyzeOwnership(repoPath string, files []string, opts OwnershipOptions) (*models.OwnershipAnalysis, error)
- func (s *Service) AnalyzeRepoMap(files []string, opts RepoMapOptions) (*models.RepoMap, error)
- func (s *Service) AnalyzeSATD(files []string, opts SATDOptions) (*models.SATDAnalysis, error)
- func (s *Service) AnalyzeTDG(path string) (*models.ProjectScore, error)
- func (s *Service) AnalyzeTemporalCoupling(repoPath string, opts TemporalCouplingOptions) (*models.TemporalCouplingAnalysis, error)
- type TDGOptions
- type TemporalCouplingOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChurnOptions ¶
ChurnOptions configures churn analysis.
type CohesionOptions ¶
CohesionOptions configures cohesion analysis.
type ComplexityOptions ¶
type ComplexityOptions struct {
IncludeHalstead bool
CyclomaticThreshold int
CognitiveThreshold int
FunctionsOnly bool
MaxFileSize int64
OnProgress func()
}
ComplexityOptions configures complexity analysis.
type DeadCodeOptions ¶
type DeadCodeOptions struct {
Confidence float64
OnProgress func()
}
DeadCodeOptions configures dead code detection.
type DefectOptions ¶
DefectOptions configures defect prediction.
type DuplicatesOptions ¶
DuplicatesOptions configures duplicate detection.
type GraphOptions ¶
type GraphOptions struct {
Scope analyzer.GraphScope
IncludeMetrics bool
OnProgress func()
}
GraphOptions configures dependency graph analysis.
type HotspotOptions ¶
HotspotOptions configures hotspot analysis.
type Option ¶
type Option func(*Service)
Option configures a Service.
func WithOpener ¶
WithOpener sets the VCS opener (for testing).
type OwnershipOptions ¶
OwnershipOptions configures ownership analysis.
type PatternConfig ¶
type PatternConfig struct {
Pattern string
Category models.DebtCategory
Severity models.Severity
}
PatternConfig defines a custom SATD pattern.
type PatternError ¶
PatternError indicates an invalid pattern.
func (*PatternError) Error ¶
func (e *PatternError) Error() string
func (*PatternError) Unwrap ¶
func (e *PatternError) Unwrap() error
type RepoMapOptions ¶
type RepoMapOptions struct {
Top int
}
RepoMapOptions configures repo map generation.
type SATDOptions ¶
type SATDOptions struct {
IncludeTests bool
StrictMode bool
CustomPatterns []PatternConfig
OnProgress func()
}
SATDOptions configures SATD analysis.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service orchestrates code analysis operations.
func (*Service) AnalyzeChurn ¶
func (s *Service) AnalyzeChurn(repoPath string, opts ChurnOptions) (*models.ChurnAnalysis, error)
AnalyzeChurn analyzes git commit history for file churn.
func (*Service) AnalyzeCohesion ¶
func (s *Service) AnalyzeCohesion(files []string, opts CohesionOptions) (*models.CohesionAnalysis, error)
AnalyzeCohesion calculates CK (Chidamber-Kemerer) OO metrics.
func (*Service) AnalyzeComplexity ¶
func (s *Service) AnalyzeComplexity(files []string, opts ComplexityOptions) (*models.ComplexityAnalysis, error)
AnalyzeComplexity runs complexity analysis on the given files.
func (*Service) AnalyzeDeadCode ¶
func (s *Service) AnalyzeDeadCode(files []string, opts DeadCodeOptions) (*models.DeadCodeAnalysis, error)
AnalyzeDeadCode detects potentially unused code.
func (*Service) AnalyzeDefects ¶
func (s *Service) AnalyzeDefects(repoPath string, files []string, opts DefectOptions) (*models.DefectAnalysis, error)
AnalyzeDefects predicts defect probability.
func (*Service) AnalyzeDuplicates ¶
func (s *Service) AnalyzeDuplicates(files []string, opts DuplicatesOptions) (*models.CloneAnalysis, error)
AnalyzeDuplicates detects code clones.
func (*Service) AnalyzeGraph ¶
func (s *Service) AnalyzeGraph(files []string, opts GraphOptions) (*models.DependencyGraph, *models.GraphMetrics, error)
AnalyzeGraph builds a dependency graph.
func (*Service) AnalyzeHotspots ¶
func (s *Service) AnalyzeHotspots(repoPath string, files []string, opts HotspotOptions) (*models.HotspotAnalysis, error)
AnalyzeHotspots identifies code hotspots (high churn + high complexity).
func (*Service) AnalyzeOwnership ¶
func (s *Service) AnalyzeOwnership(repoPath string, files []string, opts OwnershipOptions) (*models.OwnershipAnalysis, error)
AnalyzeOwnership calculates code ownership and bus factor.
func (*Service) AnalyzeRepoMap ¶
AnalyzeRepoMap generates a PageRank-ranked symbol map.
func (*Service) AnalyzeSATD ¶
func (s *Service) AnalyzeSATD(files []string, opts SATDOptions) (*models.SATDAnalysis, error)
AnalyzeSATD runs self-admitted technical debt analysis.
func (*Service) AnalyzeTDG ¶
func (s *Service) AnalyzeTDG(path string) (*models.ProjectScore, error)
AnalyzeTDG calculates Technical Debt Gradient scores.
func (*Service) AnalyzeTemporalCoupling ¶
func (s *Service) AnalyzeTemporalCoupling(repoPath string, opts TemporalCouplingOptions) (*models.TemporalCouplingAnalysis, error)
AnalyzeTemporalCoupling identifies files that frequently change together.
type TDGOptions ¶
TDGOptions configures TDG analysis.
type TemporalCouplingOptions ¶
TemporalCouplingOptions configures temporal coupling analysis.