sizes

package
v0.0.0-...-527d7fd Latest Latest
Warning

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

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

Documentation

Overview

Package sizes reports function and file line counts for diff-scoped files using a language-supplied lang.FunctionExtractor. The per-language AST work lives in the language back-end (for Go: goanalyzer/sizes.go).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze

func Analyze(repoPath string, d *diff.Result, funcThreshold, fileThreshold int, tol DeltaTolerances, extractor lang.FunctionExtractor) (report.Section, error)

Analyze measures lines of code for changed functions and files using the supplied language extractor.

Types

type DeltaTolerances

type DeltaTolerances struct {
	FuncLines      int
	FilePct        int
	FileFloorLines int
}

DeltaTolerances captures the size deltas that diff mode is willing to forgive. A function whose line count grew by FuncLines or fewer is dropped. A file is dropped when its line growth is within max(FileFloorLines, base * FilePct%) — percentage scales with file size so adding 50 lines to a 5000-line file is forgiven while the same growth on a 500-line file is flagged. A zero-value DeltaTolerances acts as strict gating (all growth flagged) to preserve the pre-tolerance default.

Jump to

Keyboard shortcuts

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