churn

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package churn implements a post-analyzer that identifies git churn hotspots by correlating commit frequency with cyclomatic complexity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeRiskScores

func ComputeRiskScores(churnCounts map[string]int, complexities map[string]float64) map[string]float64

ComputeRiskScores multiplies max-normalized churn and complexity scores. Files with zero churn always get a risk score of zero.

func ParsePeriod

func ParsePeriod(s string) (string, error)

ParsePeriod converts a short period string to a git --since argument. Accepted formats: "<N>m" for months, "<N>y" for years (e.g. "6m", "1y"). N must be a positive integer. Returns an error for any other input.

Types

type PostAnalyzer

type PostAnalyzer struct{}

PostAnalyzer identifies files that are both frequently changed (high churn) and structurally complex, making them high-risk maintenance targets.

func New

func New() *PostAnalyzer

New returns a new churn post-analyzer.

func (*PostAnalyzer) Description

func (a *PostAnalyzer) Description() string

Description returns a human-readable description.

func (*PostAnalyzer) Name

func (a *PostAnalyzer) Name() string

Name returns the analyzer name.

func (*PostAnalyzer) PostAnalyze

func (a *PostAnalyzer) PostAnalyze(project *analyzer.Project, cfg *analyzer.Config, results []*analyzer.Result) (*analyzer.Result, error)

PostAnalyze runs the churn post-analysis pass.

Jump to

Keyboard shortcuts

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