Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalysisConfig ¶
type AnalysisConfig struct {
Complexity bool `koanf:"complexity"`
SATD bool `koanf:"satd"`
DeadCode bool `koanf:"dead_code"`
Churn bool `koanf:"churn"`
Duplicates bool `koanf:"duplicates"`
Defect bool `koanf:"defect"`
TDG bool `koanf:"tdg"`
Graph bool `koanf:"graph"`
LintHotspot bool `koanf:"lint_hotspot"`
Context bool `koanf:"context"`
ChurnDays int `koanf:"churn_days"`
}
AnalysisConfig controls which analyzers run.
type CacheConfig ¶
type CacheConfig struct {
Enabled bool `koanf:"enabled"`
Dir string `koanf:"dir"`
TTL int `koanf:"ttl"` // TTL in hours
}
CacheConfig controls caching behavior.
type Config ¶
type Config struct {
// Analysis settings
Analysis AnalysisConfig `koanf:"analysis"`
// Thresholds for various metrics
Thresholds ThresholdConfig `koanf:"thresholds"`
// Duplicate detection settings
Duplicates DuplicateConfig `koanf:"duplicates"`
// File exclusion patterns
Exclude ExcludeConfig `koanf:"exclude"`
// Cache settings
Cache CacheConfig `koanf:"cache"`
// Output settings
Output OutputConfig `koanf:"output"`
}
Config holds all configuration options for omen.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a config with sensible defaults.
func LoadOrDefault ¶
func LoadOrDefault() *Config
LoadOrDefault tries to load config from standard locations or returns defaults.
func (*Config) ShouldExclude ¶
ShouldExclude checks if a path should be excluded from analysis.
type DuplicateConfig ¶
type DuplicateConfig struct {
MinTokens int `koanf:"min_tokens"`
SimilarityThreshold float64 `koanf:"similarity_threshold"`
ShingleSize int `koanf:"shingle_size"`
NumHashFunctions int `koanf:"num_hash_functions"`
NumBands int `koanf:"num_bands"`
RowsPerBand int `koanf:"rows_per_band"`
NormalizeIdentifiers bool `koanf:"normalize_identifiers"`
NormalizeLiterals bool `koanf:"normalize_literals"`
IgnoreComments bool `koanf:"ignore_comments"`
MinGroupSize int `koanf:"min_group_size"`
}
DuplicateConfig defines duplicate detection settings (pmat-compatible).
type ExcludeConfig ¶
type ExcludeConfig struct {
Patterns []string `koanf:"patterns"`
Extensions []string `koanf:"extensions"`
Dirs []string `koanf:"dirs"`
Gitignore bool `koanf:"gitignore"`
}
ExcludeConfig defines file exclusion patterns.
type OutputConfig ¶
type OutputConfig struct {
Format string `koanf:"format"` // text, json, markdown
Color bool `koanf:"color"`
Verbose bool `koanf:"verbose"`
}
OutputConfig controls output formatting.
type ThresholdConfig ¶
type ThresholdConfig struct {
CyclomaticComplexity int `koanf:"cyclomatic_complexity"`
CognitiveComplexity int `koanf:"cognitive_complexity"`
DuplicateMinLines int `koanf:"duplicate_min_lines"`
DuplicateSimilarity float64 `koanf:"duplicate_similarity"`
DeadCodeConfidence float64 `koanf:"dead_code_confidence"`
DefectHighRisk float64 `koanf:"defect_high_risk"`
TDGHighRisk float64 `koanf:"tdg_high_risk"`
}
ThresholdConfig defines metric thresholds.
Click to show internal directories.
Click to hide internal directories.