staranalysis

package
v0.1.0-dev.20260828144100 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package staranalysis provides combined analysis of Starlark source files, combining stats, complexity scoring, indexing, and hotspot detection.

Index

Constants

View Source
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 Hotspot

type Hotspot struct {
	File       string
	Name       string
	Line       int
	Cyclomatic int
	Cognitive  int
	LOC        int
}

Hotspot identifies a function that exceeds complexity thresholds.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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