hercules.v9: gopkg.in/src-d/hercules.v9/leaves Index | Files | Directories

package leaves

import "gopkg.in/src-d/hercules.v9/leaves"

Index

Package Files

burndown.go commits.go couples.go devs.go file_history.go shotness.go

Constants

const (
    // ConfigBurndownGranularity is the name of the option to set BurndownAnalysis.Granularity.
    ConfigBurndownGranularity = "Burndown.Granularity"
    // ConfigBurndownSampling is the name of the option to set BurndownAnalysis.Sampling.
    ConfigBurndownSampling = "Burndown.Sampling"
    // ConfigBurndownTrackFiles enables burndown collection for files.
    ConfigBurndownTrackFiles = "Burndown.TrackFiles"
    // ConfigBurndownTrackPeople enables burndown collection for authors.
    ConfigBurndownTrackPeople = "Burndown.TrackPeople"
    // ConfigBurndownHibernationThreshold sets the hibernation threshold for the underlying
    // RBTree allocator. It is useful to trade CPU time for reduced peak memory consumption
    // if there are many branches.
    ConfigBurndownHibernationThreshold = "Burndown.HibernationThreshold"
    // ConfigBurndownHibernationToDisk sets whether the hibernated RBTree allocator must be saved
    // on disk rather than kept in memory.
    ConfigBurndownHibernationToDisk = "Burndown.HibernationOnDisk"
    // ConfigBurndownHibernationDirectory sets the name of the temporary directory to use for
    // saving hibernated RBTree allocators.
    ConfigBurndownHibernationDirectory = "Burndown.HibernationDirectory"
    // ConfigBurndownDebug enables some extra debug assertions.
    ConfigBurndownDebug = "Burndown.Debug"
    // DefaultBurndownGranularity is the default number of days for BurndownAnalysis.Granularity
    // and BurndownAnalysis.Sampling.
    DefaultBurndownGranularity = 30
)
const (
    // ConfigShotnessXpathStruct is the name of the configuration option (ShotnessAnalysis.Configure())
    // which sets the UAST XPath to choose the analysed nodes.
    // The format is Semantic UASTv2, see https://docs.sourced.tech/babelfish/using-babelfish/uast-querying
    ConfigShotnessXpathStruct = "Shotness.XpathStruct"
    // ConfigShotnessXpathName is the name of the configuration option (ShotnessAnalysis.Configure())
    // which sets the UAST XPath to find the name of the nodes chosen by ConfigShotnessXpathStruct.
    // The format is Semantic UASTv2, see https://docs.sourced.tech/babelfish/using-babelfish/uast-querying
    ConfigShotnessXpathName = "Shotness.XpathName"

    // DefaultShotnessXpathStruct is the default UAST XPath to choose the analysed nodes.
    // It extracts functions.
    DefaultShotnessXpathStruct = "//uast:FunctionGroup"
    // DefaultShotnessXpathName is the default UAST XPath to choose the names of the analysed nodes.
    // It looks at the current tree level and at the immediate children.
    DefaultShotnessXpathName = "/Nodes/uast:Alias/Name"
)
const (
    // ConfigDevsConsiderEmptyCommits is the name of the option to set DevsAnalysis.ConsiderEmptyCommits.
    ConfigDevsConsiderEmptyCommits = "Devs.ConsiderEmptyCommits"
)
const (
    // CouplesMaximumMeaningfulContextSize is the threshold on the number of files in a commit to
    // consider them as grouped together.
    CouplesMaximumMeaningfulContextSize = 1000
)

type BurndownAnalysis Uses

type BurndownAnalysis struct {
    // Granularity sets the size of each band - the number of days it spans.
    // Smaller values provide better resolution but require more work and eat more
    // memory. 30 days is usually enough.
    Granularity int
    // Sampling sets how detailed is the statistic - the size of the interval in
    // days between consecutive measurements. It may not be greater than Granularity. Try 15 or 30.
    Sampling int

    // TrackFiles enables or disables the fine-grained per-file burndown analysis.
    // It does not change the project level burndown results.
    TrackFiles bool

    // PeopleNumber is the number of developers for which to collect the burndown stats. 0 disables it.
    PeopleNumber int

    // HibernationThreshold sets the hibernation threshold for the underlying
    // RBTree allocator. It is useful to trade CPU time for reduced peak memory consumption
    // if there are many branches.
    HibernationThreshold int

    // HibernationToDisk specifies whether the hibernated RBTree allocator must be saved on disk
    // rather than kept in memory.
    HibernationToDisk bool

    // HibernationDirectory is the name of the temporary directory to use for saving hibernated
    // RBTree allocators.
    HibernationDirectory string

    // Debug activates the debugging mode. Analyse() runs slower in this mode
    // but it accurately checks all the intermediate states for invariant
    // violations.
    Debug bool
    // contains filtered or unexported fields
}

