model

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Overview

internal/model/model.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AICommit added in v0.7.0

type AICommit struct {
	Hash      string     `json:"hash"`
	Author    string     `json:"author"`
	Message   string     `json:"message"`
	Signals   []AISignal `json:"signals"`
	Additions int64      `json:"additions"`
	Deletions int64      `json:"deletions"`
}

AICommit represents a single AI-attributed commit.

type AIEstimate added in v0.7.0

type AIEstimate struct {
	TotalCommits    int64      `json:"total_commits"`
	AICommits       int64      `json:"ai_commits"`
	CommitPercent   float64    `json:"commit_percent"`
	TotalAdditions  int64      `json:"total_additions"`
	AIAdditions     int64      `json:"ai_additions"`
	AdditionPercent float64    `json:"addition_percent"`
	Details         []AICommit `json:"details,omitempty"`
}

AIEstimate holds AI attribution metrics.

type AISignal added in v0.7.0

type AISignal string

AISignal represents why a commit was flagged as AI-authored.

const (
	SignalCoAuthor      AISignal = "co-author"
	SignalCommitMessage AISignal = "commit-message"
	SignalBotAuthor     AISignal = "bot-author"
)

type Filters

type Filters struct {
	Projects []string `json:"projects,omitempty"`
	Repos    []string `json:"repos,omitempty"`
	Exclude  []string `json:"exclude,omitempty"`
}

Filters records what filters were applied to the analysis.

type LanguageStats

type LanguageStats struct {
	Name       string `json:"name"`
	Files      int64  `json:"files"`
	Lines      int64  `json:"lines"`
	Code       int64  `json:"code"`
	Comments   int64  `json:"comments"`
	Blanks     int64  `json:"blanks"`
	Complexity int64  `json:"complexity"`
}

LanguageStats holds code statistics for a single language.

type PeriodSnapshot added in v0.5.0

type PeriodSnapshot struct {
	Period       string          `json:"period"`
	Repositories []RepoStats     `json:"repositories"`
	Totals       Stats           `json:"totals"`
	ByLanguage   []LanguageStats `json:"by_language"`
}

PeriodSnapshot holds stats for all repos at a single point in time.

type Repo

type Repo struct {
	Name          string
	Slug          string
	Project       string
	URL           string
	CloneURL      string
	DownloadURL   string // tarball download URL (used when git clone isn't available)
	Provider      string
	DefaultBranch string
	Archived      bool
	Fork          bool
}

Repo represents a repository from a provider.

type RepoError

type RepoError struct {
	Repository string `json:"repository"`
	Error      string `json:"error"`
}

RepoError records a repository that failed to process.

type RepoStats

type RepoStats struct {
	Repository string          `json:"repository"`
	Project    string          `json:"project,omitempty"`
	Provider   string          `json:"provider"`
	URL        string          `json:"url"`
	Languages  []LanguageStats `json:"languages"`
	Totals     Stats           `json:"totals"`
	AIEstimate *AIEstimate     `json:"ai_estimate,omitempty"`
}

RepoStats holds the analysis results for a single repository.

type Report

type Report struct {
	GeneratedAt  string          `json:"generated_at"`
	Provider     string          `json:"provider"`
	Workspace    string          `json:"workspace,omitempty"`
	Organization string          `json:"organization,omitempty"`
	Filters      Filters         `json:"filters"`
	Repositories []RepoStats     `json:"repositories"`
	Totals       Stats           `json:"totals"`
	ByLanguage   []LanguageStats `json:"by_language"`
	Errors       []RepoError     `json:"errors,omitempty"`
	AIEstimate   *AIEstimate     `json:"ai_estimate,omitempty"`
}

Report is the top-level output structure.

type Stats

type Stats struct {
	Repos      int   `json:"repos,omitempty"`
	Files      int64 `json:"files"`
	Lines      int64 `json:"lines"`
	Code       int64 `json:"code"`
	Comments   int64 `json:"comments"`
	Blanks     int64 `json:"blanks"`
	Complexity int64 `json:"complexity"`
}

Stats holds aggregate code statistics.

type TrendsReport added in v0.5.0

type TrendsReport struct {
	GeneratedAt  string           `json:"generated_at"`
	Provider     string           `json:"provider"`
	Workspace    string           `json:"workspace,omitempty"`
	Organization string           `json:"organization,omitempty"`
	Filters      Filters          `json:"filters"`
	Since        string           `json:"since"`
	Until        string           `json:"until"`
	Interval     string           `json:"interval"`
	Periods      []string         `json:"periods"`
	Snapshots    []PeriodSnapshot `json:"snapshots"`
	Errors       []RepoError      `json:"errors,omitempty"`
}

TrendsReport is the top-level output for historical trends.

Jump to

Keyboard shortcuts

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