gitanalysis

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitAnalysis

type GitAnalysis struct {
	// contains filtered or unexported fields
}

func NewGitAnalysis

func NewGitAnalysis(conf *conf.Biz, data *data.Data) *GitAnalysis

func (*GitAnalysis) AnalyzeFunctionCallRelations

func (g *GitAnalysis) AnalyzeFunctionCallRelations(dbPath string, result *dos.MrAnalysisResult) error

AnalyzeFunctionCallRelations 分析函数调用关系,为MR分析结果中的有效改动函数查找上级调用者

func (*GitAnalysis) CallDbPath

func (g *GitAnalysis) CallDbPath(name string, commit string) string

func (*GitAnalysis) ClonePath

func (g *GitAnalysis) ClonePath(name string) string

func (*GitAnalysis) CloneRepository

func (g *GitAnalysis) CloneRepository(project *gitapi.Project, branchName string) (*git.Repository, error)

CloneRepository 使用go-git库克隆或更新仓库到本地目录并切换到指定分支

func (*GitAnalysis) MRAnalyzer

func (g *GitAnalysis) MRAnalyzer(projectID, mrID int, autoNotes bool) (*dos.MrAnalysisResult, error)

func (*GitAnalysis) RepoCallGraph

func (g *GitAnalysis) RepoCallGraph(project *gitapi.Project, rootDir string) (string, error)

RepoCallGraph 对仓库进行静态分析 project 项目信息P rootDir 程序启动目录, 为空时使用克隆路径

type LLMAnalyzer

type LLMAnalyzer struct {
	// contains filtered or unexported fields
}

func NewLLMAnalyzer

func NewLLMAnalyzer(apiToken string, apiURL string, model string) (*LLMAnalyzer, error)

func (*LLMAnalyzer) AnalyzeFile

func (a *LLMAnalyzer) AnalyzeFile(ctx context.Context, fileContent string) (dos.LLMResponseList, error)

func (*LLMAnalyzer) AnalyzeMR

func (a *LLMAnalyzer) AnalyzeMR(ctx context.Context, title, content string) (string, error)

type MRAnalyzer

type MRAnalyzer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

MRAnalyzer GitLab MR分析器

func NewMRAnalyzer

func NewMRAnalyzer(conf *conf.Biz, gitlabClient *gitlab.Client) (*MRAnalyzer, error)

NewMRAnalyzer 创建新的MR分析器

func (*MRAnalyzer) AnalyzeMR

func (a *MRAnalyzer) AnalyzeMR(projectID, mrID int, autoNotes bool) (*dos.MrAnalysisResult, error)

AnalyzeMR 分析指定的MR

func (*MRAnalyzer) CreateMRNotes

func (a *MRAnalyzer) CreateMRNotes(projectID int, mrID int, result *dos.MrAnalysisResult) error

CreateMRNotes 创建MR的notes

func (*MRAnalyzer) GetMergeRequest

func (a *MRAnalyzer) GetMergeRequest(projectID, mrID int) (*gitlab.MergeRequest, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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