BurndownAnalysis allows to gather the line burndown statistics for a Git repository. It is a LeafPipelineItem. Reference: https://erikbern.com/2016/12/05/the-half-life-of-code.html

func (*BurndownAnalysis) Boot Uses

func (analyser *BurndownAnalysis) Boot() error

Boot decompresses the bound RBTree memory with the files.

func (*BurndownAnalysis) Configure Uses

func (analyser *BurndownAnalysis) Configure(facts map[string]interface{}) error

Configure sets the properties previously published by ListConfigurationOptions().

func (*BurndownAnalysis) Consume Uses

func (analyser *BurndownAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error)

Consume runs this PipelineItem on the next commit's data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.

func (*BurndownAnalysis) Description Uses

func (analyser *BurndownAnalysis) Description() string

Description returns the text which explains what the analysis is doing.

func (*BurndownAnalysis) Deserialize Uses

func (analyser *BurndownAnalysis) Deserialize(pbmessage []byte) (interface{}, error)

Deserialize converts the specified protobuf bytes to BurndownResult.

func (*BurndownAnalysis) Finalize Uses

func (analyser *BurndownAnalysis) Finalize() interface{}

Finalize returns the result of the analysis. Further Consume() calls are not expected.

func (*BurndownAnalysis) Flag Uses

func (analyser *BurndownAnalysis) Flag() string

Flag for the command line switch which enables this analysis.

func (*BurndownAnalysis) Fork Uses

func (analyser *BurndownAnalysis) Fork(n int) []core.PipelineItem

Fork clones this item. Everything is copied by reference except the files which are copied by value.

func (*BurndownAnalysis) Hibernate Uses

func (analyser *BurndownAnalysis) Hibernate() error

Hibernate compresses the bound RBTree memory with the files.

func (*BurndownAnalysis) Initialize Uses

func (analyser *BurndownAnalysis) Initialize(repository *git.Repository) error

Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.

func (*BurndownAnalysis) ListConfigurationOptions Uses

func (analyser *BurndownAnalysis) ListConfigurationOptions() []core.ConfigurationOption

ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.

func (*BurndownAnalysis) Merge Uses

func (analyser *BurndownAnalysis) Merge(branches []core.PipelineItem)

Merge combines several items together. We apply the special file merging logic here.

func (*BurndownAnalysis) MergeResults Uses

func (analyser *BurndownAnalysis) MergeResults(
    r1, r2 interface{}, c1, c2 *core.CommonAnalysisResult) interface{}

MergeResults combines two BurndownResult-s together.

func (*BurndownAnalysis) Name Uses

func (analyser *BurndownAnalysis) Name() string

Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.

func (*BurndownAnalysis) Provides Uses

func (analyser *BurndownAnalysis) Provides() []string

Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.

func (*BurndownAnalysis) Requires Uses

func (analyser *BurndownAnalysis) Requires() []string

Requires returns the list of names of entities which are needed by this PipelineItem. Each requested entity will be inserted into `deps` of Consume(). In turn, those entities are Provides() upstream.

func (*BurndownAnalysis) Serialize Uses

func (analyser *BurndownAnalysis) Serialize(result interface{}, binary bool, writer io.Writer) error

Serialize converts the analysis result as returned by Finalize() to text or bytes. The text format is YAML and the bytes format is Protocol Buffers.

type BurndownResult Uses

