Class CommitStatistics
java.lang.Object
io.jenkins.plugins.forensics.miner.CommitStatistics
- All Implemented Interfaces:
Serializable
Computes and stores aggregated statistics for a collection of commits.
- Author:
- Ullrich Hafner
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates emptyCommitStatistics.CommitStatistics(Collection<? extends CommitDiffItem> commits) Creates a new instance ofCommitStatistics. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcountChanges(Collection<? extends CommitDiffItem> commits) Counts the number of CHANGE commits.static intcountDeletes(Collection<? extends CommitDiffItem> commits) Counts the number of DELETE commits.static intcountMoves(Collection<? extends CommitDiffItem> commits) Counts the number of RENAME commits.booleanintintintintintintintinthashCode()static voidlogCommits(List<CommitDiffItem> commits, edu.hm.hafner.util.FilteredLog logger) Prints a summary of the specified commits to the specified logger.toString()
-
Constructor Details
-
CommitStatistics
Creates a new instance ofCommitStatistics.- Parameters:
commits- the commits to aggregate the statistics for
-
CommitStatistics
public CommitStatistics()Creates emptyCommitStatistics.
-
-
Method Details
-
getAddedLines
public int getAddedLines() -
getDeletedLines
public int getDeletedLines() -
getLinesOfCode
public int getLinesOfCode() -
getAbsoluteChurn
public int getAbsoluteChurn() -
getAuthorCount
public int getAuthorCount() -
getCommitCount
public int getCommitCount() -
getFilesCount
public int getFilesCount() -
equals
-
hashCode
public int hashCode() -
toString
-
countMoves
Counts the number of RENAME commits. A rename commit is a commit where an existing file has been moved to a new location.- Parameters:
commits- the commits to analyze- Returns:
- number of RENAME commits
-
countDeletes
Counts the number of DELETE commits. A delete commit is a commit where an existing file has been deleted.- Parameters:
commits- the commits to analyze- Returns:
- number of DELETE commits
-
countChanges
Counts the number of CHANGE commits. A change commit is a commit where an existing file has been changed.- Parameters:
commits- the commits to analyze- Returns:
- number of RENAME commits
-
logCommits
Prints a summary of the specified commits to the specified logger.- Parameters:
commits- the commits to summarizelogger- the logger
-