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 TypeMethodDescriptionvoid
addBug
(BugInstance bug) Called when a bug is reported.void
Report that a class has been analyzed.void
addClass
(String className, String sourceFile, boolean isInterface, int size, boolean updatePackageStats) Report that a class has been analyzed.void
addStats
(ProjectStats stats2) void
Clear bug countsclone()
void
int
getBugsOfPriority
(int priority) getClassStats
(String className) Report that a class has been analyzed.int
getFileHashes
(BugCollection bugs) int
Get the number of classes analyzed.int
int
boolean
boolean
void
purgeClassesThatDontMatch
(Pattern classPattern) void
void
void
putPackageStats
(String packageName, int numClasses, int size) void
void
Report statistics as an XML document to given output stream.void
setReferencedClasses
(int size) void
setTimestamp
(long timestamp) void
setTimestamp
(String timestamp) Set the timestamp for this analysis run.void
setTotalClasses
(int totalClasses) void
setTotalSize
(int totalSize) void
setVMVersion
(String vm_version) toString()
void
transformSummaryToHTML
(Writer htmlWriter) Transform summary information to HTML.void
Output as XML.void
Output 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:
writeXML
in 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:
IOException
TransformerException
-
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)
-