Class RepositoryStatistics

java.lang.Object
io.jenkins.plugins.forensics.miner.RepositoryStatistics
All Implemented Interfaces:
Serializable

public class RepositoryStatistics extends Object implements Serializable
Provides access to the SCM commit statistics of all repository files up to a specific commit.
Author:
Ullrich Hafner
See Also:
  • Constructor Details Link icon

    • RepositoryStatistics Link icon

      public RepositoryStatistics()
      Creates an empty instance of RepositoryStatistics with no latest commit ID set.
    • RepositoryStatistics Link icon

      public RepositoryStatistics(String latestCommitId)
      Creates an empty instance of RepositoryStatistics.
      Parameters:
      latestCommitId - the ID of the latest commit that
  • Method Details Link icon

    • readResolve Link icon

      protected Object readResolve()
      Called after deserialization to retain backward compatibility.
      Returns:
      this
    • writeReplace Link icon

      protected Object writeReplace()
      Called before serialization to fill the fileStatistics field.
      Returns:
      this
    • isEmpty Link icon

      public boolean isEmpty()
      Returns whether the repository is empty.
      Returns:
      true if the repository is empty, false otherwise
    • getLatestCommitId Link icon

      public String getLatestCommitId()
      Returns the ID of the latest commit mined.
      Returns:
      ID of the latest commit.
    • hasLatestCommitId Link icon

      public boolean hasLatestCommitId()
      Returns whether the latest commit ID has been set.
      Returns:
      true if the latest commit ID has been set, false otherwise
    • size Link icon

      public int size()
      Returns the number of files in the repository.
      Returns:
      number of files in the repository
    • contains Link icon

      public boolean contains(String fileName)
      Returns whether the specified file is part of the repository.
      Parameters:
      fileName - the name of the file
      Returns:
      true if the file file is part of the repository, false otherwise
    • getFiles Link icon

      public Set<String> getFiles()
      Returns the absolute file names of the files that are part of the repository.
      Returns:
      the file names
    • getFileStatistics Link icon

      public Collection<FileStatistics> getFileStatistics()
      Returns the statistics for all repository files.
      Returns:
      the statistics
    • getMapping Link icon

      public Map<String,FileStatistics> getMapping()
      Returns the mapping of file names to statistics.
      Returns:
      the mapping of file names to statistics
    • get Link icon

      public FileStatistics get(String fileName)
      Returns the statistics for the specified file.
      Parameters:
      fileName - absolute file name
      Returns:
      the statistics for that file
      Throws:
      NoSuchElementException - if the file name is not registered
    • addAll Link icon

      public void addAll(List<CommitDiffItem> commits)
      Adds and inspects the specified commits.
      Parameters:
      commits - the additional commits
    • addAll Link icon

      public void addAll(Collection<FileStatistics> additionalStatistics)
      Adds all additional file statistics.
      Parameters:
      additionalStatistics - the additional statistics to add
    • addAll Link icon

      public void addAll(RepositoryStatistics additionalStatistics)
      Adds all additional file statistics.
      Parameters:
      additionalStatistics - the additional statistics to add
    • add Link icon

      public void add(FileStatistics additionalStatistics)
      Adds the additional file statistics instance.
      Parameters:
      additionalStatistics - the additional statistics to add
    • getTotalChurn Link icon

      public int getTotalChurn()
    • getTotalLinesOfCode Link icon

      public int getTotalLinesOfCode()
    • getLatestStatistics Link icon

      public CommitStatistics getLatestStatistics()
    • equals Link icon

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object