deadcode

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

Documentation

Overview

Package deadcode runs a language's DeadCodeDetector across a diff's changed files and produces the "Dead Code" report section.

The per-language detection logic (AST/CST walk, reference counting) lives in the language back-end (for Go: internal/lang/goanalyzer/deadcode.go; for TypeScript: internal/lang/tsanalyzer/deadcode.go). This package is a thin orchestrator: it iterates over changed files, calls the detector on each, and formats the resulting unused-symbol list.

Dead-code findings are reported as WARN (not FAIL) because the detector is conservative but not omniscient — symbols can be referenced via reflection, framework registration, or codegen the detector can't see. Treating them as warnings nudges the human to verify rather than blocking the build outright.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze

func Analyze(repoPath string, d *diff.Result, detector lang.DeadCodeDetector) (report.Section, error)

Analyze runs detector across every file in d and returns the "Dead Code" report section. detector == nil produces a PASS section with a summary noting that the language has no detector wired up — useful as a hedge when adding the feature to languages incrementally.

Types

This section is empty.

Jump to

Keyboard shortcuts

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