explore

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package explore provides a fast, structured overview of a repository. No LLM calls — purely static analysis combining file stats, language breakdown, top symbols by call frequency, dead code summary, and packages.

Index

Constants

View Source
const HintApproxExploreHealth = "Overview score — excludes dependency-freshness and vulnerability penalties; " +
	"run code_health for the full vuln/freshness-adjusted score."

HintApproxExploreHealth is the caveat attached to HealthSummary values produced by the explore tool. The overview score omits dependency-freshness and vulnerability penalties (those require the freshness scanner, which explore does not run). The score may therefore be higher than the full code_health score.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitSummary

type CommitSummary struct {
	Hash    string `json:"hash"`
	Message string `json:"message"`
	Date    string `json:"date"`
	Files   int    `json:"files_changed"`
}

CommitSummary is a compact view of a recent git commit.

type CommunityCluster

type CommunityCluster struct {
	ID      int      `json:"id"`
	Size    int      `json:"size"`
	Symbols []string `json:"symbols"`
}

CommunityCluster describes one community by its top members.

type CommunityOverview

type CommunityOverview struct {
	Count    int                `json:"count"`
	Clusters []CommunityCluster `json:"clusters"`
}

CommunityOverview summarizes Louvain community detection results.

type CoupledSummary

type CoupledSummary struct {
	FileA     string `json:"file_a"`
	FileB     string `json:"file_b"`
	CoChanges int    `json:"co_changes"`
}

CoupledSummary is a pair of files that frequently change together.

type DeadCodeSummary

type DeadCodeSummary struct {
	Count   int      `json:"count"`
	Samples []string `json:"samples"`
}

DeadCodeSummary is a compact view of dead code findings.

type DepEntry

type DepEntry struct {
	Package string `json:"package"`
	Count   int    `json:"count"`
}

DepEntry is a package with an associated count.

type DepHighlights

type DepHighlights struct {
	ExternalDeps int        `json:"external_deps"`
	TopFanIn     []DepEntry `json:"top_fan_in,omitempty"`
	TopFanOut    []DepEntry `json:"top_fan_out,omitempty"`
	HasCycles    bool       `json:"has_cycles"`
}

DepHighlights is a compact dependency summary for explore results.

type HealthSummary

type HealthSummary struct {
	Score       int    `json:"score"`
	Grade       string `json:"grade"`
	Approximate bool   `json:"approximate,omitempty"`
	Hint        string `json:"hint,omitempty"`
}

HealthSummary is a lightweight code quality score for explore results.

type Input

type Input struct {
	Root     string
	Language string
	Focus    string
}

Input configures the exploration.

type LanguageStat

type LanguageStat struct {
	Name  string  `json:"name"`
	Files int     `json:"files"`
	Ratio float64 `json:"ratio"`
}

LanguageStat holds file count and ratio for a detected language.

type OxCodesHealthChecks

type OxCodesHealthChecks struct {
	TodoCount       int `json:"todo_count,omitempty"`
	UnhandledErrors int `json:"unhandled_errors,omitempty"`
	MagicNumbers    int `json:"magic_numbers_in_functions,omitempty"`
}

OxCodesHealthChecks holds additional quality indicators from ox-codes scoped search.

func RunOxCodesHealthChecks

func RunOxCodesHealthChecks(ctx context.Context, client *oxcodes.Client, root, language string) *OxCodesHealthChecks

RunOxCodesHealthChecks runs additional quality checks via ox-codes scoped search. Returns nil when client is nil or all checks fail.

type Result

type Result struct {
	ReadmeExcerpt string             `json:"readme_excerpt,omitempty"`
	FocusMode     string             `json:"focus_mode,omitempty"`
	FileCount     int                `json:"file_count"`
	SymbolCount   int                `json:"symbol_count"`
	TotalLines    int                `json:"total_lines"`
	Languages     []LanguageStat     `json:"languages"`
	TopSymbols    []SymbolSummary    `json:"top_symbols"`
	DeadCode      *DeadCodeSummary   `json:"dead_code,omitempty"`
	Communities   *CommunityOverview `json:"communities,omitempty"`
	Packages      []string           `json:"packages"`
	DepHighlights *DepHighlights     `json:"dep_highlights,omitempty"`
	Health        *HealthSummary     `json:"health,omitempty"`
	Tier          string             `json:"tier,omitempty"`
	Backend       string             `json:"backend,omitempty"`
	RecentCommits []CommitSummary    `json:"recent_commits,omitempty"`
	TopCoupled    []CoupledSummary   `json:"top_coupled_files,omitempty"`
}

Result is the structured output of an exploration.

func Run

func Run(ctx context.Context, input Input) (*Result, error)

Run performs a fast, structured overview of the repository at input.Root.

type SymbolSummary

type SymbolSummary struct {
	Name      string `json:"name"`
	Kind      string `json:"kind"`
	File      string `json:"file"`
	CallCount int    `json:"call_count"`
}

SymbolSummary describes a symbol and how often it is called.

Jump to

Keyboard shortcuts

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