Documentation
¶
Overview ¶
internal/model/model.go
Index ¶
- type AICommit
- type AIEstimate
- type AISignal
- type ChurnStats
- type EcosystemDeps
- type FileChurn
- type Filters
- type HealthCategory
- type HealthCategorySummary
- type HealthSummary
- type LanguageStats
- type PeriodSnapshot
- type Repo
- type RepoError
- type RepoHealth
- type RepoHealthDetails
- type RepoStats
- type Report
- type SBOMAggregate
- type SBOMReport
- type SecretsAggregate
- type SecretsReport
- type Stats
- type TrendsReport
- type WindowChurnStats
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.
type ChurnStats ¶ added in v0.8.0
type ChurnStats struct {
TotalCommits int64 `json:"total_commits"`
TopFiles []FileChurn `json:"top_files"`
Hotspots []FileChurn `json:"hotspots,omitempty"`
}
ChurnStats holds code churn and hotspot data for a repository.
type EcosystemDeps ¶ added in v0.10.0
EcosystemDeps holds dependency count for a single package ecosystem.
type FileChurn ¶ added in v0.8.0
type FileChurn struct {
Path string `json:"path"`
Changes int64 `json:"changes"`
Additions int64 `json:"additions"`
Deletions int64 `json:"deletions"`
Complexity int64 `json:"complexity,omitempty"`
Hotspot float64 `json:"hotspot,omitempty"`
}
FileChurn holds churn metrics for a single file.
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 HealthCategory ¶ added in v0.8.0
type HealthCategory string
HealthCategory classifies a repository's activity level.
const ( HealthActive HealthCategory = "active" HealthMaintained HealthCategory = "maintained" HealthAbandoned HealthCategory = "abandoned" HealthFailed HealthCategory = "failed" )
type HealthCategorySummary ¶ added in v0.8.0
type HealthCategorySummary struct {
Repos int `json:"repos"`
Code int64 `json:"code"`
CodePercent float64 `json:"code_percent"`
}
HealthCategorySummary aggregates repos and code for a health category.
type HealthSummary ¶ added in v0.8.0
type HealthSummary struct {
Active HealthCategorySummary `json:"active"`
Maintained HealthCategorySummary `json:"maintained"`
Abandoned HealthCategorySummary `json:"abandoned"`
Failed HealthCategorySummary `json:"failed"`
}
HealthSummary holds aggregate health data across all repos.
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 RepoHealth ¶ added in v0.8.0
type RepoHealth struct {
Category HealthCategory `json:"category"`
LastCommitDate string `json:"last_commit_date"`
DaysSinceCommit int `json:"days_since_commit"`
Error string `json:"error,omitempty"`
}
RepoHealth holds the health classification for a repository.
type RepoHealthDetails ¶ added in v0.8.0
type RepoHealthDetails struct {
AuthorsByWindow map[string]int `json:"authors_by_window,omitempty"`
ChurnByWindow map[string]WindowChurnStats `json:"churn_by_window,omitempty"`
BusFactor float64 `json:"bus_factor"`
VelocityTrend float64 `json:"velocity_trend"`
}
RepoHealthDetails holds deep health analysis for a repository.
type RepoStats ¶
type RepoStats struct {
Repository string `json:"repository"`
Project string `json:"project,omitempty"`
Provider string `json:"provider"`
URL string `json:"url"`
License string `json:"license,omitempty"`
Languages []LanguageStats `json:"languages"`
Totals Stats `json:"totals"`
FilteredFiles int64 `json:"filtered_files,omitempty"`
Churn *ChurnStats `json:"churn,omitempty"`
AIEstimate *AIEstimate `json:"ai_estimate,omitempty"`
Health *RepoHealth `json:"health,omitempty"`
HealthDetails *RepoHealthDetails `json:"health_details,omitempty"`
Secrets *SecretsReport `json:"secrets,omitempty"`
SBOM *SBOMReport `json:"sbom,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"`
HealthSummary *HealthSummary `json:"health_summary,omitempty"`
SecretsSummary *SecretsAggregate `json:"secrets_summary,omitempty"`
SBOMSummary *SBOMAggregate `json:"sbom_summary,omitempty"`
}
Report is the top-level output structure.
type SBOMAggregate ¶ added in v0.10.0
type SBOMAggregate struct {
TotalDeps int `json:"total_deps"`
ReposWithDeps int `json:"repos_with_deps"`
Ecosystems []EcosystemDeps `json:"ecosystems,omitempty"`
}
SBOMAggregate holds aggregate dependency data across all repos.
type SBOMReport ¶ added in v0.10.0
type SBOMReport struct {
TotalDeps int `json:"total_deps"`
Ecosystems []EcosystemDeps `json:"ecosystems,omitempty"`
}
SBOMReport holds dependency inventory for a single repository.
type SecretsAggregate ¶ added in v0.9.0
type SecretsAggregate struct {
TotalFindings int `json:"total_findings"`
ReposWithSecrets int `json:"repos_with_secrets"`
}
SecretsAggregate holds aggregate secret scanning data across all repos.
type SecretsReport ¶ added in v0.9.0
type SecretsReport struct {
FindingsCount int `json:"findings_count"`
FilesWithSecrets []string `json:"files_with_secrets,omitempty"`
}
SecretsReport holds secret scanning results for a single repository.
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"`
FilteredFiles int64 `json:"filtered_files,omitempty"`
}
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.