type BurndownResult struct {
    // [number of samples][number of bands]
    // The number of samples depends on Sampling: the less Sampling, the bigger the number.
    // The number of bands depends on Granularity: the less Granularity, the bigger the number.
    GlobalHistory DenseHistory
    // The key is a path inside the Git repository. The value's dimensions are the same as
    // in GlobalHistory.
    FileHistories map[string]DenseHistory
    // The key is a path inside the Git repository. The value is a mapping from developer indexes
    // (see reversedPeopleDict) and the owned line numbers. Their sum equals to the total number of
    // lines in the file.
    FileOwnership map[string]map[int]int
    // [number of people][number of samples][number of bands]
    PeopleHistories []DenseHistory
    // [number of people][number of people + 2]
    // The first element is the total number of lines added by the author.
    // The second element is the number of removals by unidentified authors (outside reversedPeopleDict).
    // The rest of the elements are equal the number of line removals by the corresponding
    // authors in reversedPeopleDict: 2 -> 0, 3 -> 1, etc.
    PeopleMatrix DenseHistory
    // contains filtered or unexported fields
}

BurndownResult carries the result of running BurndownAnalysis - it is returned by BurndownAnalysis.Finalize().

type CommitStat Uses

type CommitStat struct {
    Hash   string
    When   int64
    Author int
    Files  []FileStat
}

CommitStat is the statistics for a commit

type CommitsAnalysis Uses

type CommitsAnalysis struct {
    core.NoopMerger
    // contains filtered or unexported fields
}

CommitsAnalysis extracts statistics for each commit

func (*CommitsAnalysis) Configure Uses

func (ca *CommitsAnalysis) Configure(facts map[string]interface{}) error

Configure sets the properties previously published by ListConfigurationOptions().

func (*CommitsAnalysis) Consume Uses

func (ca *CommitsAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error)

Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.

func (*CommitsAnalysis) Description Uses

func (ca *CommitsAnalysis) Description() string

Description returns the text which explains what the analysis is doing.

func (*CommitsAnalysis) Finalize Uses

func (ca *CommitsAnalysis) Finalize() interface{}

Finalize returns the result of the analysis. Further Consume() calls are not expected.

func (*CommitsAnalysis) Flag Uses

func (ca *CommitsAnalysis) Flag() string

Flag for the command line switch which enables this analysis.

func (*CommitsAnalysis) Fork Uses

func (ca *CommitsAnalysis) Fork(n int) []core.PipelineItem

Fork clones this pipeline item.

func (*CommitsAnalysis) Initialize Uses

func (ca *CommitsAnalysis) Initialize(repository *git.Repository) error

Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.

func (*CommitsAnalysis) ListConfigurationOptions Uses

func (ca *CommitsAnalysis) ListConfigurationOptions() []core.ConfigurationOption

ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.

func (*CommitsAnalysis) Name Uses

func (ca *CommitsAnalysis) Name() string

Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.

func (*CommitsAnalysis) Provides Uses

func (ca *CommitsAnalysis) Provides() []string

Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.

func (*CommitsAnalysis) Requires Uses

func (ca *CommitsAnalysis) Requires() []string

Requires returns the list of names of entities which are needed by this PipelineItem. Each requested entity will be inserted into `deps` of Consume(). In turn, those entities are Provides() upstream.

func (*CommitsAnalysis) Serialize Uses

func (ca *CommitsAnalysis) Serialize(result interface{}, binary bool, writer io.Writer) error

Serialize converts the analysis result as returned by Finalize() to text or bytes. The text format is YAML and the bytes format is Protocol Buffers.

type CommitsResult Uses

type CommitsResult struct {
    Commits []*CommitStat
    // contains filtered or unexported fields
}

CommitsResult is returned by CommitsAnalysis.Finalize() and carries the statistics per commit.

type CouplesAnalysis Uses

type CouplesAnalysis struct {
    core.NoopMerger
    core.OneShotMergeProcessor
    // PeopleNumber is the number of developers for which to build the matrix. 0 disables this analysis.
    PeopleNumber int
    // contains filtered or unexported fields
}

CouplesAnalysis calculates the number of common commits for files and authors. The results are matrices, where cell at row X and column Y is the number of commits which changed X and Y together. In case with people, the numbers are summed for every common file.

func (*CouplesAnalysis) Configure Uses

func (couples *CouplesAnalysis) Configure(facts map[string]interface{}) error

Configure sets the properties previously published by ListConfigurationOptions().

func (*CouplesAnalysis) Consume Uses

func (couples *CouplesAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error)

Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.

func (*CouplesAnalysis) Description Uses

func (couples *CouplesAnalysis) Description() string

