starcomplexity

package
v0.1.0-dev.20260908173415 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package starcomplexity computes cyclomatic and cognitive complexity metrics for Starlark source files.

Index

Constants

View Source
const (
	ComputeComplexity op.ActionName = "starcomplexity.compute_complexity"
)

Action-name constants for the starcomplexity 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 ComplexityReport

type ComplexityReport struct {
	Files []FileComplexity
}

ComplexityReport holds complexity results for all analyzed files.

type FileComplexity

type FileComplexity struct {
	Path      string
	Functions []FunctionComplexity
}

FileComplexity holds complexity results for a single file.

type FunctionComplexity

type FunctionComplexity struct {
	Name       string
	Line       int
	Cyclomatic int
	Cognitive  int
	MaxNesting int
	LOC        int
	Params     int
}

FunctionComplexity holds complexity metrics for a single function.

type Provider

type Provider struct {
	op.ProviderBase
	Root string
}

Provider computes cyclomatic and cognitive complexity metrics for Starlark source files.

func NewProvider

func NewProvider(ctx *op.RuntimeEnvironment) *Provider

NewProvider creates a starcomplexity provider bound to the given runtime environment, rooted at the environment's Root when present.

func (*Provider) ComputeComplexity

func (p *Provider) ComputeComplexity(files []string) (*ComplexityReport, error)

ComputeComplexity analyzes the given files for function complexity.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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