edu.umd.cs.findbugs
Class ProjectStats

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

public class ProjectStats
extends java.lang.Object
implements XMLWriteable, java.lang.Cloneable

Statistics resulting from analyzing a project.


Constructor Summary
ProjectStats()
          Constructor.
 
Method Summary
 void addBug(BugInstance bug)
          Called when a bug is reported.
 void addClass(java.lang.String className, boolean isInterface, int size)
          Report that a class has been analyzed.
 void clearBugCounts()
          Clear bug counts
 java.lang.Object clone()
           
 int getBugsOfPriority(int priority)
           
 PackageStats.ClassStats getClassStats(java.lang.String className)
          Report that a class has been analyzed.
 int getCodeSize()
           
 int getNumClasses()
          Get the number of classes analyzed.
 java.util.Collection<PackageStats> getPackageStats()
           
 int getTotalBugs()
           
 void reportSummary(java.io.OutputStream out)
          Report statistics as an XML document to given output stream.
 void setTimestamp(long timestamp)
           
 void setTimestamp(java.lang.String timestamp)
          Set the timestamp for this analysis run.
 void transformSummaryToHTML(java.io.Writer htmlWriter)
          Transform summary information to HTML.
 void writeXML(XMLOutput xmlOutput)
          Output as XML.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectStats

public ProjectStats()
Constructor. Creates an empty object.

Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getCodeSize

public int getCodeSize()

getTotalBugs

public int getTotalBugs()

getBugsOfPriority

public int getBugsOfPriority(int priority)

setTimestamp

public void setTimestamp(java.lang.String timestamp)
                  throws java.text.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:
java.text.ParseException

setTimestamp

public void setTimestamp(long timestamp)

getNumClasses

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


addClass

public void addClass(java.lang.String className,
                     boolean isInterface,
                     int size)
Report that a class has been analyzed.

Parameters:
className - the full name of the class
isInterface - true if the class is an interface
size - a normalized class size value; see detect/FindBugsSummaryStats.

getClassStats

public PackageStats.ClassStats getClassStats(java.lang.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


writeXML

public void writeXML(XMLOutput xmlOutput)
              throws java.io.IOException
Output as XML.

Specified by:
writeXML in interface XMLWriteable
Parameters:
xmlOutput - the XMLOutput for the document
Throws:
java.io.IOException

reportSummary

public void reportSummary(java.io.OutputStream out)
                   throws java.io.IOException
Report statistics as an XML document to given output stream.

Throws:
java.io.IOException

transformSummaryToHTML

public void transformSummaryToHTML(java.io.Writer htmlWriter)
                            throws java.io.IOException,
                                   javax.xml.transform.TransformerException
Transform summary information to HTML.

Parameters:
htmlWriter - the Writer to write the HTML output to
Throws:
java.io.IOException
javax.xml.transform.TransformerException

getPackageStats

public java.util.Collection<PackageStats> getPackageStats()