Description returns the text which explains what the analysis is doing.

func (*CouplesAnalysis) Deserialize Uses

func (couples *CouplesAnalysis) Deserialize(pbmessage []byte) (interface{}, error)

Deserialize converts the specified protobuf bytes to CouplesResult.

func (*CouplesAnalysis) Finalize Uses

func (couples *CouplesAnalysis) Finalize() interface{}

Finalize returns the result of the analysis. Further Consume() calls are not expected.

func (*CouplesAnalysis) Flag Uses

func (couples *CouplesAnalysis) Flag() string

Flag for the command line switch which enables this analysis.

func (*CouplesAnalysis) Fork Uses

func (couples *CouplesAnalysis) Fork(n int) []core.PipelineItem

Fork clones this pipeline item.

func (*CouplesAnalysis) Initialize Uses

func (couples *CouplesAnalysis) Initialize(repository *git.Repository) error

Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.

func (*CouplesAnalysis) ListConfigurationOptions Uses

func (couples *CouplesAnalysis) ListConfigurationOptions() []core.ConfigurationOption

ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.

func (*CouplesAnalysis) MergeResults Uses

func (couples *CouplesAnalysis) MergeResults(r1, r2 interface{}, c1, c2 *core.CommonAnalysisResult) interface{}

MergeResults combines two CouplesAnalysis-s together.

func (*CouplesAnalysis) Name Uses

func (couples *CouplesAnalysis) Name() string

Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.

func (*CouplesAnalysis) Provides Uses

func (couples *CouplesAnalysis) Provides() []string

Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.

func (*CouplesAnalysis) Requires Uses

func (couples *CouplesAnalysis) Requires() []string

Requires returns the list of names of entities which are needed by this PipelineItem. Each requested entity will be inserted into `deps` of Consume(). In turn, those entities are Provides() upstream.

func (*CouplesAnalysis) Serialize Uses

func (couples *CouplesAnalysis) Serialize(result interface{}, binary bool, writer io.Writer) error

Serialize converts the analysis result as returned by Finalize() to text or bytes. The text format is YAML and the bytes format is Protocol Buffers.

type CouplesResult Uses

type CouplesResult struct {
    // PeopleMatrix is how many times developers changed files which were also changed by other developers.
    // The mapping's key is the other developer, and the value is the sum over all the files both developers changed.
    // Each element of that sum is min(C1, C2) where Ci is the number of commits developer i made which touched the file.
    PeopleMatrix []map[int]int64
    // PeopleFiles is how many times developers changed files. The first dimension (left []) is developers,
    // and the second dimension (right []) is file indexes.
    PeopleFiles [][]int
    // FilesMatrix is how many times file pairs occurred in the same commit.
    FilesMatrix []map[int]int64
    // FilesLines is the number of lines contained in each file from the last analyzed commit.
    FilesLines []int
    // Files is the names of the files. The order matches PeopleFiles' indexes and FilesMatrix.
    Files []string
    // contains filtered or unexported fields
}

CouplesResult is returned by CouplesAnalysis.Finalize() and carries couples matrices from authors and files.

type DenseHistory Uses

type DenseHistory = [][]int64

DenseHistory is the matrix [number of samples][number of bands] -> number of lines.

y                  x

type DevDay Uses

type DevDay struct {
    // Commits is the number of commits made by a particular developer in a particular day.
    Commits int
    items.LineStats
    // LanguagesDetection carries fine-grained line stats per programming language.
    Languages map[string]items.LineStats
}

DevDay is the statistics for a development day and a particular developer.

type DevsAnalysis Uses

type DevsAnalysis struct {
    core.NoopMerger
    core.OneShotMergeProcessor
    // ConsiderEmptyCommits indicates whether empty commits (e.g., merges) should be taken
    // into account.
    ConsiderEmptyCommits bool
    // contains filtered or unexported fields
}

DevsAnalysis calculates the number of commits through time per developer. It also records the numbers of added, deleted and changed lines through time per developer. Those numbers are additionally measured per language.

func (*DevsAnalysis) Configure Uses

func (devs *DevsAnalysis) Configure(facts map[string]interface{}) error

Configure sets the properties previously published by ListConfigurationOptions().

func (*DevsAnalysis) Consume Uses

func (devs *DevsAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error)

Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.

