Help us shape the future of Go! Take the 2026 Go Developer Survey

graph

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package graph builds a dependency graph and computes PageRank.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCallGraph added in v1.2.0

func BuildCallGraph(fileInfos []model.FileInfo) []model.CallEdge

BuildCallGraph builds function-level call edges from the parsed file infos. An edge is only included when the callee is a known definition in the repo and the caller (Enclosing) is non-empty. Edges are deduplicated and sorted.

func BuildCallSites added in v1.2.0

func BuildCallSites(fileInfos []model.FileInfo) []model.CallSite

BuildCallSites returns all individual call and import occurrences with source locations. Unlike BuildCallGraph, it does not deduplicate: if a function calls another three times, three CallSite entries are returned. Module-level import references (where no enclosing function exists) are included with Caller set to "<import>". Intended for focused (--symbol / --file) queries where precise line numbers matter.

func BuildGraph

func BuildGraph(fileInfos []model.FileInfo) []model.Dependency

BuildGraph creates dependency edges from cross-file symbol references. Returns a list of dependencies suitable for the RepoMap.

func Rank

func Rank(fileInfos []model.FileInfo, deps []model.Dependency)

Rank applies PageRank to file_infos and sorts them by rank descending.

Types

This section is empty.

Jump to

Keyboard shortcuts

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