SortedBugCollection.java

Index Score
edu.umd.cs.findbugs
FindBugs

View: Reasons, Metrics, Source Code

These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.

MetricDescription
RETURNSNumber of return points from functions
EXITSProcedure exits
INTERFACE_COMPLEXITYInterface complexity
DECL_COMMENTSComments in declarations
JAVA0034JAVA0034 Missing braces in if statement
LINE_COMMENTNumber of line comments
UNIQUE_OPERANDSNumber of unique operands
EXEC_COMMENTSComments in executable code
LOGICAL_LINESNumber of statements
FUNCTIONSNumber of function declarations
PROGRAM_VOCABHalstead program vocabulary
CYCLOMATICCyclomatic complexity
PROGRAM_LENGTHHalstead program length
OPERANDSNumber of operands
OPERATORSNumber of operators
SIZESize of the file in bytes
BLOCKSNumber of blocks
ELOCEffective lines of code
LINESNumber of lines in the source file
PARAMSNumber of formal parameter declarations
LOCLines of code
JAVA0115JAVA0115 Incorrect javadoc: no @throws or @exception tag for 'exception'
JAVA0254JAVA0254 Use enhanced for loop construct instead of Iterator
COMMENTSComment lines
COMPARISONSNumber of comparison operators
JAVA0117JAVA0117 Missing javadoc: method 'method'
LOOPSNumber of loops
JAVA0285JAVA0285 Dereference of potentially null variable
WHITESPACENumber of whitespace lines
JAVA0145JAVA0145 Tab character used in source file
DOC_COMMENTNumber of javadoc comment lines
UNIQUE_OPERATORSNumber of unique operators
JAVA0036JAVA0036 Missing braces in while statement
JAVA0130JAVA0130 Non-static method does not use instance fields
JAVA0093JAVA0093 Redundant assignment
JAVA0177JAVA0177 Variable declaration missing initializer
NEST_DEPTHMaximum nesting depth
JAVA0094JAVA0094 Field hides a superclass field
PROGRAM_VOLUMEHalstead program volume
JAVA0136JAVA0136 N methods defined in class (maximum: M)
JAVA0126JAVA0126 Method declares unchecked exception in throws
BLOCK_COMMENTNumber of block comment lines
JAVA0067JAVA0067 Array descriptor on identifier name
JAVA0100JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0108JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
/* * FindBugs - Find bugs in Java programs * Copyright (C) 2003-2008 University of Maryland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package edu.umd.cs.findbugs; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Reader; import java.io.StringWriter; import java.math.BigInteger; import java.security.MessageDigest; import java.util.Collection; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; import java.util.zip.GZIPInputStream; import javax.annotation.WillClose; import javax.xml.transform.TransformerException; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.DocumentFactory; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; import edu.umd.cs.findbugs.ba.AnalysisContext; import edu.umd.cs.findbugs.ba.MissingClassException; import edu.umd.cs.findbugs.model.ClassFeatureSet; import edu.umd.cs.findbugs.util.Util; import edu.umd.cs.findbugs.xml.Dom4JXMLOutput; import edu.umd.cs.findbugs.xml.OutputStreamXMLOutput; import edu.umd.cs.findbugs.xml.XMLAttributeList; import edu.umd.cs.findbugs.xml.XMLOutput; import edu.umd.cs.findbugs.xml.XMLOutputUtil; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; /** * An implementation of {@link BugCollection} that keeps the BugInstances * sorted by class (using the native comparison ordering of BugInstance's * compareTo() method as a tie-breaker). * * @see BugInstance * @author David Hovemeyer */ public class SortedBugCollection implements BugCollection { long analysisTimestamp = System.currentTimeMillis(); String analysisVersion = Version.RELEASE; private boolean withMessages = false; private static final boolean REPORT_SUMMARY_HTML = SystemProperties.getBoolean("findbugs.report.SummaryHTML"); public long getAnalysisTimestamp() { return analysisTimestamp; } public void setAnalysisTimestamp(long timestamp) { analysisTimestamp = timestamp; } /** * Add a Collection of BugInstances to this BugCollection object. * This just calls add(BugInstance) for each instance in the input collection. * * @param collection the Collection of BugInstances to add */ public void addAll(Collection<BugInstance> collection) { for (BugInstance aCollection : collection) { add(aCollection); } } /** * Add a Collection of BugInstances to this BugCollection object. * * @param collection the Collection of BugInstances to add * @param updateActiveTime true if active time of added BugInstances should * be updated to match collection: false if not */ public void addAll(Collection<BugInstance> collection, boolean updateActiveTime) { for (BugInstance warning : collection) { add(warning, updateActiveTime); } } /** * Add a BugInstance to this BugCollection. * This just calls add(bugInstance, true). * * @param bugInstance the BugInstance * @return true if the BugInstance was added, or false if a matching * BugInstance was already in the BugCollection */ public boolean add(BugInstance bugInstance) { return add(bugInstance, true); } /** * Add an analysis error. * * @param message the error message */ public void addError(String message) { addError(message, null); } /** * Get the current AppVersion. */ public AppVersion getCurrentAppVersion() { return new AppVersion(getSequenceNumber()) .setReleaseName(getReleaseName()) .setTimestamp(getTimestamp()) .setNumClasses(getProjectStats().getNumClasses()) .setCodeSize(getProjectStats().getCodeSize()); } /** * Read XML data from given file into this object, * populating given Project as a side effect. * * @param fileName name of the file to read * @param project the Project */ public void readXML(String fileName, Project project) throws IOException, DocumentException { readXML(new File(fileName), project); } /** * Read XML data from given file into this object, * populating given Project as a side effect. * * @param file the file * @param project the Project */ public void readXML(File file, Project project) throws IOException, DocumentException { project.setCurrentWorkingDirectory(file.getParentFile()); InputStream in = new BufferedInputStream(new FileInputStream(file)); if (file.getName().endsWith(".gz")) { try { in = new GZIPInputStream(in); } catch (IOException e) { in.close(); throw e; } } readXML(in, project, file); } /** * Read XML data from given input stream into this * object, populating the Project as a side effect. * An attempt will be made to close the input stream * (even if an exception is thrown). * * @param in the InputStream * @param project the Project */ public void readXML(@WillClose InputStream in, Project project, File base) throws IOException, DocumentException { //if (in == null) throw new IllegalArgumentException(); assert in != null; assert project != null; try { //if (project == null) throw new IllegalArgumentException(); doReadXML(in, project, base); } finally { in.close(); } } public void readXML(@WillClose InputStream in, Project project) throws IOException, DocumentException { doReadXML(in, project, null); } private void doReadXML(@WillClose InputStream in, Project project, File base) throws IOException, DocumentException { try { checkInputStream(in); SAXBugCollectionHandler handler = new SAXBugCollectionHandler(this, project, base); XMLReader xr = null; try { xr = XMLReaderFactory.createXMLReader(); } catch (SAXException e) { AnalysisContext.logError("Couldn't create XMLReaderFactory", e); } xr.setContentHandler(handler); xr.setErrorHandler(handler); Reader reader = Util.getReader(in); xr.parse(new InputSource(reader)); } catch (SAXParseException e) { throw new DocumentException("Parse error at line " + e.getLineNumber() + " : " + e.getColumnNumber(), e); } catch (SAXException e) { // FIXME: throw SAXException from method? throw new DocumentException("Sax error ", e); } finally { in.close(); } // Presumably, project is now up-to-date project.setModified(false); } /** * Write this BugCollection to a file as XML. * * @param fileName the file to write to * @param project the Project from which the BugCollection was generated */ public void writeXML(String fileName, Project project) throws IOException { BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(fileName)); writeXML(out, project); } /** * Write this BugCollection to a file as XML. * * @param file the file to write to * @param project the Project from which the BugCollection was generated */ public void writeXML(File file, Project project) throws IOException { BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file)); writeXML(out, project); } /** * Convert the BugCollection into a dom4j Document object. * * @param project the Project from which the BugCollection was generated * @return the Document representing the BugCollection as a dom4j tree */ public Document toDocument(@Nonnull Project project) { //if (project == null) throw new NullPointerException("No project"); assert project != null; DocumentFactory docFactory = new DocumentFactory(); Document document = docFactory.createDocument(); Dom4JXMLOutput treeBuilder = new Dom4JXMLOutput(document); try { writeXML(treeBuilder, project); } catch (IOException e) { // Can't happen } return document; } /** * Write the BugCollection to given output stream as XML. * The output stream will be closed, even if an exception is thrown. * * @param out the OutputStream to write to * @param project the Project from which the BugCollection was generated */ public void writeXML(@WillClose OutputStream out, @Nonnull Project project) throws IOException { assert project != null; XMLOutput xmlOutput; //if (project == null) throw new NullPointerException("No project"); if (withMessages) { xmlOutput= new OutputStreamXMLOutput(out, "http://findbugs.sourceforge.net/xsl/default.xsl"); } else { xmlOutput= new OutputStreamXMLOutput(out); } writeXML(xmlOutput, project); } public void writePrologue(XMLOutput xmlOutput, Project project) throws IOException { xmlOutput.beginDocument(); xmlOutput.openTag(ROOT_ELEMENT_NAME, new XMLAttributeList() .addAttribute("version", analysisVersion) .addAttribute("sequence",String.valueOf(getSequenceNumber())) .addAttribute("timestamp", String.valueOf(getTimestamp())) .addAttribute("analysisTimestamp", String.valueOf(getAnalysisTimestamp())) .addAttribute("release", getReleaseName()) ); project.writeXML(xmlOutput); } // private String getQuickInstanceHash(BugInstance bugInstance) { // String hash = bugInstance.getInstanceHash(); // if (hash != null) return hash; // MessageDigest digest = null; // try { digest = MessageDigest.getInstance("MD5"); // } catch (Exception e2) { // // OK, we won't digest // assert true; // } // hash = bugInstance.getInstanceKey(); // if (digest != null) { // byte [] data = digest.digest(hash.getBytes()); // String tmp = new BigInteger(1,data).toString(16); // if (false) System.out.println(hash + " -> " + tmp); // hash = tmp; // } // bugInstance.setInstanceHash(hash); // return hash; // } public void computeBugHashes() { if (preciseHashOccurrenceNumbersAvailable) return; invalidateHashes(); MessageDigest digest = null; try { digest = MessageDigest.getInstance("MD5"); } catch (Exception e2) { // OK, we won't digest } HashMap<String, Integer> seen = new HashMap<String, Integer>(); for(BugInstance bugInstance : getCollection()) { String hash = bugInstance.getInstanceHash(); if (hash == null) { hash = bugInstance.getInstanceKey(); if (digest != null) { byte [] data = digest.digest(hash.getBytes()); String tmp = new BigInteger(1,data).toString(16); if (false) System.out.println(hash + " -> " + tmp); hash = tmp; } bugInstance.setInstanceHash(hash); } Integer count = seen.get(hash); if (count == null) { bugInstance.setInstanceOccurrenceNum(0); seen.put(hash,0); } else { bugInstance.setInstanceOccurrenceNum(count+1); seen.put(hash, count+1); } } for(BugInstance bugInstance : getCollection()) bugInstance.setInstanceOccurrenceMax(seen.get(bugInstance.getInstanceHash())); preciseHashOccurrenceNumbersAvailable = true; } /** * Write the BugCollection to an XMLOutput object. * The finish() method of the XMLOutput object is guaranteed * to be called. * * <p> * To write the SummaryHTML element, set property * findbugs.report.SummaryHTML to "true". * </p> * * @param xmlOutput the XMLOutput object * @param project the Project from which the BugCollection was generated */ public void writeXML(@WillClose XMLOutput xmlOutput, @Nonnull Project project) throws IOException { assert project != null; try { writePrologue(xmlOutput, project); if (withMessages) { computeBugHashes(); getProjectStats().computeFileStats(this); String commonBase = null; for(String s : project.getSourceDirList()) { if (commonBase == null) commonBase = s; else commonBase = commonBase.substring(0, commonPrefix(commonBase, s)); } if (commonBase != null && commonBase.length() > 0) { if (commonBase.indexOf("/./") > 0) commonBase = commonBase.substring(0,commonBase.indexOf("/.")); File base = new File(commonBase); if (base.exists() && base.isDirectory() && base.canRead()) SourceLineAnnotation.generateRelativeSource(base, project); } } if (earlyStats) getProjectStats().writeXML(xmlOutput,withMessages); // Write BugInstances for(BugInstance bugInstance : getCollection()) bugInstance.writeXML(xmlOutput, withMessages, false); writeEpilogue(xmlOutput); } finally { xmlOutput.finish(); SourceLineAnnotation.clearGenerateRelativeSource(); } } int commonPrefix(String s1, String s2) { int pos = 0; while (pos < s1.length() && pos < s2.length() && s1.charAt(pos) == s2.charAt(pos)) pos++; return pos; } boolean earlyStats = SystemProperties.getBoolean("findbugs.report.summaryFirst"); public void writeEpilogue(XMLOutput xmlOutput) throws IOException { if (withMessages) { writeBugCategories( xmlOutput); writeBugPatterns( xmlOutput); writeBugCodes( xmlOutput); } // Errors, missing classes emitErrors(xmlOutput); if (!earlyStats) { // Statistics getProjectStats().writeXML(xmlOutput, withMessages); } // // Class and method hashes // xmlOutput.openTag(CLASS_HASHES_ELEMENT_NAME); // for (Iterator<ClassHash> i = classHashIterator(); i.hasNext();) { // ClassHash classHash = i.next(); // classHash.writeXML(xmlOutput); // } // xmlOutput.closeTag(CLASS_HASHES_ELEMENT_NAME); // Class features xmlOutput.openTag("ClassFeatures"); for (Iterator<ClassFeatureSet> i = classFeatureSetIterator(); i.hasNext();) { ClassFeatureSet classFeatureSet = i.next(); classFeatureSet.writeXML(xmlOutput); } xmlOutput.closeTag("ClassFeatures"); // AppVersions xmlOutput.openTag(HISTORY_ELEMENT_NAME); for (Iterator<AppVersion> i = appVersionIterator(); i.hasNext();) { AppVersion appVersion = i.next(); appVersion.writeXML(xmlOutput); } xmlOutput.closeTag(HISTORY_ELEMENT_NAME); // Summary HTML if ( REPORT_SUMMARY_HTML ) { String html = getSummaryHTML(); if (html != null && !html.equals("")) { xmlOutput.openTag(SUMMARY_HTML_ELEMENT_NAME); xmlOutput.writeCDATA(html); xmlOutput.closeTag(SUMMARY_HTML_ELEMENT_NAME); } } xmlOutput.closeTag(ROOT_ELEMENT_NAME); } private void writeBugPatterns(XMLOutput xmlOutput) throws IOException { // Find bug types reported Set<String> bugTypeSet = new HashSet<String>(); for (Iterator<BugInstance> i = iterator(); i.hasNext();) { BugInstance bugInstance = i.next(); BugPattern bugPattern = bugInstance.getBugPattern(); if (bugPattern != null) { bugTypeSet.add(bugPattern.getType()); } } // Emit element describing each reported bug pattern for (String bugType : bugTypeSet) { BugPattern bugPattern = I18N.instance().lookupBugPattern(bugType); if (bugPattern == null) continue; XMLAttributeList attributeList = new XMLAttributeList(); attributeList.addAttribute("type", bugType); attributeList.addAttribute("abbrev", bugPattern.getAbbrev()); attributeList.addAttribute("category", bugPattern.getCategory()); if (bugPattern.getCWEid() != 0) { attributeList.addAttribute("cweid", Integer.toString(bugPattern.getCWEid())); } xmlOutput.openTag("BugPattern", attributeList); xmlOutput.openTag("ShortDescription"); xmlOutput.writeText(bugPattern.getShortDescription()); xmlOutput.closeTag("ShortDescription"); xmlOutput.openTag("Details"); xmlOutput.writeCDATA(bugPattern.getDetailText()); xmlOutput.closeTag("Details"); xmlOutput.closeTag("BugPattern"); } } private void writeBugCodes(XMLOutput xmlOutput) throws IOException { // Find bug codes reported Set<String> bugCodeSet = new HashSet<String>(); for (Iterator<BugInstance> i = iterator(); i.hasNext();) { BugInstance bugInstance = i.next(); String bugCode = bugInstance.getAbbrev(); if (bugCode != null) { bugCodeSet.add(bugCode); } } // Emit element describing each reported bug code for (String bugCodeAbbrev : bugCodeSet) { BugCode bugCode = I18N.instance().getBugCode(bugCodeAbbrev); String bugCodeDescription = bugCode.getDescription(); if (bugCodeDescription == null) continue; XMLAttributeList attributeList = new XMLAttributeList(); attributeList.addAttribute("abbrev", bugCodeAbbrev); if (bugCode.getCWEid() != 0) { attributeList.addAttribute("cweid", Integer.toString(bugCode.getCWEid())); } xmlOutput.openTag("BugCode", attributeList); xmlOutput.openTag("Description"); xmlOutput.writeText(bugCodeDescription); xmlOutput.closeTag("Description"); xmlOutput.closeTag("BugCode"); } } private void writeBugCategories(XMLOutput xmlOutput) throws IOException { // Find bug categories reported Set<String> bugCatSet = new HashSet<String>(); for (Iterator<BugInstance> i = iterator(); i.hasNext();) { BugInstance bugInstance = i.next(); BugPattern bugPattern = bugInstance.getBugPattern(); if (bugPattern != null) { bugCatSet.add(bugPattern.getCategory()); } } // Emit element describing each reported bug code for (String bugCat : bugCatSet) { String bugCatDescription = I18N.instance().getBugCategoryDescription(bugCat); if (bugCatDescription == null) continue; XMLAttributeList attributeList = new XMLAttributeList(); attributeList.addAttribute("category", bugCat); xmlOutput.openTag("BugCategory", attributeList); xmlOutput.openTag("Description"); xmlOutput.writeText(bugCatDescription); xmlOutput.closeTag("Description"); xmlOutput.closeTag("BugCategory"); } } private void emitErrors(XMLOutput xmlOutput) throws IOException { //System.err.println("Writing errors to XML output"); xmlOutput.openTag(ERRORS_ELEMENT_NAME); // Emit Error elements describing analysis errors for (Iterator<AnalysisError> i = errorIterator(); i.hasNext(); ) { AnalysisError error = i.next(); xmlOutput.openTag(ERROR_ELEMENT_NAME); xmlOutput.openTag(ERROR_MESSAGE_ELEMENT_NAME); xmlOutput.writeText(error.getMessage()); xmlOutput.closeTag(ERROR_MESSAGE_ELEMENT_NAME); if (error.getExceptionMessage() != null) { xmlOutput.openTag(ERROR_EXCEPTION_ELEMENT_NAME); xmlOutput.writeText(error.getExceptionMessage()); xmlOutput.closeTag(ERROR_EXCEPTION_ELEMENT_NAME); String stackTrace[] = error.getStackTrace(); if (stackTrace != null) { for (String aStackTrace : stackTrace) { xmlOutput.openTag(ERROR_STACK_TRACE_ELEMENT_NAME); xmlOutput.writeText(aStackTrace); xmlOutput.closeTag(ERROR_STACK_TRACE_ELEMENT_NAME); } } if (false && error.getNestedExceptionMessage() != null) { xmlOutput.openTag(ERROR_EXCEPTION_ELEMENT_NAME); xmlOutput.writeText(error.getNestedExceptionMessage()); xmlOutput.closeTag(ERROR_EXCEPTION_ELEMENT_NAME); stackTrace = error.getNestedStackTrace(); if (stackTrace != null) { for (String aStackTrace : stackTrace) { xmlOutput.openTag(ERROR_STACK_TRACE_ELEMENT_NAME); xmlOutput.writeText(aStackTrace); xmlOutput.closeTag(ERROR_STACK_TRACE_ELEMENT_NAME); } } } } xmlOutput.closeTag(ERROR_ELEMENT_NAME); } // Emit missing classes XMLOutputUtil.writeElementList(xmlOutput, MISSING_CLASS_ELEMENT_NAME, missingClassIterator()); xmlOutput.closeTag(ERRORS_ELEMENT_NAME); } private void checkInputStream(InputStream in) throws IOException { if (in.markSupported()) { byte[] buf = new byte[200]; in.mark(buf.length); int numRead = 0; boolean isEOF = false; while (numRead < buf.length && !isEOF) { int n = in.read(buf, numRead, buf.length - numRead); if (n < 0) { isEOF = true; } else { numRead += n; } } in.reset(); BufferedReader reader = new BufferedReader(Util.getReader(new ByteArrayInputStream(buf))); try { String line; while ((line = reader.readLine()) != null) { if (line.startsWith("<BugCollection")) { return; } } } finally { reader.close(); } throw new IOException("XML does not contain saved bug data"); } } /** * Clone all of the BugInstance objects in the source Collection * and add them to the destination Collection. * * @param dest the destination Collection * @param source the source Collection */ public static void cloneAll(Collection<BugInstance> dest, Collection<BugInstance> source) { for (BugInstance obj : source) { dest.add((BugInstance) obj.clone()); } } public static class BugInstanceComparator implements Comparator<BugInstance> { private BugInstanceComparator() {} public int compare(BugInstance lhs, BugInstance rhs) { ClassAnnotation lca = lhs.getPrimaryClass(); ClassAnnotation rca = rhs.getPrimaryClass(); if (lca == null || rca == null) throw new IllegalStateException("null class annotation: " + lca + "," + rca); int cmp = lca.getClassName().compareTo(rca.getClassName()); if (cmp != 0) return cmp; return lhs.compareTo(rhs); } public static final BugInstanceComparator instance = new BugInstanceComparator(); } public static class MultiversionBugInstanceComparator extends BugInstanceComparator { @Override public int compare(BugInstance lhs, BugInstance rhs) { int result = super.compare(lhs,rhs); if (result != 0) return result; long diff = lhs.getFirstVersion() - rhs.getFirstVersion(); if (diff == 0) diff = lhs.getLastVersion() - rhs.getLastVersion(); if (diff < 0) return -1; if (diff > 0) return 1; return 0; } public static final MultiversionBugInstanceComparator instance = new MultiversionBugInstanceComparator(); } private Comparator<BugInstance> comparator; private TreeSet<BugInstance> bugSet; private LinkedHashSet<AnalysisError> errorList; private TreeSet<String> missingClassSet; @CheckForNull private String summaryHTML; private ProjectStats projectStats; // private Map<String, ClassHash> classHashMap; private Map<String, ClassFeatureSet> classFeatureSetMap; private List<AppVersion> appVersionList; private boolean preciseHashOccurrenceNumbersAvailable = false; /** * Sequence number of the most-recently analyzed version * of the code. */ private long sequence; /** * Release name of the analyzed application. */ private String releaseName; /** * Current analysis timestamp. */ private long timestamp; /** * Constructor. * Creates an empty object. */ public SortedBugCollection() { this(new ProjectStats()); } /** * Constructor. * Creates an empty object. */ public SortedBugCollection(Comparator<BugInstance> comparator) { this(new ProjectStats(), comparator); } /** * Constructor. * Creates an empty object given an existing ProjectStats. * * @param projectStats the ProjectStats */ public SortedBugCollection(ProjectStats projectStats) { this(projectStats, MultiversionBugInstanceComparator.instance); } /** * Constructor. * Creates an empty object given an existing ProjectStats. * * @param projectStats the ProjectStats * @param comparator to use for sorting bug instances */ public SortedBugCollection(ProjectStats projectStats, Comparator<BugInstance> comparator) { this.projectStats = projectStats; this.comparator = comparator; bugSet = new TreeSet<BugInstance>(comparator); errorList = new LinkedHashSet<AnalysisError>() { @Override public boolean add(AnalysisError a) { if (this.size() > 1000) return false; return super.add(a); } }; missingClassSet = new TreeSet<String>(); summaryHTML = null; classFeatureSetMap = new TreeMap<String, ClassFeatureSet>(); sequence = 0L; appVersionList = new LinkedList<AppVersion>(); releaseName = ""; timestamp = -1L; } public boolean add(BugInstance bugInstance, boolean updateActiveTime) { preciseHashOccurrenceNumbersAvailable = false; if (updateActiveTime) { bugInstance.setFirstVersion(sequence); } return bugSet.add(bugInstance); } private void invalidateHashes() { preciseHashOccurrenceNumbersAvailable = false; } public boolean remove(BugInstance bugInstance) { invalidateHashes(); return bugSet.remove(bugInstance); } public Iterator<BugInstance> iterator() { return bugSet.iterator(); } public Collection<BugInstance> getCollection() { return bugSet; } public void addError(String message, Throwable exception) { if (exception instanceof MissingClassException) { MissingClassException e = (MissingClassException) exception; addMissingClass(AbstractBugReporter.getMissingClassName(e.getClassNotFoundException())); return; } if (exception instanceof ClassNotFoundException) { ClassNotFoundException e = (ClassNotFoundException) exception; addMissingClass(AbstractBugReporter.getMissingClassName(e)); return; } if (exception instanceof edu.umd.cs.findbugs.classfile.MissingClassException) { edu.umd.cs.findbugs.classfile.MissingClassException e = (edu.umd.cs.findbugs.classfile.MissingClassException) exception; addMissingClass(AbstractBugReporter.getMissingClassName(e.toClassNotFoundException())); return; } errorList.add(new AnalysisError(message, exception)); } public void addError(AnalysisError error) { errorList.add(error); } public void addMissingClass(String className) { if (className.length() == 0) return; if (className.startsWith("[")) { assert false : "Bad class name " + className; return; } missingClassSet.add(className); } public Iterator<AnalysisError> errorIterator() { return errorList.iterator(); } public Iterator<String> missingClassIterator() { return missingClassSet.iterator(); } public boolean contains(BugInstance bugInstance) { return bugSet.contains(bugInstance); } public BugInstance getMatching(BugInstance bugInstance) { SortedSet<BugInstance> tailSet = bugSet.tailSet(bugInstance); if (tailSet.isEmpty()) return null; BugInstance first = tailSet.first(); return bugInstance.equals(first) ? first : null; } public String getSummaryHTML() throws IOException { if ( summaryHTML == null ) { try { StringWriter writer = new StringWriter(); ProjectStats stats = getProjectStats(); stats.transformSummaryToHTML(writer); summaryHTML = writer.toString(); } catch (final TransformerException e) { IOException ioe = new IOException("Couldn't generate summary HTML"); ioe.initCause(e); throw ioe; } } return summaryHTML; } public ProjectStats getProjectStats() { return projectStats; } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#lookupFromUniqueId(java.lang.String) */ @Deprecated public BugInstance lookupFromUniqueId(String uniqueId) { for(BugInstance bug : bugSet) if (bug.getInstanceHash().equals(uniqueId)) return bug; return null; } public long getSequenceNumber() { return sequence; } public void setSequenceNumber(long sequence) { this.sequence = sequence; } public SortedBugCollection duplicate() { SortedBugCollection dup = new SortedBugCollection((ProjectStats) projectStats.clone(), comparator); SortedBugCollection.cloneAll(dup.bugSet, this.bugSet); dup.errorList.addAll(this.errorList); dup.missingClassSet.addAll(this.missingClassSet); dup.summaryHTML = this.summaryHTML; // dup.classHashMap.putAll(this.classHashMap); dup.classFeatureSetMap.putAll(this.classFeatureSetMap); dup.sequence = this.sequence; dup.timestamp = this.timestamp; dup.releaseName = this.releaseName; for (AppVersion appVersion : appVersionList) { dup.appVersionList.add((AppVersion) appVersion.clone()); } return dup; } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#clearBugInstances() */ public void clearBugInstances() { bugSet.clear(); invalidateHashes(); } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#getReleaseName() */ public String getReleaseName() { if (releaseName == null) return ""; return releaseName; } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#setReleaseName(java.lang.String) */ public void setReleaseName(String releaseName) { this.releaseName = releaseName; } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#appVersionIterator() */ public Iterator<AppVersion> appVersionIterator() { return appVersionList.iterator(); } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#addAppVersion(edu.umd.cs.findbugs.AppVersion) */ public void addAppVersion(AppVersion appVersion) { appVersionList.add(appVersion); } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#clearAppVersions() */ public void clearAppVersions() { appVersionList.clear(); } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#createEmptyCollectionWithMetadata() */ public SortedBugCollection createEmptyCollectionWithMetadata() { SortedBugCollection dup = new SortedBugCollection((ProjectStats) projectStats.clone(), comparator); dup.errorList.addAll(this.errorList); dup.missingClassSet.addAll(this.missingClassSet); dup.summaryHTML = this.summaryHTML; dup.classFeatureSetMap.putAll(this.classFeatureSetMap); dup.sequence = this.sequence; dup.analysisVersion = this.analysisVersion; dup.analysisTimestamp = dup.analysisTimestamp; dup.timestamp = this.timestamp; dup.releaseName = this.releaseName; for (AppVersion appVersion : appVersionList) { dup.appVersionList.add((AppVersion) appVersion.clone()); } return dup; } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#setTimestamp(long) */ public void setTimestamp(long timestamp) { this.timestamp = timestamp; } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#getTimestamp() */ public long getTimestamp() { return timestamp; } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#getClassFeatureSet(java.lang.String) */ public ClassFeatureSet getClassFeatureSet(String className) { return classFeatureSetMap.get(className); } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#setClassFeatureSet(edu.umd.cs.findbugs.model.ClassFeatureSet) */ public void setClassFeatureSet(ClassFeatureSet classFeatureSet) { classFeatureSetMap.put(classFeatureSet.getClassName(), classFeatureSet); } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#classFeatureSetIterator() */ public Iterator<ClassFeatureSet> classFeatureSetIterator() { return classFeatureSetMap.values().iterator(); } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#clearClassFeatures() */ public void clearClassFeatures() { classFeatureSetMap.clear(); } /** * @param withMessages The withMessages to set. */ public void setWithMessages(boolean withMessages) { this.withMessages = withMessages; } /** * @return Returns the withMessages. */ public boolean getWithMessages() { return withMessages; } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#getAppVersionFromSequenceNumber(int) */ public AppVersion getAppVersionFromSequenceNumber(long target) { for(AppVersion av : appVersionList) if (av.getSequenceNumber() == target) return av; if(target == this.getSequenceNumber()) return this.getCurrentAppVersion(); return null; } /* (non-Javadoc) * @see edu.umd.cs.findbugs.BugCollection#findBug(java.lang.String, java.lang.String, int) */ public BugInstance findBug(String instanceHash, String bugType, int lineNumber) { for(BugInstance bug : bugSet) if (bug.getInstanceHash().equals(instanceHash) && bug.getBugPattern().getType().equals(bugType) && bug.getPrimarySourceLineAnnotation().getStartLine() == lineNumber) return bug; return null; } /** * @param version */ public void setAnalysisVersion(String version) { this.analysisVersion = version; } } // vim:ts=4

The table below shows all metrics for SortedBugCollection.java.

MetricValueDescription
BLOCKS143.00Number of blocks
BLOCK_COMMENT66.00Number of block comment lines
COMMENTS263.00Comment lines
COMMENT_DENSITY 0.47Comment density
COMPARISONS70.00Number of comparison operators
CYCLOMATIC149.00Cyclomatic complexity
DECL_COMMENTS63.00Comments in declarations
DOC_COMMENT145.00Number of javadoc comment lines
ELOC558.00Effective lines of code
EXEC_COMMENTS31.00Comments in executable code
EXITS177.00Procedure exits
FUNCTIONS71.00Number of function declarations
HALSTEAD_DIFFICULTY85.55Halstead difficulty
HALSTEAD_EFFORT 0.00Halstead effort
INTERFACE_COMPLEXITY248.00Interface complexity
JAVA0001 0.00JAVA0001 Package name does not contain only lower case letters
JAVA0002 0.00JAVA0002 Package name does not begin with a top level domain name or country code
JAVA0003 0.00JAVA0003 Minimize use of on-demand (.*) imports
JAVA0004 0.00JAVA0004 Unnecessary import from java.lang
JAVA0005 1.00JAVA0005 Imports not in specified order
JAVA0006 0.00JAVA0006 Empty finally block
JAVA0007 0.00JAVA0007 Should not declare public field
JAVA0008 0.00JAVA0008 Empty catch block
JAVA0009 0.00JAVA0009 Protected member in final class
JAVA0010 0.00JAVA0010 Non-instantiable class does not contain a non-private static member
JAVA0011 0.00JAVA0011 Abstract class does not contain an abstract method
JAVA0012 0.00JAVA0012 Non-constructor method with same name as declaring class
JAVA0013 0.00JAVA0013 Non-blank final field is not static
JAVA0014 0.00JAVA0014 Class with only static members has non-private constructor
JAVA0015 0.00JAVA0015 Package class contains public nested type
JAVA0016 0.00JAVA0016 Abstract class contains public constructor
JAVA0017 0.00JAVA0017 Class name does not have required form
JAVA0018 0.00JAVA0018 Method name does not have required form
JAVA0019 0.00JAVA0019 Interface name does not have required form
JAVA0020 0.00JAVA0020 Field name does not have required form
JAVA0021 0.00JAVA0021 Interface method name does not have required form
JAVA0022 0.00JAVA0022 Static final field name does not have required form
JAVA0023 0.00JAVA0023 Empty finalize method
JAVA0024 0.00JAVA0024 Empty class
JAVA0025 0.00JAVA0025 Method override is empty
JAVA0026 0.00JAVA0026 Finalize method with parameters
JAVA0029 0.00JAVA0029 Private method not used
JAVA0030 0.00JAVA0030 Private field not used
JAVA0031 0.00JAVA0031 Case statement not properly closed
JAVA0032 0.00JAVA0032 Switch statement missing default
JAVA0033 0.00JAVA0033 default: not last case in switch statement
JAVA003424.00JAVA0034 Missing braces in if statement
JAVA0035 0.00JAVA0035 Missing braces in for statement
JAVA0036 1.00JAVA0036 Missing braces in while statement
JAVA0038 0.00JAVA0038 Non-case label in switch statement
JAVA0039 0.00JAVA0039 Break statement with label
JAVA0040 0.00JAVA0040 Switch statement contains N cases (maximum: M)
JAVA0041 0.00JAVA0041 Nested synchronized block
JAVA0042 0.00JAVA0042 Empty synchronized statement
JAVA0043 0.00JAVA0043 Inner class does not use outer class
JAVA0044 0.00JAVA0044 Serializable class with no instance variables
JAVA0045 0.00JAVA0045 Serializable class with only transient fields
JAVA0046 0.00JAVA0046 Name of class not derived from Exception ends with 'Exception'
JAVA0047 0.00JAVA0047 Serializable class derives from invalid base class
JAVA0048 0.00JAVA0048 Name of class derived from Exception does not end with 'Exception'
JAVA0049 1.00JAVA0049 Nested block at depth N (maximum: M)
JAVA0050 0.00JAVA0050 Class derives from java.lang.Error
JAVA0051 0.00JAVA0051 Class derives from java.lang.RuntimeException
JAVA0052 0.00JAVA0052 Class derives from java.lang.Throwable
JAVA0053 0.00JAVA0053 Unused label
JAVA0054 0.00JAVA0054 Inheritance depth N exceeds maximum M
JAVA0055 0.00JAVA0055 Class should be interface
JAVA0056 0.00JAVA0056 Unnecessary abstract modifier for interface or annotation
JAVA0057 0.00JAVA0057 Unnecessary default constructor
JAVA0058 0.00JAVA0058 Constructor calls super()
JAVA0059 0.00JAVA0059 Method override only calls super()
JAVA0061 0.00JAVA0061 Inaccessible member in anonymous class
JAVA0062 0.00JAVA0062 Public class missing public member or protected constructor
JAVA0063 0.00JAVA0063 Identifier name should not contain '$'
JAVA0064 0.00JAVA0064 N variations of identifier name (maximum: M)
JAVA0065 0.00JAVA0065 Unnecessary final modifier for method in final class
JAVA0066 0.00JAVA0066 Unnecessary modifier for interface nested type
JAVA0067 1.00JAVA0067 Array descriptor on identifier name
JAVA0068 0.00JAVA0068 Modifiers not declared in recommended order
JAVA0071 0.00JAVA0071 Strings compared with ==
JAVA0073 0.00JAVA0073 Integer division in floating-point context
JAVA0074 0.00JAVA0074 Use of Object.notify()
JAVA0075 0.00JAVA0075 Method parameter hides field
JAVA0076 0.00JAVA0076 Use of magic number
JAVA0077 0.00JAVA0077 Private field not used in declaring class
JAVA0078 0.00JAVA0078 Floating point values compared with ==
JAVA0079 0.00JAVA0079 Use of instance to reference static member
JAVA0080 0.00JAVA0080 Import declaration not used
JAVA0081 0.00JAVA0081 Boolean literal in comparison
JAVA0082 0.00JAVA0082 Unnecessary widening cast
JAVA0083 0.00JAVA0083 Unnecessary instanceof test
JAVA0084 0.00JAVA0084 Should use compound assignment operator
JAVA0085 0.00JAVA0085 Use of sun.* class
JAVA0087 0.00JAVA0087 Use of Thread.sleep()
JAVA0089 0.00JAVA0089 Use of restricted package
JAVA0092 0.00JAVA0092 Use of restricted type
JAVA0093 1.00JAVA0093 Redundant assignment
JAVA0094 1.00JAVA0094 Field hides a superclass field
JAVA0095 0.00JAVA0095 Uninitialized private field
JAVA0096 0.00JAVA0096 Field in nested class hides outer field
JAVA0098 0.00JAVA0098 Minimize use of implicit field initializers
JAVA0100 1.00JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0101 0.00JAVA0101 Unnecessary modifier for field in interface
JAVA0102 0.00JAVA0102 Last statement in finalize() not super.finalize()
JAVA0103 0.00JAVA0103 Explicit call to finalize()
JAVA0104 0.00JAVA0104 finalize() only calls super.finalize()
JAVA0105 0.00JAVA0105 Duplicate import declaration
JAVA0106 0.00JAVA0106 Unnecessary import from current package
JAVA0108 2.00JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0109 0.00JAVA0109 Incorrect javadoc: no parameter 'parameter'
JAVA0110 1.00JAVA0110 Incorrect javadoc: no @return tag
JAVA0111 0.00JAVA0111 Incorrect javadoc: @return tag for void method
JAVA0112 0.00JAVA0112 Incorrect javadoc: no exception 'exception' in throws
JAVA0113 0.00JAVA0113 Incorrect javadoc: no @author tag
JAVA0114 1.00JAVA0114 Incorrect javadoc: no @version tag
JAVA011510.00JAVA0115 Incorrect javadoc: no @throws or @exception tag for 'exception'
JAVA0116 2.00JAVA0116 Missing javadoc: field 'field'
JAVA011712.00JAVA0117 Missing javadoc: method 'method'
JAVA0118 2.00JAVA0118 Missing javadoc: type 'type'
JAVA0119 0.00JAVA0119 Control variable changed within body of for loop
JAVA0123 0.00JAVA0123 Use all three components of for loop
JAVA0125 0.00JAVA0125 Continue statement with label
JAVA0126 0.00JAVA0126 Method declares unchecked exception in throws
JAVA0128 0.00JAVA0128 Public constructor in non-public class
JAVA0130 2.00JAVA0130 Non-static method does not use instance fields
JAVA0131 0.00JAVA0131 Compatible method does not override base
JAVA0132 0.00JAVA0132 Method overload with compatible signature
JAVA0133 0.00JAVA0133 Non-synchronized method overrides synchronized method
JAVA0135 0.00JAVA0135 Only one of Object.equals and Object.hashCode defined: missing 'method'
JAVA0136 1.00JAVA0136 N methods defined in class (maximum: M)
JAVA0137 0.00JAVA0137 Non-abstract class missing constructor
JAVA0138 0.00JAVA0138 N parameters defined for method (maximum: M)
JAVA0139 0.00JAVA0139 Definition of main other than public static void main(java.lang.String[])
JAVA0141 0.00JAVA0141 Unnecessary modifier for method in interface
JAVA0143 0.00JAVA0143 Synchronized method
JAVA0144 0.00JAVA0144 Line exceeds maximum M characters
JAVA01451865.00JAVA0145 Tab character used in source file
JAVA0150 0.00JAVA0150 java.lang.Error (or subclass) thrown
JAVA0153 0.00JAVA0153 Inefficient conversion of integer to string
JAVA0159 0.00JAVA0159 Inefficient conversion of string to integer
JAVA0160 0.00JAVA0160 Method does not throw specified exception
JAVA0161 0.00JAVA0161 Conditional wait() not in loop
JAVA0163 0.00JAVA0163 Empty statement
JAVA0165 0.00JAVA0165 Conflicting return statement in finally block
JAVA0166 1.00JAVA0166 Generic exception caught
JAVA0167 0.00JAVA0167 ThreadDeath not rethrown
JAVA0169 0.00JAVA0169 Unnecessary catch block: exception 'exception'
JAVA0170 0.00JAVA0170 Caught exception not derived from java.lang.Exception
JAVA0171 0.00JAVA0171 Unused local variable
JAVA0173 0.00JAVA0173 Unused method parameter
JAVA0174 0.00JAVA0174 Assigned local variable never used
JAVA0175 0.00JAVA0175 Successive assignment to variable
JAVA0176 0.00JAVA0176 Local variable name does not have required form
JAVA0177 2.00JAVA0177 Variable declaration missing initializer
JAVA0179 0.00JAVA0179 Local variable hides visible field
JAVA0233 0.00JAVA0233 Definition of serialVersionUID other than 'private static final long serialVersionUID'
JAVA0234 0.00JAVA0234 Class is Serializable but does not define serialVersionUID
JAVA0235 0.00JAVA0235 Class defines serialVersionUID but does not implement Serializable
JAVA0236 0.00JAVA0236 Attempt to clone an object which does not implement Cloneable
JAVA0237 0.00JAVA0237 Class implements Cloneable but does not have public clone method
JAVA0238 0.00JAVA0238 Clone method does not call super.clone()
JAVA0239 0.00JAVA0239 Class declares 'readObject' or 'writeObject' but does not implement Serializable
JAVA0240 0.00JAVA0240 Serializable class which declares readObject or writeObject but not both
JAVA0241 0.00JAVA0241 'readObject' or 'writeObject' should be declared private in Serializable class
JAVA0242 0.00JAVA0242 Transient field in non-Serializable class
JAVA0243 0.00JAVA0243 'readResolve' or 'writeReplace' should be declared private or protected
JAVA0244 0.00JAVA0244 Field or method name in subclass differs only by case from inherited field or method
JAVA0245 0.00JAVA0245 JUnit TestCase with non-trivial constructor
JAVA0246 0.00JAVA0246 JUnit assertXXX statement missing message parameter
JAVA0247 0.00JAVA0247 JUnit 'setUp()' and 'tearDown()' should call super method
JAVA0248 0.00JAVA0248 JUnit method 'setUp' or 'tearDown' with incorrect signature
JAVA0249 0.00JAVA0249 JUnit TestCase 'suite()' should be declared static
JAVA0250 0.00JAVA0250 JUnit TestCase declares testXXX method with incorrect signature
JAVA0251 0.00JAVA0251 Use '%n' for line breaks in printf/format for platform independence
JAVA0252 0.00JAVA0252 'enum' is a Java 1.5 reserved word
JAVA0253 0.00JAVA0253 Not all enum constants consumed in switch statement
JAVA0254 6.00JAVA0254 Use enhanced for loop construct instead of Iterator
JAVA0255 0.00JAVA0255 Result of method invocation not used
JAVA0256 0.00JAVA0256 Assignment of external collection/array to field
JAVA0257 0.00JAVA0257 Use of 'Constant Interface' anti-pattern
JAVA0258 1.00JAVA0258 Implement Iterable for foreach compatibility
JAVA0259 1.00JAVA0259 Return of collection/array field
JAVA0260 0.00JAVA0260 Use 'enum' instead of Enumerated Type pattern
JAVA0261 0.00JAVA0261 Use specialized Enum collection types
JAVA0262 0.00JAVA0262 Use of char in integer context
JAVA0263 0.00JAVA0263 Long literal ends with 'l' instead of 'L'
JAVA0264 0.00JAVA0264 Integer math in long context - check for overflow
JAVA0265 0.00JAVA0265 Use of Throwable.printStackTrace()
JAVA0266 1.00JAVA0266 Use of System.out
JAVA0267 0.00JAVA0267 Use of System.err
JAVA0269 0.00JAVA0269 Contents of StringBuffer never used
JAVA0270 0.00JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0271 0.00JAVA0271 Minimize use of on-demand (.*) static imports
JAVA0272 0.00JAVA0272 Thread.run() called
JAVA0273 0.00JAVA0273 Non-final derivative of Thread calls start() in constructor
JAVA0274 0.00JAVA0274 Serializable class has a synchronized readObject()
JAVA0275 0.00JAVA0275 Serializable class has a synchronized writeObject() and no other synchronized methods
JAVA0276 0.00JAVA0276 Unnecessary use of String constructor
JAVA0277 0.00JAVA0277 Iterator.next() implementation does not throw NoSuchElementException
JAVA0278 0.00JAVA0278 Unnecessary use of Boolean constructor
JAVA0279 0.00JAVA0279 Serialization method readObject or readObjectNoData calls an overridable method
JAVA0280 0.00JAVA0280 IllegalMonitorStateException caught
JAVA0281 0.00JAVA0281 Iterator.next() not called in loop
JAVA0282 0.00JAVA0282 Call to Iterator.next() in loop which does not test Iterator.hasNext()
JAVA0283 0.00JAVA0283 Control variable not updated in loop body
JAVA0284 0.00JAVA0284 Explicit garbage collection
JAVA0285 3.00JAVA0285 Dereference of potentially null variable
JAVA0286 0.00JAVA0286 Dereference of null variable
JAVA0287 0.00JAVA0287 Unnecessary null check
JAVA0288 0.00JAVA0288 Inconsistent null check
LINES1109.00Number of lines in the source file
LINE_COMMENT52.00Number of line comments
LOC689.00Lines of code
LOGICAL_LINES387.00Number of statements
LOOPS 9.00Number of loops
NEST_DEPTH 6.00Maximum nesting depth
OPERANDS1708.00Number of operands
OPERATORS3121.00Number of operators
PARAMS70.00Number of formal parameter declarations
PROGRAM_LENGTH4829.00Halstead program length
PROGRAM_VOCAB626.00Halstead program vocabulary
PROGRAM_VOLUME 0.00Halstead program volume
RETURNS178.00Number of return points from functions
SIZE32811.00Size of the file in bytes
UNIQUE_OPERANDS569.00Number of unique operands
UNIQUE_OPERATORS57.00Number of unique operators
WHITESPACE157.00Number of whitespace lines