func (*DevsAnalysis) Description Uses

func (devs *DevsAnalysis) Description() string

Description returns the text which explains what the analysis is doing.

func (*DevsAnalysis) Deserialize Uses

func (devs *DevsAnalysis) Deserialize(pbmessage []byte) (interface{}, error)

Deserialize converts the specified protobuf bytes to DevsResult.

func (*DevsAnalysis) Finalize Uses

func (devs *DevsAnalysis) Finalize() interface{}

Finalize returns the result of the analysis. Further Consume() calls are not expected.

func (*DevsAnalysis) Flag Uses

func (devs *DevsAnalysis) Flag() string

Flag for the command line switch which enables this analysis.

func (*DevsAnalysis) Fork Uses

func (devs *DevsAnalysis) Fork(n int) []core.PipelineItem

Fork clones this pipeline item.

func (*DevsAnalysis) Initialize Uses

func (devs *DevsAnalysis) Initialize(repository *git.Repository) error

Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.

func (*DevsAnalysis) ListConfigurationOptions Uses

func (devs *DevsAnalysis) ListConfigurationOptions() []core.ConfigurationOption

ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.

func (*DevsAnalysis) MergeResults Uses

func (devs *DevsAnalysis) MergeResults(r1, r2 interface{}, c1, c2 *core.CommonAnalysisResult) interface{}

MergeResults combines two DevsAnalysis-es together.

func (*DevsAnalysis) Name Uses

func (devs *DevsAnalysis) Name() string

Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.

func (*DevsAnalysis) Provides Uses

func (devs *DevsAnalysis) Provides() []string

Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.

func (*DevsAnalysis) Requires Uses

func (devs *DevsAnalysis) Requires() []string

Requires returns the list of names of entities which are needed by this PipelineItem. Each requested entity will be inserted into `deps` of Consume(). In turn, those entities are Provides() upstream.

func (*DevsAnalysis) Serialize Uses

func (devs *DevsAnalysis) Serialize(result interface{}, binary bool, writer io.Writer) error

Serialize converts the analysis result as returned by Finalize() to text or bytes. The text format is YAML and the bytes format is Protocol Buffers.

type DevsResult Uses

type DevsResult struct {
    // Days is <day index> -> <developer index> -> daily stats
    Days map[int]map[int]*DevDay
    // contains filtered or unexported fields
}

DevsResult is returned by DevsAnalysis.Finalize() and carries the daily statistics per developer.

type FileHistory Uses

type FileHistory struct {
    // Hashes is the list of commit hashes which changed this file.
    Hashes []plumbing.Hash
    // People is the mapping from developers to the number of lines they altered.
    People map[int]items.LineStats
}

FileHistory is the gathered stats about a particular file.

type FileHistoryAnalysis Uses

type FileHistoryAnalysis struct {
    core.NoopMerger
    core.OneShotMergeProcessor
    // contains filtered or unexported fields
}

FileHistoryAnalysis contains the intermediate state which is mutated by Consume(). It should implement LeafPipelineItem.

func (*FileHistoryAnalysis) Configure Uses

func (history *FileHistoryAnalysis) Configure(facts map[string]interface{}) error

Configure sets the properties previously published by ListConfigurationOptions().

func (*FileHistoryAnalysis) Consume Uses

func (history *FileHistoryAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error)

Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.

func (*FileHistoryAnalysis) Description Uses

func (history *FileHistoryAnalysis) Description() string

Description returns the text which explains what the analysis is doing.

func (*FileHistoryAnalysis) Finalize Uses

func (history *FileHistoryAnalysis) Finalize() interface{}

Finalize returns the result of the analysis. Further Consume() calls are not expected.

func (*FileHistoryAnalysis) Flag Uses

func (history *FileHistoryAnalysis) Flag() string

Flag for the command line switch which enables this analysis.

func (*FileHistoryAnalysis) Fork Uses

func (history *FileHistoryAnalysis) Fork(n int) []core.PipelineItem

Fork clones this PipelineItem.

func (*FileHistoryAnalysis) Initialize Uses

func (history *FileHistoryAnalysis) Initialize(repository *git.Repository) error

Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.

func (*FileHistoryAnalysis) ListConfigurationOptions Uses

func (history *FileHistoryAnalysis) ListConfigurationOptions() []core.ConfigurationOption

ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.

