analyze

package
v0.8.0-beta.26 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package analyze derives the human-facing insights the report surfaces: the most-connected "god nodes", surprising cross-file connections, and file-level import cycles. It mirrors the intent of the Python original's analyze.py, trimmed to what the AST-only graph can support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cycle

type Cycle struct {
	Files []string
}

Cycle is a circular file-level import dependency.

func ImportCycles

func ImportCycles(g *model.Graph, maxLen, topN int) []Cycle

ImportCycles finds circular dependencies in the file-level import graph built from imports_from edges. Cycles are bounded in length and deduplicated by rotation, shortest first.

type GodNode

type GodNode struct {
	ID     string
	Label  string
	Degree int
}

GodNode is a highly-connected core abstraction.

func GodNodes

func GodNodes(g *model.Graph, topN int) []GodNode

GodNodes returns the topN most-connected real entities. File-hub nodes, external-dependency/concept nodes, and method stubs are excluded because they accumulate edges mechanically without being meaningful abstractions.

type Surprise

type Surprise struct {
	Source, Target string
	Relation       string
	Confidence     string
	SourceFiles    [2]string
	Note           string
}

Surprise is a non-obvious cross-file connection.

func Surprising

func Surprising(g *model.Graph, communities map[int][]string, topN int) []Surprise

Surprising returns up to topN cross-file edges between real entities, ranked by how non-obvious they are (AMBIGUOUS > INFERRED > EXTRACTED, with a bonus for bridging communities).

Jump to

Keyboard shortcuts

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