clone

package module
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig = &Config{
		BufSize:   100,
		Threshold: 10,
	}
)

Functions

This section is empty.

Types

type CloneDetector

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

func NewCloneDetector

func NewCloneDetector(config *Config) *CloneDetector

func (*CloneDetector) AddNode

func (cd *CloneDetector) AddNode(ctx context.Context, root ast.Node) error

func (*CloneDetector) GetClones

func (cd *CloneDetector) GetClones() ([]*ClonePair, error)

type ClonePair

type ClonePair struct {
	Node1 ast.Node
	Node2 ast.Node
}

type Config

type Config struct {
	// AddFile時のチャネルのバッファーサイズ(デフォルト:100)
	BufSize int
	// 連続トークン数の境界値(デフォルト:100)
	Threshold int
	Serializer
	SuffixTree
}

type Serializer

type Serializer interface {
	Serialize(ctx context.Context, root ast.Node, nodeChan chan<- *domain.Node) error
}

type SuffixTree

type SuffixTree interface {
	AddNode(node *domain.Node) error
	GetClonePairs(threshold int) ([]*domain.CloneSequencePair, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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