trends

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderJSON

func RenderJSON(snapshots []Snapshot) (string, error)

func RenderTerminal

func RenderTerminal(snapshots []Snapshot) string

func Sparkline

func Sparkline(values []float64) string

func SparklineInt

func SparklineInt(values []int) string

func Store

func Store(dir string, snap Snapshot) error

func TrendArrow

func TrendArrow(d Delta) string

Types

type ContributorSnap

type ContributorSnap struct {
	Name    string `json:"name"`
	Commits int    `json:"commits"`
}

type Delta

type Delta struct {
	Version string
	Change  float64
	Percent float64
}

func ComputeDelta

func ComputeDelta(prev, curr float64) Delta

type RenderOptions

type RenderOptions struct {
	Count int
}

type Snapshot

type Snapshot struct {
	Version                          string            `json:"version"`
	Date                             string            `json:"date"`
	TotalCommits                     int               `json:"total_commits"`
	TotalAuthors                     int               `json:"total_authors"`
	BreakingChanges                  int               `json:"breaking_changes"`
	ReleaseContributionConcentration int               `json:"release_contribution_concentration"`
	ReleaseCommitSpanHours           float64           `json:"release_commit_span_hours"`
	ReleaseAgeHours                  float64           `json:"release_age_hours"`
	CommitsPerDay                    float64           `json:"commits_per_day"`
	ConventionalRatio                float64           `json:"conventional_ratio"`
	OwnershipEntropy                 float64           `json:"ownership_entropy"`
	OwnershipConc                    float64           `json:"ownership_conc"`
	TechDebtUSD                      float64           `json:"tech_debt_usd"`
	HotspotScore                     float64           `json:"hotspot_score"`
	HotspotDensity                   float64           `json:"hotspot_density"`
	ReleaseRiskScore                 float64           `json:"release_risk_score"`
	NetLines                         int               `json:"net_lines"`
	LinesAdded                       int               `json:"lines_added"`
	LinesDeleted                     int               `json:"lines_deleted"`
	FilesTouched                     int               `json:"files_touched"`
	JiraTickets                      int               `json:"jira_tickets"`
	ChurnFactor                      float64           `json:"churn_factor"`
	ComplexityPerFeat                float64           `json:"complexity_per_feat"`
	FixToFeatureRatio                float64           `json:"fix_to_feature_ratio"`
	TestToSourceRatio                float64           `json:"test_to_source_ratio"`
	RefactoringRatio                 float64           `json:"refactoring_ratio"`
	APISurfaceChange                 int               `json:"api_surface_change"`
	BatchFactor                      float64           `json:"batch_factor"`
	RevertRate                       float64           `json:"revert_rate"`
	ScopeIsolation                   float64           `json:"scope_isolation"`
	CrossCuttingPct                  float64           `json:"cross_cutting_pct"`
	FileVolatility                   float64           `json:"file_volatility"`
	ChangeComplexityProxy            float64           `json:"change_complexity_proxy"`
	CrossCuttingChangeRisk           float64           `json:"cross_cutting_change_risk"`
	TouchedTestFileRatio             float64           `json:"touched_test_file_ratio"`
	CommitSizeSmall                  int               `json:"commit_size_small"`
	CommitSizeMedium                 int               `json:"commit_size_medium"`
	CommitSizeLarge                  int               `json:"commit_size_large"`
	CommitSizeHuge                   int               `json:"commit_size_huge"`
	ReviewLoad                       float64           `json:"review_load"`
	DeleteRatio                      float64           `json:"delete_ratio"`
	CommitMsgQuality                 float64           `json:"commit_msg_quality"`
	AuthorOverlap                    float64           `json:"author_overlap"`
	PeakHourSpread                   float64           `json:"peak_hour_spread"`
	DirectoryBreadth                 float64           `json:"directory_breadth"`
	ConfigChurnRate                  float64           `json:"config_churn_rate"`
	CodeFreshness                    float64           `json:"code_freshness"`
	RhythmConsistency                float64           `json:"rhythm_consistency"`
	ReleaseCadenceDays               int               `json:"release_cadence_days"`
	DepUpdateFreq                    float64           `json:"dep_update_freq"`
	LanguageMix                      float64           `json:"language_mix"`
	TypeCounts                       map[string]int    `json:"type_counts"`
	SignificanceCounts               map[string]int    `json:"significance_counts"`
	TopContributors                  []ContributorSnap `json:"top_contributors"`

	// Read-only compatibility for snapshots written before proxy metrics were
	// named honestly. New snapshots omit these fields.
	LegacyBusFactor            int     `json:"bus_factor,omitempty"`
	LegacyCycleTimeHours       float64 `json:"cycle_time_hours,omitempty"`
	LegacyCognitiveComplexity  float64 `json:"cognitive_complexity,omitempty"`
	LegacyCyclicDependencyRisk float64 `json:"cyclic_dependency_risk,omitempty"`
	LegacyTestCoverageNewCode  float64 `json:"test_coverage_new_code,omitempty"`
}

func Load

func Load(dir string, count int) ([]Snapshot, error)

func LoadAll

func LoadAll(dir string) ([]Snapshot, error)

Jump to

Keyboard shortcuts

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