Documentation ¶
Index ¶
- Constants
- type BurndownAnalysis
- func (analyser *BurndownAnalysis) Configure(facts map[string]interface{})
- func (analyser *BurndownAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error)
- func (analyser *BurndownAnalysis) Description() string
- func (analyser *BurndownAnalysis) Deserialize(pbmessage []byte) (interface{}, error)
- func (analyser *BurndownAnalysis) Finalize() interface{}
- func (analyser *BurndownAnalysis) Flag() string
- func (analyser *BurndownAnalysis) Fork(n int) []core.PipelineItem
- func (analyser *BurndownAnalysis) Initialize(repository *git.Repository)
- func (analyser *BurndownAnalysis) ListConfigurationOptions() []core.ConfigurationOption
- func (analyser *BurndownAnalysis) Merge(branches []core.PipelineItem)
- func (analyser *BurndownAnalysis) MergeResults(r1, r2 interface{}, c1, c2 *core.CommonAnalysisResult) interface{}
- func (analyser *BurndownAnalysis) Name() string
- func (analyser *BurndownAnalysis) Provides() []string
- func (analyser *BurndownAnalysis) Requires() []string
- func (analyser *BurndownAnalysis) Serialize(result interface{}, binary bool, writer io.Writer) error
- type BurndownResult
- type CouplesAnalysis
- func (couples *CouplesAnalysis) Configure(facts map[string]interface{})
- func (couples *CouplesAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error)
- func (couples *CouplesAnalysis) Description() string
- func (couples *CouplesAnalysis) Deserialize(pbmessage []byte) (interface{}, error)
- func (couples *CouplesAnalysis) Finalize() interface{}
- func (couples *CouplesAnalysis) Flag() string
- func (couples *CouplesAnalysis) Fork(n int) []core.PipelineItem
- func (couples *CouplesAnalysis) Initialize(repository *git.Repository)
- func (couples *CouplesAnalysis) ListConfigurationOptions() []core.ConfigurationOption
- func (couples *CouplesAnalysis) MergeResults(r1, r2 interface{}, c1, c2 *core.CommonAnalysisResult) interface{}
- func (couples *CouplesAnalysis) Name() string
- func (couples *CouplesAnalysis) Provides() []string
- func (couples *CouplesAnalysis) Requires() []string
- func (couples *CouplesAnalysis) Serialize(result interface{}, binary bool, writer io.Writer) error
- type CouplesResult
- type DenseHistory
- type FileHistory
- func (history *FileHistory) Configure(facts map[string]interface{})
- func (history *FileHistory) Consume(deps map[string]interface{}) (map[string]interface{}, error)
- func (history *FileHistory) Description() string
- func (history *FileHistory) Finalize() interface{}
- func (history *FileHistory) Flag() string
- func (history *FileHistory) Fork(n int) []core.PipelineItem
- func (history *FileHistory) Initialize(repository *git.Repository)
- func (history *FileHistory) ListConfigurationOptions() []core.ConfigurationOption
- func (history *FileHistory) Name() string
- func (history *FileHistory) Provides() []string
- func (history *FileHistory) Requires() []string
- func (history *FileHistory) Serialize(result interface{}, binary bool, writer io.Writer) error
- type FileHistoryResult
- type NodeSummary
- type ShotnessAnalysis
- func (shotness *ShotnessAnalysis) Configure(facts map[string]interface{})
- func (shotness *ShotnessAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error)
- func (shotness *ShotnessAnalysis) Description() string
- func (shotness *ShotnessAnalysis) Features() []string
- func (shotness *ShotnessAnalysis) Finalize() interface{}
- func (shotness *ShotnessAnalysis) Flag() string
- func (shotness *ShotnessAnalysis) Fork(n int) []core.PipelineItem
- func (shotness *ShotnessAnalysis) Initialize(repository *git.Repository)
- func (shotness *ShotnessAnalysis) ListConfigurationOptions() []core.ConfigurationOption
- func (shotness *ShotnessAnalysis) Name() string
- func (shotness *ShotnessAnalysis) Provides() []string
- func (shotness *ShotnessAnalysis) Requires() []string
- func (shotness *ShotnessAnalysis) Serialize(result interface{}, binary bool, writer io.Writer) error
- type ShotnessResult
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" // 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. 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. // These XPath-s can be different for some languages. ConfigShotnessXpathName = "Shotness.XpathName" // DefaultShotnessXpathStruct is the default UAST XPath to choose the analysed nodes. // It extracts functions. DefaultShotnessXpathStruct = "//*[@roleFunction and @roleDeclaration]" // 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 = "/*[@roleFunction and @roleIdentifier and @roleName] | /*/*[@roleFunction and @roleIdentifier and @roleName]" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BurndownAnalysis ¶
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 // The number of developers for which to collect the burndown stats. 0 disables it. PeopleNumber int // 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) Configure ¶
func (analyser *BurndownAnalysis) Configure(facts map[string]interface{})
Configure sets the properties previously published by ListConfigurationOptions().
func (*BurndownAnalysis) Consume ¶
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 ¶
func (analyser *BurndownAnalysis) Description() string
Description returns the text which explains what the analysis is doing.
func (*BurndownAnalysis) Deserialize ¶
func (analyser *BurndownAnalysis) Deserialize(pbmessage []byte) (interface{}, error)
Deserialize converts the specified protobuf bytes to BurndownResult.
func (*BurndownAnalysis) Finalize ¶
func (analyser *BurndownAnalysis) Finalize() interface{}
Finalize returns the result of the analysis. Further Consume() calls are not expected.
func (*BurndownAnalysis) Flag ¶
func (analyser *BurndownAnalysis) Flag() string
Flag for the command line switch which enables this analysis.
func (*BurndownAnalysis) Fork ¶
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) Initialize ¶
func (analyser *BurndownAnalysis) Initialize(repository *git.Repository)
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 ¶
func (analyser *BurndownAnalysis) ListConfigurationOptions() []core.ConfigurationOption
ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
func (*BurndownAnalysis) Merge ¶
func (analyser *BurndownAnalysis) Merge(branches []core.PipelineItem)
Merge combines several items together. We apply the special file merging logic here.
func (*BurndownAnalysis) MergeResults ¶
func (analyser *BurndownAnalysis) MergeResults( r1, r2 interface{}, c1, c2 *core.CommonAnalysisResult) interface{}
MergeResults combines two BurndownResult-s together.
func (*BurndownAnalysis) Name ¶
func (analyser *BurndownAnalysis) Name() string
Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
func (*BurndownAnalysis) Provides ¶
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 ¶
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.
type BurndownResult ¶
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 the path inside the Git repository. The value's dimensions are the same as // in GlobalHistory. FileHistories map[string]DenseHistory // [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 CouplesAnalysis ¶
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 ¶
func (couples *CouplesAnalysis) Configure(facts map[string]interface{})
Configure sets the properties previously published by ListConfigurationOptions().
func (*CouplesAnalysis) Consume ¶
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 ¶
func (couples *CouplesAnalysis) Description() string
Description returns the text which explains what the analysis is doing.
func (*CouplesAnalysis) Deserialize ¶
func (couples *CouplesAnalysis) Deserialize(pbmessage []byte) (interface{}, error)
Deserialize converts the specified protobuf bytes to CouplesResult.
func (*CouplesAnalysis) Finalize ¶
func (couples *CouplesAnalysis) Finalize() interface{}
Finalize returns the result of the analysis. Further Consume() calls are not expected.
func (*CouplesAnalysis) Flag ¶
func (couples *CouplesAnalysis) Flag() string
Flag for the command line switch which enables this analysis.
func (*CouplesAnalysis) Fork ¶
func (couples *CouplesAnalysis) Fork(n int) []core.PipelineItem
Fork clones this pipeline item.
func (*CouplesAnalysis) Initialize ¶
func (couples *CouplesAnalysis) Initialize(repository *git.Repository)
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 ¶
func (couples *CouplesAnalysis) ListConfigurationOptions() []core.ConfigurationOption
ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
func (*CouplesAnalysis) MergeResults ¶
func (couples *CouplesAnalysis) MergeResults(r1, r2 interface{}, c1, c2 *core.CommonAnalysisResult) interface{}
MergeResults combines two CouplesAnalysis-s together.
func (*CouplesAnalysis) Name ¶
func (couples *CouplesAnalysis) Name() string
Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
func (*CouplesAnalysis) Provides ¶
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 ¶
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.
type CouplesResult ¶
type CouplesResult struct { PeopleMatrix []map[int]int64 PeopleFiles [][]int FilesMatrix []map[int]int64 Files []string // contains filtered or unexported fields }
CouplesResult is returned by CouplesAnalysis.Finalize() and carries couples matrices from authors and files.
type DenseHistory ¶
type DenseHistory = [][]int64
DenseHistory is the matrix [number of samples][number of bands] -> number of lines.
type FileHistory ¶
type FileHistory struct { core.NoopMerger core.OneShotMergeProcessor // contains filtered or unexported fields }
FileHistory contains the intermediate state which is mutated by Consume(). It should implement LeafPipelineItem.
func (*FileHistory) Configure ¶
func (history *FileHistory) Configure(facts map[string]interface{})
Configure sets the properties previously published by ListConfigurationOptions().
func (*FileHistory) Consume ¶
func (history *FileHistory) 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 (*FileHistory) Description ¶
func (history *FileHistory) Description() string
Description returns the text which explains what the analysis is doing.
func (*FileHistory) Finalize ¶
func (history *FileHistory) Finalize() interface{}
Finalize returns the result of the analysis. Further Consume() calls are not expected.
func (*FileHistory) Flag ¶
func (history *FileHistory) Flag() string
Flag for the command line switch which enables this analysis.
func (*FileHistory) Fork ¶
func (history *FileHistory) Fork(n int) []core.PipelineItem
Fork clones this PipelineItem.
func (*FileHistory) Initialize ¶
func (history *FileHistory) Initialize(repository *git.Repository)
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 (*FileHistory) ListConfigurationOptions ¶
func (history *FileHistory) ListConfigurationOptions() []core.ConfigurationOption
ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
func (*FileHistory) Name ¶
func (history *FileHistory) Name() string
Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
func (*FileHistory) Provides ¶
func (history *FileHistory) 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 (*FileHistory) Requires ¶
func (history *FileHistory) 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.
type FileHistoryResult ¶
FileHistoryResult is returned by Finalize() and represents the analysis result.
type NodeSummary ¶
NodeSummary carries the node attributes which annotate the "shotness" analysis' counters. These attributes are supposed to uniquely identify each node.
func (NodeSummary) String ¶
func (node NodeSummary) String() string
type ShotnessAnalysis ¶
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 ¶
func (shotness *ShotnessAnalysis) Configure(facts map[string]interface{})
Configure sets the properties previously published by ListConfigurationOptions().
func (*ShotnessAnalysis) Consume ¶
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 ¶
func (shotness *ShotnessAnalysis) Description() string
Description returns the text which explains what the analysis is doing.
func (*ShotnessAnalysis) Features ¶
func (shotness *ShotnessAnalysis) Features() []string
Features which must be enabled for this PipelineItem to be automatically inserted into the DAG.
func (*ShotnessAnalysis) Finalize ¶
func (shotness *ShotnessAnalysis) Finalize() interface{}
Finalize returns the result of the analysis. Further Consume() calls are not expected.
func (*ShotnessAnalysis) Flag ¶
func (shotness *ShotnessAnalysis) Flag() string
Flag returns the command line switch which activates the analysis.
func (*ShotnessAnalysis) Fork ¶
func (shotness *ShotnessAnalysis) Fork(n int) []core.PipelineItem
Fork clones this PipelineItem.
func (*ShotnessAnalysis) Initialize ¶
func (shotness *ShotnessAnalysis) Initialize(repository *git.Repository)
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 ¶
func (shotness *ShotnessAnalysis) ListConfigurationOptions() []core.ConfigurationOption
ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
func (*ShotnessAnalysis) Name ¶
func (shotness *ShotnessAnalysis) Name() string
Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
func (*ShotnessAnalysis) Provides ¶
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 ¶
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.
type ShotnessResult ¶
type ShotnessResult struct { Nodes []NodeSummary Counters []map[int]int }
ShotnessResult is returned by ShotnessAnalysis.Finalize() and represents the analysis result.