Documentation
¶
Index ¶
- Variables
- func BuildCloneGroups(duplChan <-chan syntax.Match) map[string][][]*syntax.Node
- func ComputeUniqueCounts(groups map[string][][]*syntax.Node) map[string]int
- func EliminateOverlaps(groups map[string][][]*syntax.Node) map[string][][]*syntax.Node
- func ExtractSortCriteria(sortBy ...config.SortCriteria) config.SortCriteria
- func GetCloneSize(group [][]*syntax.Node) int
- func NodesToGroup(fread ReadFile, hash string, dups [][]*syntax.Node) (domain.ProcessedCloneGroup, error)
- func PrintDiffText(w io.Writer, report DiffReport) error
- func ProcessClones(fread ReadFile, dups [][]*syntax.Node) ([]domain.ProcessedClone, error)
- func SortCloneGroupKeys(keys []string, sortBy config.SortCriteria, groups map[string][][]*syntax.Node, ...)
- func SortCloneGroups(groups []CloneGroup, sortBy config.SortCriteria)
- func SortGroupClones(group domain.ProcessedCloneGroup, sortBy ...config.SortCriteria) []domain.ProcessedClone
- func SortProcessedClonesByCriteria(clones []domain.ProcessedClone, sortBy config.SortCriteria)
- func ToCloneNodeSeqs(dups [][]*syntax.Node) [][]*domain.CloneNode
- func WordDiff(base, compared string) string
- type CloneCategory
- type CloneClassification
- type CloneDiff
- type CloneGroup
- type CloneGroupDiff
- type CloneGroupView
- type CloneOccurrenceView
- type ClonePriority
- type CloneWithContent
- type DiffAggregateStats
- type DiffLine
- type DiffLineType
- type DiffReport
- type DiffResult
- type DiffView
- type ExplainSetter
- type FileInfo
- type GroupMetrics
- type HashSetter
- type Issue
- type Issuer
- type JSONClone
- type JSONOutput
- type JSONPrinter
- func (p *JSONPrinter) OutputJSON(threshold int, sortBy config.SortCriteria, detectionMethod string) error
- func (p *JSONPrinter) OutputSimpleJSON() error
- func (p *JSONPrinter) PrintClones(group domain.ProcessedCloneGroup, sortBy ...config.SortCriteria) error
- func (*JSONPrinter) PrintFooter() error
- func (p *JSONPrinter) PrintHeader() error
- func (p *JSONPrinter) SetFilesCount(count int)
- func (p *JSONPrinter) SetHash(hash string)
- type Printer
- func NewHTML(w io.Writer, fread ReadFile, threshold ...int) Printer
- func NewHTMLWithOptions(w io.Writer, fread ReadFile, diffMode config.DiffMode, metadata ReportMetadata, ...) Printer
- func NewJSON(w io.Writer, fread ReadFile) Printer
- func NewPlumbing(w io.Writer, fread ReadFile) Printer
- func NewSARIF(w io.Writer, fread ReadFile, threshold int) Printer
- func NewSARIFWithConfig(w io.Writer, fread ReadFile, cfg SARIFPrinterOptions) Printer
- func NewText(w io.Writer, fread ReadFile) Printer
- type ReadFile
- type ReportMetadata
- type ResolvedClone
- type RichTextSetter
- type SARIFArtifactLocation
- type SARIFConfiguration
- type SARIFDriver
- type SARIFFingerprints
- type SARIFInvocation
- type SARIFLocation
- type SARIFMessage
- type SARIFOutput
- type SARIFPhysicalLocation
- type SARIFPrinterOptions
- type SARIFRegion
- type SARIFResult
- type SARIFRule
- type SARIFRuleProperties
- type SARIFRun
- type SARIFTextContent
- type SARIFTool
- type StatsConfig
- type StatsPrinter
- type StatsView
- type Summary
- type SummaryView
- type TextPrinter
- func (p *TextPrinter) OutputText(threshold int, sortBy config.SortCriteria) error
- func (p *TextPrinter) PrintClones(group domain.ProcessedCloneGroup, sortBy ...config.SortCriteria) error
- func (p *TextPrinter) PrintFooter() error
- func (p *TextPrinter) PrintHeader() error
- func (p *TextPrinter) SetExplain(enabled bool)
- func (p *TextPrinter) SetFileDuplicate(isDupe bool)
- func (p *TextPrinter) SetHash(hash string)
- func (p *TextPrinter) SetRichText(enabled bool)
- type TopCloneGroup
Constants ¶
This section is empty.
Variables ¶
var ErrZeroLengthDuplicate = errors.New("zero length duplicate found")
ErrZeroLengthDuplicate indicates a duplicate group with no nodes was encountered.
Functions ¶
func BuildCloneGroups ¶
BuildCloneGroups builds a map of hash to clone groups from matches.
func ComputeUniqueCounts ¶
ComputeUniqueCounts calculates unique file counts for each clone group.
func EliminateOverlaps ¶ added in v0.4.0
EliminateOverlaps removes clone fragments that are fully contained within larger fragments from other groups. The suffix tree emits at every internal node, producing nested matches — a 50-token clone also yields 15-token sub-clones. This function suppresses those redundant sub-clones.
Algorithm: process fragments largest-first, accept each unless its range is strictly contained within an already-accepted fragment's range.
func ExtractSortCriteria ¶
func ExtractSortCriteria(sortBy ...config.SortCriteria) config.SortCriteria
ExtractSortCriteria extracts the sort criteria from variadic sortBy parameter. Returns SortBySize as default if no criteria is provided.
func GetCloneSize ¶
GetCloneSize returns the token count of the first clone in a group. Returns 0 if the group is empty or has no fragments.
func NodesToGroup ¶ added in v0.2.0
func NodesToGroup( fread ReadFile, hash string, dups [][]*syntax.Node, ) (domain.ProcessedCloneGroup, error)
NodesToGroup converts raw syntax.Node groups into a ProcessedCloneGroup.
func PrintDiffText ¶ added in v0.5.0
func PrintDiffText(w io.Writer, report DiffReport) error
PrintDiffText writes a human-readable diff summary to the writer.
func ProcessClones ¶ added in v0.2.0
ProcessClones converts raw syntax.Node groups into ProcessedClone slices. This is the single point where [][]*syntax.Node is decoded into domain types, eliminating the need for each printer to understand AST internals.
func SortCloneGroupKeys ¶
func SortCloneGroupKeys( keys []string, sortBy config.SortCriteria, groups map[string][][]*syntax.Node, uniqueCounts map[string]int, )
SortCloneGroupKeys sorts clone group hashes based on specified criteria.
func SortCloneGroups ¶
func SortCloneGroups(groups []CloneGroup, sortBy config.SortCriteria)
SortCloneGroups sorts CloneGroup arrays by specified criteria.
func SortGroupClones ¶ added in v0.4.0
func SortGroupClones(group domain.ProcessedCloneGroup, sortBy ...config.SortCriteria) []domain.ProcessedClone
SortGroupClones returns a sorted copy of the clones in group: it pulls group.Clones, sorts it according to the variadic sortBy, and returns the result so callers don't have to repeat the local-variable + sort dance.
func SortProcessedClonesByCriteria ¶ added in v0.2.0
func SortProcessedClonesByCriteria(clones []domain.ProcessedClone, sortBy config.SortCriteria)
SortProcessedClonesByCriteria sorts individual clones within a group. Size/TotalTokens sort by TokenCount (descending). Occurrence/Hash are group-level properties identical for every clone, so they are no-ops here; within-group ordering falls back to filename/line (see byNameAndLineProcessed).
func ToCloneNodeSeqs ¶ added in v0.4.0
ToCloneNodeSeqs converts raw syntax.Node sequences into domain.CloneNode sequences. This is the exported bridge that decouples the actionability evaluation layer from syntax.Node internals. External callers (e.g. cmd/) use this before calling EvaluateActionability.
Types ¶
type CloneCategory ¶
type CloneCategory = domain.CloneCategory
type CloneClassification ¶
type CloneClassification = domain.CloneClassification
type CloneDiff ¶
type CloneDiff struct {
CloneWithContent
Diff DiffResult
}
CloneDiff represents a clone with its diff against the base.
type CloneGroup ¶
type CloneGroupDiff ¶
type CloneGroupDiff struct {
Base *CloneWithContent
Others []CloneDiff
HasAnyDiff bool
// Aggregate statistics across all diffs in this group
TotalAdded int
TotalRemoved int
TotalModified int
}
CloneGroupDiff computes diffs between all clones in a group. Returns the base clone (first) and diffs for all other clones.
func ComputeCloneGroupDiff ¶
func ComputeCloneGroupDiff(clones []domain.ProcessedClone) CloneGroupDiff
ComputeCloneGroupDiff computes diffs for a group of clones.
type CloneGroupView ¶ added in v0.4.0
type CloneGroupView struct {
GroupNum int
Hash string
Category CloneCategory
Priority ClonePriority
HasTest bool
Occurrences int
TotalTokens int
BadgesHTML string
Suggestion string
Clones []CloneOccurrenceView
}
type CloneOccurrenceView ¶ added in v0.4.0
type ClonePriority ¶
type ClonePriority = domain.ClonePriority
type CloneWithContent ¶
CloneWithContent represents a clone with its file content.
type DiffAggregateStats ¶ added in v0.3.0
type DiffLine ¶
type DiffLine struct {
Content string
Type DiffLineType
LineNumber int // Line number in the original file
}
DiffLine represents a single line in a diff view.
type DiffLineType ¶
type DiffLineType int
DiffLineType indicates the type of diff line.
const ( DiffLineEqual DiffLineType = iota DiffLineAdded DiffLineRemoved DiffLineModified )
type DiffReport ¶ added in v0.5.0
type DiffReport struct {
New []domain.ProcessedCloneGroup `json:"new"`
Suppressed []domain.ProcessedCloneGroup `json:"suppressed"`
Resolved []ResolvedClone `json:"resolved"`
}
DiffReport partitions clone groups relative to a baseline file.
func NewDiffReport ¶ added in v0.5.0
func NewDiffReport( currentGroups []domain.ProcessedCloneGroup, bf *baseline.File, ) DiffReport
NewDiffReport computes a diff between current clone groups and a baseline. Groups present in both the current scan and the baseline are "suppressed" (previously accepted). Groups in the current scan but not in the baseline are "new". Groups in the baseline but not in the current scan are "resolved".
func (DiffReport) HasChanges ¶ added in v0.5.0
func (d DiffReport) HasChanges() bool
HasChanges returns true if any clones are new or resolved.
type DiffResult ¶
DiffResult represents the diff between two code fragments.
func LineDiff ¶
func LineDiff(base, compared []byte) DiffResult
LineDiff performs a line-by-line diff between two code fragments. It uses a simple but effective algorithm optimized for code comparison: 1. Split into lines 2. Find matching lines 3. Mark additions/removals/modifications
Size efficiency: O(n) memory, minimal allocations.
type DiffView ¶ added in v0.4.0
type DiffView struct {
GroupNum int
Base *CloneWithContent
Others []CloneDiff
AggregateStats DiffAggregateStats
}
type ExplainSetter ¶ added in v0.5.0
type ExplainSetter interface {
SetExplain(enabled bool)
}
ExplainSetter enables explanation output that describes why each clone group was reported (clone type, actionability, category, extractability).
type FileInfo ¶
FileInfo represents processed file information.
func ProcessFileContent ¶
ProcessFileContent unified file processing for all printers.
type GroupMetrics ¶ added in v0.4.0
type GroupMetrics[T any] struct { Size func(T) int Count func(T) int SortKey func(T) string // hash or filename — the ascending sort key for SortByHash }
GroupMetrics extracts the four comparable dimensions from a clone group of any concrete type. The factory uses these accessors so the sort-criteria switch lives in exactly one place.
type HashSetter ¶
type HashSetter interface {
SetHash(hash string)
}
type Issue ¶
type Issue struct {
From, To domain.ProcessedClone
}
type JSONClone ¶
type JSONClone struct {
domain.CloneRef
Category domain.CloneCategory `json:"category,omitzero"`
Priority domain.ClonePriority `json:"priority,omitzero"`
Actionability domain.CloneActionability `json:"actionability,omitzero"`
NonActionablePattern string `json:"non_actionable_pattern,omitempty"`
CloneType domain.CloneType `json:"clone_type,omitzero"`
LinesSaved int `json:"lines_saved,omitempty"`
Extractable bool `json:"extractable,omitempty"`
}
type JSONOutput ¶
type JSONOutput struct {
Version string `json:"version"`
Timestamp time.Time `json:"timestamp"`
Threshold int `json:"threshold"`
FilesAnalyzed int `json:"files_analyzed"`
DetectionMethod string `json:"detection_method,omitempty"`
CloneGroups []CloneGroup `json:"clone_groups"`
Summary Summary `json:"summary"`
}
type JSONPrinter ¶
type JSONPrinter struct {
ReadFile
// contains filtered or unexported fields
}
func (*JSONPrinter) OutputJSON ¶
func (p *JSONPrinter) OutputJSON( threshold int, sortBy config.SortCriteria, detectionMethod string, ) error
func (*JSONPrinter) OutputSimpleJSON ¶
func (p *JSONPrinter) OutputSimpleJSON() error
func (*JSONPrinter) PrintClones ¶
func (p *JSONPrinter) PrintClones( group domain.ProcessedCloneGroup, sortBy ...config.SortCriteria, ) error
func (*JSONPrinter) PrintFooter ¶
func (*JSONPrinter) PrintFooter() error
func (*JSONPrinter) PrintHeader ¶
func (p *JSONPrinter) PrintHeader() error
func (*JSONPrinter) SetFilesCount ¶
func (p *JSONPrinter) SetFilesCount(count int)
func (*JSONPrinter) SetHash ¶
func (p *JSONPrinter) SetHash(hash string)
type Printer ¶
type Printer interface {
PrintHeader() error
PrintClones(group domain.ProcessedCloneGroup, sortBy ...config.SortCriteria) error
}
func NewHTML ¶
NewHTML creates a new HTML printer. Supports optional threshold parameter (default: 15).
func NewHTMLWithOptions ¶
func NewHTMLWithOptions( w io.Writer, fread ReadFile, diffMode config.DiffMode, metadata ReportMetadata, threshold ...int, ) Printer
NewHTMLWithOptions creates a new HTML printer with full options. diffMode enables visual diff highlighting between duplicate occurrences. metadata contains CLI settings to display in the report.
func NewSARIFWithConfig ¶ added in v0.2.0
func NewSARIFWithConfig(w io.Writer, fread ReadFile, cfg SARIFPrinterOptions) Printer
NewSARIFWithConfig creates a new SARIF format printer with explicit config.
type ReadFile ¶
type ReadFile = domain.FileReaderFunc
ReadFile is an alias for domain.FileReaderFunc, the canonical file-reader function type shared across the codebase.
type ReportMetadata ¶
type ReportMetadata struct {
Semantic bool
DetectionMethods []string
SortBy string
IncludeSQLC bool
IncludeTempl bool
}
ReportMetadata contains CLI settings used for the report.
type ResolvedClone ¶ added in v0.5.0
ResolvedClone represents a clone group that existed in the baseline but is no longer detected in the current scan. It is a type alias for baseline.Entry so the diff report and the baseline format share a single shape, eliminating the duplicated struct definition.
type RichTextSetter ¶ added in v0.2.0
type RichTextSetter interface {
SetRichText(enabled bool)
}
RichTextSetter enables enhanced text output with classification badges.
type SARIFArtifactLocation ¶
type SARIFArtifactLocation struct {
URI string `json:"uri"`
}
SARIFArtifactLocation represents the artifact (file) location.
type SARIFConfiguration ¶
type SARIFConfiguration struct {
Level string `json:"level"`
}
SARIFConfiguration represents rule configuration.
type SARIFDriver ¶
type SARIFDriver struct {
Name string `json:"name"`
Version string `json:"version"`
InformationURI string `json:"informationUri"`
Rules []SARIFRule `json:"rules"`
}
SARIFDriver represents the tool driver information.
type SARIFFingerprints ¶
type SARIFFingerprints struct {
// ContentFingerprint is a hash that uniquely identifies the duplicate content.
ContentFingerprint string `json:"contentFingerprint,omitempty"`
// PartialFingerprint provides approximate matching for related content.
PartialFingerprint string `json:"partialFingerprint,omitempty"`
}
SARIFFingerprints represents fingerprints for deduplication. SARIF spec: fingerprints are short strings that can be used to relate related results.
type SARIFInvocation ¶
type SARIFInvocation struct {
ExecutionSuccessful bool `json:"executionSuccessful"`
StartTimeUTC string `json:"startTimeUtc,omitempty"`
EndTimeUTC string `json:"endTimeUtc,omitempty"`
}
SARIFInvocation represents an invocation of the tool.
type SARIFLocation ¶
type SARIFLocation struct {
PhysicalLocation SARIFPhysicalLocation `json:"physicalLocation"`
}
SARIFLocation represents a location in the code.
type SARIFMessage ¶
type SARIFMessage struct {
Text string `json:"text"`
}
SARIFMessage represents a message in a result.
type SARIFOutput ¶
type SARIFOutput struct {
Schema string `json:"$schema"`
Version string `json:"version"`
Runs []SARIFRun `json:"runs"`
}
SARIFOutput represents the SARIF (Static Analysis Results Interchange Format) output. This format is used by security tools like GitHub Advanced Security, CodeQL, etc. Spec: https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html
type SARIFPhysicalLocation ¶
type SARIFPhysicalLocation struct {
ArtifactLocation SARIFArtifactLocation `json:"artifactLocation"`
Region SARIFRegion `json:"region"`
}
SARIFPhysicalLocation represents the physical file location.
type SARIFPrinterOptions ¶ added in v0.4.0
SARIFPrinterOptions contains configuration for SARIF output.
type SARIFRegion ¶
SARIFRegion represents a region within a file. Field names follow the SARIF 2.1.0 spec (region.startLine / region.endLine); they intentionally differ from CloneRef's line_start/line_end tags.
type SARIFResult ¶
type SARIFResult struct {
RuleID string `json:"ruleId"`
Level string `json:"level"`
Message SARIFMessage `json:"message"`
Locations []SARIFLocation `json:"locations"`
Fingerprints SARIFFingerprints `json:"fingerprints"`
Properties map[string]string `json:"properties,omitempty"`
}
SARIFResult represents a single result (finding).
type SARIFRule ¶
type SARIFRule struct {
ID string `json:"id"`
Name string `json:"name"`
ShortDescription SARIFTextContent `json:"shortDescription"`
FullDescription SARIFTextContent `json:"fullDescription"`
DefaultConfiguration SARIFConfiguration `json:"defaultConfiguration"`
HelpURI string `json:"helpUri,omitempty"`
Properties SARIFRuleProperties `json:"properties"`
}
SARIFRule represents a rule/check that was violated.
type SARIFRuleProperties ¶ added in v0.4.0
type SARIFRuleProperties struct {
Precision string `json:"precision,omitempty"`
ProblemSeverity string `json:"problem.severity,omitempty"`
Tags []string `json:"tags,omitempty"`
}
SARIFRuleProperties carries tool-specific metadata recognised by GitHub Code Scanning, SonarQube, and other SARIF consumers.
type SARIFRun ¶
type SARIFRun struct {
Tool SARIFTool `json:"tool"`
Results []SARIFResult `json:"results"`
Invocations []SARIFInvocation `json:"invocations,omitempty"`
}
SARIFRun represents a single analysis run.
type SARIFTextContent ¶
type SARIFTextContent struct {
Text string `json:"text"`
}
SARIFTextContent represents text content in SARIF.
type SARIFTool ¶
type SARIFTool struct {
Driver SARIFDriver `json:"driver"`
}
SARIFTool represents the tool that performed the analysis.
type StatsConfig ¶
type StatsConfig struct {
Format config.OutputFormat
FilesCount int
DetectionMethods string
SemanticDetection bool
Timestamp string
AnalysisDuration time.Duration
TotalEstimatedLines int
FilesFiltered int
FilterBreakdown map[string]int
FilterSourceBreakdown map[string]int
}
StatsConfig holds configuration for statistics output. Used by StatsPrinter.ApplyStatsConfig to set all stats metadata in one call.
type StatsPrinter ¶
type StatsPrinter interface {
Printer
ApplyStatsConfig(config StatsConfig)
SetFilterStats(filesFiltered int, breakdown map[string]int)
SetFilterSourceStats(sourceBreakdown map[string]int)
GetStatsView() *StatsView
}
StatsPrinter extends Printer interface with stats configuration.
type StatsView ¶ added in v0.4.0
type StatsView struct {
// Count metrics
TotalFilesScanned int `json:"total_files_scanned"`
TotalCloneGroups int `json:"total_clone_groups"`
TotalClones int `json:"total_clones"`
// Size metrics
TotalDuplicateLines int `json:"total_duplicate_lines"`
TotalTokens int `json:"total_tokens"`
TotalEstimatedLines int `json:"total_estimated_lines"` // Estimated total lines for duplication percentage
AverageCloneSize int `json:"average_clone_size"`
// Complexity and impact metrics
ComplexityScore float64 `json:"complexity_score"`
ImpactScore int `json:"impact_score"`
DuplicationRatio float64 `json:"duplication_ratio"` // Percentage of duplicated code
// Quality metrics
HealthScore domain.HealthScore `json:"health_score"` // A-F grade based on metrics
// Time metrics
AnalysisDuration string `json:"analysis_duration"` // Time taken for analysis
Timestamp string `json:"timestamp"` // ISO 8601 timestamp
// Aggregation metrics
FileDuplication map[string]int `json:"file_duplication"` // filename -> duplicate line count
SizeDistribution map[string]int `json:"size_distribution"` // size range -> count (lines)
TokenDistribution map[string]int `json:"token_distribution"` // token range -> count
SeverityBreakdown map[string]int `json:"severity_breakdown"` // severity -> count (small/medium/large/huge)
CategoryBreakdown map[string]int `json:"category_breakdown,omitempty"` // category -> count (function/test/struct/etc)
PriorityBreakdown map[string]int `json:"priority_breakdown,omitempty"` // priority -> count (critical/high/medium/low)
// Actionability metrics
ActionableGroups int `json:"actionable_groups,omitempty"` // Groups that can be refactored
NonActionableGroups int `json:"non_actionable_groups,omitempty"` // Groups that are idiomatic boilerplate
// Test vs production separation
TestCloneGroups int `json:"test_clone_groups,omitempty"` // Groups found in test files
ProductionCloneGroups int `json:"production_clone_groups,omitempty"` // Groups found in production files
// Top impactful clones to fix
TopClones []TopCloneGroup `json:"top_clones,omitempty"` // Highest priority actionable clones
// Filter metrics (NEW)
FilesFiltered int `json:"files_filtered,omitempty"` // Total files filtered out
FilterBreakdown map[string]int `json:"filter_breakdown,omitempty"` // Reason -> count (e.g., "templ" -> 12)
FilterSourceBreakdown map[string]int `json:"filter_source_breakdown,omitempty"` // Source -> count (gogenfilter vs defense-in-depth)
// Detection mode
DetectionMode string `json:"detection_mode,omitempty"` // "semantic" or "structural"
DetectionModeDesc string `json:"detection_mode_description,omitempty"` // Human-readable description
// Metadata
DetectionMethods string `json:"detection_methods"` // Comma-separated detection methods used
SemanticDetection bool `json:"semantic_detection"` // Whether semantic-aware detection was enabled
}
StatsView holds all aggregated statistics about code duplication analysis.
Fields: - Count metrics: TotalFilesScanned, TotalCloneGroups, TotalClones - Size metrics: TotalTokens, TotalDuplicateLines, AverageCloneSize - Complexity metrics: ComplexityScore, ImpactScore - Quality metrics: DuplicationRatio, HealthScore - Time metrics: AnalysisDuration, Timestamp - Aggregation metrics: FileDuplication, SizeDistribution - Filter metrics: FilesFiltered, FilterBreakdown (NEW) - Metadata: DetectionMethods
JSON Marshaling: - All fields are JSON tagged for easy marshaling - Use printer.JSONPrinter for formatted JSON output.
type SummaryView ¶ added in v0.4.0
type SummaryView struct {
TotalClones int
TotalTokens int
ProdCount int
TestCount int
CategoryCounts map[CloneCategory]int
PriorityCounts map[ClonePriority]int
HasData bool
}
type TextPrinter ¶
type TextPrinter struct {
ReadFile
// contains filtered or unexported fields
}
func (*TextPrinter) OutputText ¶
func (p *TextPrinter) OutputText(threshold int, sortBy config.SortCriteria) error
func (*TextPrinter) PrintClones ¶
func (p *TextPrinter) PrintClones( group domain.ProcessedCloneGroup, sortBy ...config.SortCriteria, ) error
func (*TextPrinter) PrintFooter ¶
func (p *TextPrinter) PrintFooter() error
func (*TextPrinter) PrintHeader ¶
func (p *TextPrinter) PrintHeader() error
func (*TextPrinter) SetExplain ¶ added in v0.5.0
func (p *TextPrinter) SetExplain(enabled bool)
func (*TextPrinter) SetFileDuplicate ¶
func (p *TextPrinter) SetFileDuplicate(isDupe bool)
func (*TextPrinter) SetHash ¶
func (p *TextPrinter) SetHash(hash string)
func (*TextPrinter) SetRichText ¶ added in v0.2.0
func (p *TextPrinter) SetRichText(enabled bool)
type TopCloneGroup ¶ added in v0.2.0
type TopCloneGroup struct {
Priority domain.ClonePriority `json:"priority"`
Category domain.CloneCategory `json:"category"`
Lines int `json:"lines"`
Files int `json:"files"`
Suggestion string `json:"suggestion"`
FirstFile string `json:"firstFile"`
FirstLineStart int `json:"firstLineStart"`
}
TopCloneGroup represents a high-impact clone group for the "top clones to fix" preview.