Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeGoComplexity ¶
ComputeGoComplexity parses Go source and returns cyclomatic complexity per function. Key: function name (or Receiver.Method for methods). Value: complexity.
func ParseCoverProfile ¶
ParseCoverProfile parses a Go coverage profile and returns coverage as 0.0-1.0.
Types ¶
type CodeMetrics ¶
type CodeMetrics struct {
TotalLines int `json:"total_lines"`
BlankLines int `json:"blank_lines"`
CommentLines int `json:"comment_lines"`
CodeLines int `json:"code_lines"`
TodoCount int `json:"todo_count"`
Complexity int `json:"complexity"`
}
CodeMetrics holds basic code metrics for a file or symbol.
func ComputeMetrics ¶
func ComputeMetrics(src string) CodeMetrics
ComputeMetrics computes basic code metrics from source text.
func ComputeSymbolMetrics ¶
func ComputeSymbolMetrics(src, symbol string) CodeMetrics
ComputeSymbolMetrics computes metrics for a specific symbol within Go source. If the symbol isn't found, falls back to file-level metrics.
func (CodeMetrics) ToEvidence ¶
func (m CodeMetrics) ToEvidence() domain.Evidence
ToEvidence converts CodeMetrics to a domain.Evidence.
type GitStats ¶
type GitStats struct {
CommitCount int `json:"commit_count"`
AuthorCount int `json:"author_count"`
AgeDays int `json:"age_days"`
}
GitStats holds parsed git history data for a file.
func ParseGitLog ¶
ParseGitLog parses tab-separated git log output (hash\tauthor\tdate).
func ParseGitLogWithAge ¶
ParseGitLogWithAge parses git log output and computes age from the earliest date.
func (GitStats) ToEvidence ¶
ToEvidence converts GitStats to a domain.Evidence.
type LintFinding ¶
type LintFinding struct {
File string `json:"file"`
Line int `json:"line"`
Message string `json:"message"`
Severity string `json:"severity"`
Rule string `json:"rule,omitempty"`
}
LintFinding represents a single lint finding.
type LintResult ¶
type LintResult struct {
Tool string `json:"tool"`
ErrorCount int `json:"error_count"`
WarnCount int `json:"warn_count"`
Findings []LintFinding `json:"findings,omitempty"`
}
LintResult holds aggregated lint results.
func ParseGoVet ¶
func ParseGoVet(stderr string, exitCode int) LintResult
ParseGoVet parses go vet stderr output into a LintResult.
func ParseGolangciLintJSON ¶
func ParseGolangciLintJSON(output string) LintResult
ParseGolangciLintJSON parses golangci-lint JSON output into a LintResult.
func (LintResult) ToEvidence ¶
func (r LintResult) ToEvidence() domain.Evidence
ToEvidence converts LintResult to a domain.Evidence.
type TestResult ¶
type TestResult struct {
Tool string `json:"tool"`
TotalCount int `json:"total_count"`
PassedCount int `json:"passed_count"`
FailedCount int `json:"failed_count"`
SkipCount int `json:"skip_count"`
Coverage float64 `json:"coverage"` // 0.0–1.0
}
TestResult holds aggregated test execution results.
func ParseGoTestJSON ¶
func ParseGoTestJSON(output string) TestResult
ParseGoTestJSON parses `go test -json` output into a TestResult.
func (TestResult) ToEvidence ¶
func (r TestResult) ToEvidence() domain.Evidence
ToEvidence converts TestResult to a domain.Evidence.
type ToolExecutor ¶
type ToolExecutor struct {
// contains filtered or unexported fields
}
ToolExecutor runs external tools and collects evidence.
func NewToolExecutor ¶
func NewToolExecutor(root string) *ToolExecutor
NewToolExecutor creates a tool executor rooted at the given directory.
func (*ToolExecutor) CollectAll ¶
func (te *ToolExecutor) CollectAll() []domain.Evidence
CollectAll runs all available tool runners and returns collected evidence.
func (*ToolExecutor) HasGoMod ¶
func (te *ToolExecutor) HasGoMod() bool
HasGoMod returns true if the root directory contains a go.mod file.
func (*ToolExecutor) HasPackageJSON ¶
func (te *ToolExecutor) HasPackageJSON() bool
HasPackageJSON returns true if the root has a package.json.