changes

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 ChangesOptions, result ChangesResult) error

Types

type AuthorCluster

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

type AuthorLines

type AuthorLines struct {
	AuthorName   string
	AuthorMail   string
	LinesTouched LinesTouched
	FilesTouched []FileTouched
	// contains filtered or unexported fields
}

type AuthorLinesCluster

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

func ClusterizeAuthors

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

ClusterizeAuthors processes changesResults and clusterizes authors using k-mean over the number of touched lines

type AuthorLinesDate

type AuthorLinesDate struct {
	Since       string
	AuthorLines AuthorLines
}

type AuthorNameLinesDate

type AuthorNameLinesDate struct {
	AuthorName       string
	AuthorLinesDates []AuthorLinesDate
}

func SortByAuthorDate

func SortByAuthorDate(changesResults []ChangesResult) []AuthorNameLinesDate

type ChangesFileResult

type ChangesFileResult struct {
	CommitId string
	FilePath string
	ChangesResult
}

type ChangesOptions

type ChangesOptions struct {
	utils.BaseOptions
	// AuthorsRegex string
	SinceDate   string
	UntilDate   string
	SinceCommit string
	UntilCommit string
}

type ChangesResult

type ChangesResult struct {
	/* Lines change stats */
	TotalLinesTouched LinesTouched
	/* Total files changed in the different commits. If the same file is changed in two commits, for example, it will count as one. */
	TotalFiles int
	/* Number of commits analysed */
	TotalCommits int

	/* Change stats per author */
	AuthorsLines []AuthorLines
	SinceCommit  utils.CommitInfo
	UntilCommit  utils.CommitInfo
	// contains filtered or unexported fields
}

func AnalyseChanges

func AnalyseChanges(opts ChangesOptions, progressChan chan<- utils.ProgressInfo) (ChangesResult, error)

func AnalyseTimeseriesChanges

func AnalyseTimeseriesChanges(opts ChangesTimeseriesOptions, progressChan chan<- utils.ProgressInfo) ([]ChangesResult, error)

func GetFromCache

func GetFromCache(opts ChangesOptions) (*ChangesResult, error)

type ChangesTimeseriesOptions

type ChangesTimeseriesOptions struct {
	utils.BaseOptions
	Since  string `json:"since"`
	Until  string `json:"until"`
	Period string `json:"period"`
}

type FileTouched

type FileTouched struct {
	Name  string
	Lines int
}

type LinesTouched

type LinesTouched struct {
	/* New lines found in commits */
	New int

	/* Lines changed in commits. If the same line is changed in two commits, for example, it will count as two changes. This is the sum of RefactorOwn, RefactorOther, ChurnOwn and ChurnOther */
	Changes int

	/* Lines changed after a while in which the author of the previous version was the same person */
	RefactorOwn int
	/* Lines changed after a while in which the author of the previous version was another person */
	RefactorOther int
	/* Lines you owned that were changed by another person after a while. When adding RefactorOther to someone, the author of the previous version of the line will have this counter incremented */
	RefactorReceived int

	/* Lines changed in a short term in which the author of the previous version was the same person */
	ChurnOwn int
	/* Lines changed in a short term in which the author of the previous version was another person */
	ChurnOther int
	/* Lines you owned that were changed by another person in a short term. When adding ChurnOther to someone, the author of the previous version of the line will have this counter incremented */
	ChurnReceived int

	/* Sum of age of lines in the moment they are changed. AgeDaysSum/Changes gives you the average survival duration of a line before it's changed by someone */
	AgeDaysSum float64
}

func SumLinesTouched

func SumLinesTouched(changes1 LinesTouched, changes2 LinesTouched) LinesTouched

Jump to

Keyboard shortcuts

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