Class ProjectStats

java.lang.Object
edu.umd.cs.findbugs.ProjectStats
All Implemented Interfaces:
XMLWriteable, Cloneable

public class ProjectStats extends Object implements XMLWriteable, Cloneable
Statistics resulting from analyzing a project.
  • Constructor Details

    • ProjectStats

      public ProjectStats()
      Constructor. Creates an empty object.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hasClassStats

      public boolean hasClassStats()
    • hasPackageStats

      public boolean hasPackageStats()
    • clone

      public ProjectStats clone()
      Overrides:
      clone in class Object
    • getCodeSize

      public int getCodeSize()
    • getTotalBugs

      public int getTotalBugs()
    • getBugsOfPriority

      public int getBugsOfPriority(int priority)
    • setTimestamp

      public void setTimestamp(String timestamp) throws ParseException
      Set the timestamp for this analysis run.
      Parameters:
      timestamp - the time of the analysis run this ProjectStats represents, as previously reported by writeXML.
      Throws:
      ParseException
    • setTimestamp

      public void setTimestamp(long timestamp)
    • setVMVersion

      public void setVMVersion(String vm_version)
    • getNumClasses

      public int getNumClasses()
      Get the number of classes analyzed.
    • getBaseFootprint

      public Footprint getBaseFootprint()
      Returns:
      Returns the baseFootprint.
    • addClass

      public void addClass(@DottedClassName String className, @CheckForNull String sourceFile, boolean isInterface, int size)
      Report that a class has been analyzed.
      Parameters:
      className - the full name of the class
      sourceFile - TODO
      isInterface - true if the class is an interface
      size - a normalized class size value; see detect/FindBugsSummaryStats.
    • addClass

      public void addClass(@DottedClassName String className, @CheckForNull String sourceFile, boolean isInterface, int size, boolean updatePackageStats)
      Report that a class has been analyzed.
      Parameters:
      className - the full name of the class
      sourceFile - TODO
      isInterface - true if the class is an interface
      size - a normalized class size value; see detect/FindBugsSummaryStats.
      updatePackageStats - TODO
    • getClassStats

      @CheckForNull public PackageStats.ClassStats getClassStats(@DottedClassName String className)
      Report that a class has been analyzed.
      Parameters:
      className - the full name of the class
    • addBug

      public void addBug(BugInstance bug)
      Called when a bug is reported.
    • clearBugCounts

      public void clearBugCounts()
      Clear bug counts
    • purgeClassesThatDontMatch

      public void purgeClassesThatDontMatch(Pattern classPattern)
    • purgeClassStats

      public void purgeClassStats()
    • purgePackageStats

      public void purgePackageStats()
    • recomputeFromComponents

      public void recomputeFromComponents()
    • computeFileStats

      public void computeFileStats(BugCollection bugs)
    • writeXML

      public void writeXML(XMLOutput xmlOutput) throws IOException
      Output as XML.
      Specified by:
      writeXML in interface XMLWriteable
      Parameters:
      xmlOutput - the XMLOutput for the document
      Throws:
      IOException
    • writeXML

      public void writeXML(XMLOutput xmlOutput, boolean withMessages) throws IOException
      Output as XML.
      Throws:
      IOException
    • getFileHashes

      public Map<String,String> getFileHashes(BugCollection bugs)
    • reportSummary

      public void reportSummary(@WillClose OutputStream out) throws IOException
      Report statistics as an XML document to given output stream.
      Throws:
      IOException
    • transformSummaryToHTML

      public void transformSummaryToHTML(Writer htmlWriter) throws IOException, TransformerException
      Transform summary information to HTML.
      Parameters:
      htmlWriter - the Writer to write the HTML output to
      Throws:
      IOException
      TransformerException
    • getPackageStats

      public Collection<PackageStats> getPackageStats()
    • putPackageStats

      public void putPackageStats(String packageName, int numClasses, int size)
    • addStats

      public void addStats(ProjectStats stats2)
      Parameters:
      stats2 -
    • setReferencedClasses

      public void setReferencedClasses(int size)
      Parameters:
      size -
    • getReferencedClasses

      public int getReferencedClasses()
    • getProfiler

      public Profiler getProfiler()
      Returns:
      Returns the project profiler instance, never null
    • setTotalClasses

      public void setTotalClasses(int totalClasses)
    • setTotalSize

      public void setTotalSize(int totalSize)