analyzer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

internal/analyzer/analyzer.go

internal/analyzer/clone.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct{}

Analyzer wraps scc's processor package to analyze source code directories.

func New

func New() *Analyzer

New creates a new Analyzer instance. It ensures that scc's ProcessConstants is called exactly once, even when multiple goroutines create analyzers concurrently.

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(ctx context.Context, dir string) (*model.RepoStats, error)

Analyze walks the given directory, detects languages, and returns aggregated code statistics per language.

type Cloner

type Cloner struct {
	// contains filtered or unexported fields
}

Cloner performs shallow git clones into temporary directories.

func NewCloner

func NewCloner(token string) *Cloner

NewCloner creates a Cloner. If token is non-empty it will be used for HTTP basic-auth (username "x-token-auth" works for GitHub and Bitbucket).

func (*Cloner) Clone

func (c *Cloner) Clone(ctx context.Context, cloneURL string) (dir string, cleanup func(), err error)

Clone shallow-clones the repository at cloneURL into a temporary directory. It returns the directory path, a cleanup function that removes the directory, and any error. The caller must call cleanup when done with the directory.

Jump to

Keyboard shortcuts

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