analysis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: GPL-3.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ModuleLanguages    = "Languages"
	ModuleContributors = "Contributors"
	ModuleGeo          = "Star Geography"
	ModuleCommitStats  = "Commit Activity"
	ModuleHeatmap      = "Commit Heatmap"
	ModuleReleases     = "Releases"
	ModuleBusFactor    = "Bus Factor"
	ModuleCommunity    = "Community Files"
	ModuleDebt         = "Issue Debt"
	ModuleNewcomer     = "Labels"
	ModuleDeps         = "Dependencies"
	ModulePRs          = "Pull Requests"
	ModuleSignals      = "Signals"
)

Module names used for progress reporting.

Variables

ModuleOrder is the display order for the loading screen.

Functions

func ParseCargoToml

func ParseCargoToml(content string) []parsed

func ParseGoMod

func ParseGoMod(content string) []parsed

func VersionOutdated

func VersionOutdated(current, latest string) bool

versionOutdated returns true if latest is strictly newer than current. Does a simple major-version check — good enough for highlighting stale deps.

Types

type CommitHeatmap

type CommitHeatmap [7][24]int

CommitHeatmap is indexed [weekday][hour], time.Sunday == 0.

type ContribEntry

type ContribEntry struct {
	Login     string
	Commits   int
	AvatarURL string
}

type DebtStat

type DebtStat struct {
	StaleIssues    int
	StalePRs       int
	OldestOpenDays int
	AvgCloseDays   float64
}

type DepEntry

type DepEntry struct {
	Name      string
	Current   string
	Latest    string
	Ecosystem string
	Outdated  bool
}

type GeoEntry

type GeoEntry struct {
	Country string
	Count   int
	Percent float64
}

type HealthFiles

type HealthFiles struct {
	HasReadme        bool
	HasLicense       bool
	HasContributing  bool
	HasCodeOfConduct bool
}

type LangEntry

type LangEntry struct {
	Name    string
	Bytes   int
	Percent float64
}

type NewcomerStat

type NewcomerStat struct {
	HasGoodFirstIssue bool
	HasHelpWanted     bool
}

func CalcNewcomer

func CalcNewcomer(labels []string) NewcomerStat

type Options

type Options struct {
	SkipGeo  bool
	SkipDeps bool
}

type PRStat

type PRStat struct {
	Open         int
	MergeRate    float64 // % of closed PRs that were merged
	AvgMergeDays float64
	Merged30d    int
	Rejected30d  int
}

func CalcPRStats

func CalcPRStats(prs []*github.PullRequest, openCount int) PRStat

type Progress

type Progress struct {
	Module string
	Err    error
}

type ReleaseEntry

type ReleaseEntry struct {
	Tag          string
	Name         string
	PublishedAt  time.Time
	IsPrerelease bool
	Downloads    int
}

type RepoSummary

type RepoSummary struct {
	Owner         string
	Repo          string
	Description   string
	Stars         int
	Forks         int
	Watchers      int
	OpenIssues    int
	License       string
	Topics        []string
	CreatedAt     time.Time
	UpdatedAt     time.Time
	IsArchived    bool
	DefaultBranch string

	Languages    []LangEntry
	Contributors []ContribEntry
	StarsByGeo   []GeoEntry

	CommitActivity []int
	CommitHeatmap  CommitHeatmap
	Releases       []ReleaseEntry
	BusFactor      int
	TotalCommits   int
	Stickiness     StickinessStat
	HealthFiles    HealthFiles
	Debt           DebtStat
	Deps           []DepEntry
	Newcomer       NewcomerStat
	PRs            PRStat
	Signals        SignalStat
}

func Run

func Run(ctx context.Context, client *api.Client, owner, repo string, opts Options, onProgress func(Progress)) (*RepoSummary, error)

type SignalStat

type SignalStat struct {
	HasCI          bool
	CIName         string
	HasTests       bool
	ActiveForks    int
	StarsThisWeek  int
	AvgWeeklyStars float64
	Trending       string // "rising", "stable", "declining"
}

func CalcSignals

func CalcSignals(
	hasWorkflows, hasCircleCI, hasTravis bool,
	hasTests bool,
	forks []*gogithub.Repository,
	recentStars []*gogithub.Stargazer,
	totalStars int,
	createdAt time.Time,
) SignalStat

type StickinessStat

type StickinessStat struct {
	OneTime   int
	Returning int
	Percent   float64
}

func CalcStickiness

func CalcStickiness(contributors []ContribEntry) StickinessStat

Jump to

Keyboard shortcuts

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