ownership

package
v0.0.0-...-859117f Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveToCache

func SaveToCache(opts OwnershipOptions, result OwnershipResult) error

Types

type AuthorCluster

type AuthorCluster struct {
	Name    string
	Value   int
	Authors []string
}

type AuthorLines

type AuthorLines struct {
	AuthorName           string  `json:"author_name"`
	AuthorMail           string  `json:"author_mail"`
	OwnedLinesTotal      int     `json:"owned_lines_total"`
	OwnedLinesAgeDaysSum float64 `json:"owned_lines_age_days_sum"`
	// OwnedLinesDuplicate total lines owned that were found duplicated in repo
	OwnedLinesDuplicate int `json:"owned_lines_duplicate"`
	// OwnedLinesDuplicateOriginal total lines owned that were found duplicated in repo but were originally created by the author
	OwnedLinesDuplicateOriginal int `json:"owned_lines_duplicate_original"`
	// OwnedLinesDuplicateOriginalOthers total lines owned that were found duplicated by someone else (your code was duplicated by others)
	OwnedLinesDuplicateOriginalOthers int `json:"owned_lines_duplicate_original_others"`
}

type AuthorLinesCluster

type AuthorLinesCluster struct {
	Name        string
	Value       int
	AuthorLines []AuthorLines
}

func ClusterizeAuthors

func ClusterizeAuthors(changesResults []OwnershipResult, numberOfClusters int) ([]AuthorLinesCluster, error)

ClusterizeAuthors processes ownershipResults and clusterizes authors using k-mean over the number of owned lines

type AuthorLinesDate

type AuthorLinesDate struct {
	Date        string
	AuthorLines AuthorLines
}

type AuthorNameLinesDate

type AuthorNameLinesDate struct {
	AuthorName      string
	AuthorLinesDate []AuthorLinesDate
}

func SortByAuthorDate

func SortByAuthorDate(ownershipResults []OwnershipResult) []AuthorNameLinesDate

type OwnershipOptions

type OwnershipOptions struct {
	utils.BaseOptions
	MinDuplicateLines int    `json:"min_duplicate_lines"`
	CommitId          string `json:"commit_id"`
}

type OwnershipResult

type OwnershipResult struct {
	Commit               utils.CommitInfo `json:"commit"`
	TotalFiles           int              `json:"total_files"`
	TotalLines           int              `json:"total_lines"`
	TotalLinesDuplicated int              `json:"total_files_duplicated"`
	LinesAgeDaysSum      float64          `json:"lines_age_days_sum"`

	AuthorsLines        []AuthorLines     `json:"authors_lines"`
	FilePath            string            `json:"file_path"`
	DuplicateLineGroups []utils.LineGroup `json:"duplicate_line_groups"`
	// contains filtered or unexported fields
}

func AnalyseOwnership

func AnalyseOwnership(opts OwnershipOptions, progressChan chan<- utils.ProgressInfo) (OwnershipResult, error)

func AnalyseTimeseriesOwnership

func AnalyseTimeseriesOwnership(opts OwnershipTimeseriesOptions, progressChan chan<- utils.ProgressInfo) ([]OwnershipResult, error)

func GetFromCache

func GetFromCache(opts OwnershipOptions) (*OwnershipResult, error)

type OwnershipTimeseriesOptions

type OwnershipTimeseriesOptions struct {
	utils.BaseOptions
	MinDuplicateLines int    `json:"min_duplicate_lines"`
	Since             string `json:"since"`
	Until             string `json:"until"`
	Period            string `json:"period"`
}

Jump to

Keyboard shortcuts

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