complexity

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: 9 Imported by: 0

Documentation

Overview

Package complexity runs a language's ComplexityCalculator across a diff's changed files and formats the results into a report.Section.

All AST-level work happens in the language back-end (for Go: internal/lang/goanalyzer/complexity.go). This package is now a thin orchestrator — threshold check, severity derivation, per-language stats summary — so new languages inherit the analyzer for free by implementing lang.ComplexityCalculator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze

func Analyze(repoPath string, d *diff.Result, threshold, deltaTolerance int, calc lang.ComplexityCalculator) (report.Section, error)

Analyze computes cognitive complexity for all functions in the diff's changed regions using the supplied language calculator, then produces the "Cognitive Complexity" report section. Parse errors are swallowed at the calculator layer (returning nil) so a single malformed file doesn't fail the whole run.

Types

This section is empty.

Jump to

Keyboard shortcuts

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