func (*FileHistoryAnalysis) Name Uses

func (history *FileHistoryAnalysis) Name() string

Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.

func (*FileHistoryAnalysis) Provides Uses

func (history *FileHistoryAnalysis) Provides() []string

Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.

func (*FileHistoryAnalysis) Requires Uses

func (history *FileHistoryAnalysis) Requires() []string

Requires returns the list of names of entities which are needed by this PipelineItem. Each requested entity will be inserted into `deps` of Consume(). In turn, those entities are Provides() upstream.

func (*FileHistoryAnalysis) Serialize Uses

func (history *FileHistoryAnalysis) Serialize(result interface{}, binary bool, writer io.Writer) error

Serialize converts the analysis result as returned by Finalize() to text or bytes. The text format is YAML and the bytes format is Protocol Buffers.

type FileHistoryResult Uses

type FileHistoryResult struct {
    Files map[string]FileHistory
}

FileHistoryResult is returned by Finalize() and represents the analysis result.

type FileStat Uses

type FileStat struct {
    Name     string
    Language string
    items.LineStats
}

FileStat is the statistics for a file in a commit

type NodeSummary Uses

type NodeSummary struct {
    Type string
    Name string
    File string
}

NodeSummary carries the node attributes which annotate the "shotness" analysis' counters. These attributes are supposed to uniquely identify each node.

func (NodeSummary) String Uses

func (node NodeSummary) String() string

type ShotnessAnalysis Uses

type ShotnessAnalysis struct {
    core.NoopMerger
    core.OneShotMergeProcessor
    XpathStruct string
    XpathName   string
    // contains filtered or unexported fields
}

ShotnessAnalysis contains the intermediate state which is mutated by Consume(). It should implement LeafPipelineItem.

func (*ShotnessAnalysis) Configure Uses

func (shotness *ShotnessAnalysis) Configure(facts map[string]interface{}) error

Configure sets the properties previously published by ListConfigurationOptions().

func (*ShotnessAnalysis) Consume Uses

func (shotness *ShotnessAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error)

Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.

func (*ShotnessAnalysis) Description Uses

func (shotness *ShotnessAnalysis) Description() string

Description returns the text which explains what the analysis is doing.

func (*ShotnessAnalysis) Finalize Uses

func (shotness *ShotnessAnalysis) Finalize() interface{}

Finalize returns the result of the analysis. Further Consume() calls are not expected.

func (*ShotnessAnalysis) Flag Uses

func (shotness *ShotnessAnalysis) Flag() string

Flag returns the command line switch which activates the analysis.

func (*ShotnessAnalysis) Fork Uses

func (shotness *ShotnessAnalysis) Fork(n int) []core.PipelineItem

Fork clones this PipelineItem.

func (*ShotnessAnalysis) Initialize Uses

func (shotness *ShotnessAnalysis) Initialize(repository *git.Repository) error

Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.

func (*ShotnessAnalysis) ListConfigurationOptions Uses

func (shotness *ShotnessAnalysis) ListConfigurationOptions() []core.ConfigurationOption

ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.

func (*ShotnessAnalysis) Name Uses

func (shotness *ShotnessAnalysis) Name() string

Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.

func (*ShotnessAnalysis) Provides Uses

func (shotness *ShotnessAnalysis) Provides() []string

Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.

func (*ShotnessAnalysis) Requires Uses

func (shotness *ShotnessAnalysis) Requires() []string

Requires returns the list of names of entities which are needed by this PipelineItem. Each requested entity will be inserted into `deps` of Consume(). In turn, those entities are Provides() upstream.

func (*ShotnessAnalysis) Serialize Uses

func (shotness *ShotnessAnalysis) Serialize(result interface{}, binary bool, writer io.Writer) error

Serialize converts the analysis result as returned by Finalize() to text or bytes. The text format is YAML and the bytes format is Protocol Buffers.

type ShotnessResult Uses

type ShotnessResult struct {
    Nodes    []NodeSummary
    Counters []map[int]int
}

ShotnessResult is returned by ShotnessAnalysis.Finalize() and represents the analysis result.

Directories

PathSynopsis
research

Package leaves imports 29 packages (graph) and is imported by 1 packages. Updated 2019-04-30. Refresh now. Tools for package owners.