Package edu.umd.cs.findbugs
Class ProjectStats
java.lang.Object
edu.umd.cs.findbugs.ProjectStats
- All Implemented Interfaces:
XMLWriteable,Cloneable
Statistics resulting from analyzing a project.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBug(BugInstance bug) Called when a bug is reported.voidReport that a class has been analyzed.voidaddClass(String className, String sourceFile, boolean isInterface, int size, boolean updatePackageStats) Report that a class has been analyzed.voidaddStats(ProjectStats stats2) voidClear bug countsclone()voidintgetBugsOfPriority(int priority) getClassStats(String className) Report that a class has been analyzed.intgetFileHashes(BugCollection bugs) intGet the number of classes analyzed.intintbooleanbooleanvoidpurgeClassesThatDontMatch(Pattern classPattern) voidvoidvoidputPackageStats(String packageName, int numClasses, int size) voidvoidReport statistics as an XML document to given output stream.voidsetReferencedClasses(int size) voidsetTimestamp(long timestamp) voidsetTimestamp(String timestamp) Set the timestamp for this analysis run.voidsetTotalClasses(int totalClasses) voidsetTotalSize(int totalSize) voidsetVMVersion(String vm_version) toString()voidtransformSummaryToHTML(Writer htmlWriter) Transform summary information to HTML.voidOutput as XML.voidOutput as XML.
-
Constructor Details
-
ProjectStats
public ProjectStats()Constructor. Creates an empty object.
-
-
Method Details
-
toString
-
hasClassStats
public boolean hasClassStats() -
hasPackageStats
public boolean hasPackageStats() -
clone
-
getCodeSize
public int getCodeSize() -
getTotalBugs
public int getTotalBugs() -
getBugsOfPriority
public int getBugsOfPriority(int priority) -
setTimestamp
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
-
getNumClasses
public int getNumClasses()Get the number of classes analyzed. -
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 classsourceFile- TODOisInterface- true if the class is an interfacesize- 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 classsourceFile- TODOisInterface- true if the class is an interfacesize- a normalized class size value; see detect/FindBugsSummaryStats.updatePackageStats- TODO
-
getClassStats
Report that a class has been analyzed.- Parameters:
className- the full name of the class
-
addBug
Called when a bug is reported. -
clearBugCounts
public void clearBugCounts()Clear bug counts -
purgeClassesThatDontMatch
-
purgeClassStats
public void purgeClassStats() -
purgePackageStats
public void purgePackageStats() -
recomputeFromComponents
public void recomputeFromComponents() -
computeFileStats
-
writeXML
Output as XML.- Specified by:
writeXMLin interfaceXMLWriteable- Parameters:
xmlOutput- the XMLOutput for the document- Throws:
IOException
-
writeXML
Output as XML.- Throws:
IOException
-
getFileHashes
-
reportSummary
Report statistics as an XML document to given output stream.- Throws:
IOException
-
transformSummaryToHTML
Transform summary information to HTML.- Parameters:
htmlWriter- the Writer to write the HTML output to- Throws:
IOExceptionTransformerException
-
getPackageStats
-
putPackageStats
-
addStats
- Parameters:
stats2-
-
setReferencedClasses
public void setReferencedClasses(int size) - Parameters:
size-
-
getReferencedClasses
public int getReferencedClasses() -
getProfiler
- Returns:
- Returns the project profiler instance, never null
-
setTotalClasses
public void setTotalClasses(int totalClasses) -
setTotalSize
public void setTotalSize(int totalSize)
-