edu.umd.cs.findbugs

Class ProjectStats

public class ProjectStats extends Object implements XMLWriteable, Cloneable

Statistics resulting from analyzing a project.
Constructor Summary
ProjectStats()
Constructor.
Method Summary
voidaddBug(BugInstance bug)
Called when a bug is reported.
voidaddClass(String className, boolean isInterface, int size)
Report that a class has been analyzed.
voidaddClass(String className, String sourceFile, boolean isInterface, int size)
Report that a class has been analyzed.
voidaddStats(ProjectStats stats2)
voidclearBugCounts()
Clear bug counts
intgetBugsOfPriority(int priority)
PackageStats.ClassStatsgetClassStats(String className)
Report that a class has been analyzed.
intgetCodeSize()
intgetNumClasses()
Get the number of classes analyzed.
Collection<PackageStats>getPackageStats()
intgetTotalBugs()
voidrecomputeFromClassStats()
voidreportSummary(OutputStream out)
Report statistics as an XML document to given output stream.
voidsetTimestamp(String timestamp)
Set the timestamp for this analysis run.
voidsetTimestamp(long timestamp)
voidtransformSummaryToHTML(Writer htmlWriter)
Transform summary information to HTML.
voidwriteXML(XMLOutput xmlOutput)
Output as XML.

Constructor Detail

ProjectStats

public ProjectStats()
Constructor. Creates an empty object.

Method Detail

addBug

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

addClass

public void addClass(String className, boolean isInterface, int size)

Deprecated: Use ProjectStats instead

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.

addClass

public void addClass(String className, 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.

addStats

public void addStats(ProjectStats stats2)

Parameters: stats2

clearBugCounts

public void clearBugCounts()
Clear bug counts

getBugsOfPriority

public int getBugsOfPriority(int priority)

getClassStats

public PackageStats.ClassStats getClassStats(String className)
Report that a class has been analyzed.

Parameters: className the full name of the class

getCodeSize

public int getCodeSize()

getNumClasses

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

getPackageStats

public Collection<PackageStats> getPackageStats()

getTotalBugs

public int getTotalBugs()

recomputeFromClassStats

public void recomputeFromClassStats()

reportSummary

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

setTimestamp

public void setTimestamp(String timestamp)
Set the timestamp for this analysis run.

Parameters: timestamp the time of the analysis run this ProjectStats represents, as previously reported by writeXML.

setTimestamp

public void setTimestamp(long timestamp)

transformSummaryToHTML

public void transformSummaryToHTML(Writer htmlWriter)
Transform summary information to HTML.

Parameters: htmlWriter the Writer to write the HTML output to

writeXML

public void writeXML(XMLOutput xmlOutput)
Output as XML.
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.