Class ProjectStats
java.lang.Object
edu.umd.cs.findbugs.ProjectStats
- All Implemented Interfaces:
XMLWriteable, Cloneable
Statistics resulting from analyzing a project.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Dateprivate final Footprint(package private) FileBugHashprivate booleanprivate booleanprivate final Stringprivate Stringprivate static final booleanprivate final SortedMap<String, PackageStats> private final Profilerprivate intprivate static final Stringprivate intprivate intprivate final int[]private intprivate int -
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.private PackageStatsgetPackageStats(String packageName) 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.
-
Field Details
-
TIMESTAMP_FORMAT
- See Also:
-
OMIT_PACKAGE_STATS
private static final boolean OMIT_PACKAGE_STATS -
packageStatsMap
-
totalErrors
private final int[] totalErrors -
totalClasses
private int totalClasses -
referencedClasses
private int referencedClasses -
totalSize
private int totalSize -
totalSizeFromPackageStats
private int totalSizeFromPackageStats -
totalClassesFromPackageStats
private int totalClassesFromPackageStats -
analysisTimestamp
-
hasClassStats
private boolean hasClassStats -
hasPackageStats
private boolean hasPackageStats -
baseFootprint
-
java_version
-
java_vm_version
-
profiler
-
fileBugHashes
FileBugHash fileBugHashes
-
-
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
-
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)
-