Documentation
¶
Overview ¶
Package staranalysis provides combined analysis of Starlark source files, combining stats, complexity scoring, indexing, and hotspot detection.
Index ¶
Constants ¶
const (
Analyze op.ActionName = "staranalysis.analyze"
)
Action-name constants for the staranalysis provider's plan-mode actions.
Each constant is the short dotted action label its method dispatches under. Pass these to plan.Plan, op.ReceiverRegistry().BuildAction, RuntimeEnvironment.ActionByName, or WithActionNamed in place of a string literal so a typo is a compile error and rename / find-references work through the constant.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalysisConfig ¶
type AnalysisConfig struct {
Hotspots bool
CyclomaticThreshold int // default 10
CognitiveThreshold int // default 15
WithIndex bool
}
AnalysisConfig controls what the Analyze function produces.
type AnalysisReport ¶
type AnalysisReport struct {
Stats *starstats.Stats
Complexity *starcomplexity.ComplexityReport
Hotspots []Hotspot
Index *starindex.Index // nil unless WithIndex
}
AnalysisReport combines stats, complexity, hotspots, and optionally index.
type Provider ¶
type Provider struct {
op.ProviderBase
Root string
}
Provider provides combined analysis of Starlark source files, combining stats, complexity scoring, indexing, and hotspot detection.
func NewProvider ¶
func NewProvider(ctx *op.RuntimeEnvironment) *Provider
NewProvider creates a staranalysis provider bound to the given runtime environment, rooted at the environment's Root when present.
func (*Provider) Analyze ¶
func (p *Provider) Analyze(files []string, cfg AnalysisConfig) (*AnalysisReport, error)
Analyze performs a combined analysis of all files.