rj.tools.jcsc.ant
Class OverviewStatistics

java.lang.Object
  extended byrj.tools.jcsc.ant.OverviewStatistics

public class OverviewStatistics
extends java.lang.Object

OveriewStatistics is used to keep track about all information of all classes which are parsed.

Version:
__0.98.1__
Author:
Ralph Jocham

Constructor Summary
OverviewStatistics()
           
 
Method Summary
 void addResult(BatchResult result)
          Add the result from a parsed file in batch mode
 double calculateAvgViolationsPerClass()
          Calculate the average number of violations per class
 double calculateAvgViolationsPerNcss()
          Calculate the average number of violations per NCSS
 int getClassCount()
          Get the number of classes which have been parsed
 java.util.List getClassNamesOfPackage(java.lang.String pack)
          Get a list of all classes from a package
 double getFunctionPointCount()
          Get the number of Function Points
 int getHighestSeverityLevel()
          Get the highes found severity level of all violations
 int getLineCount()
          Get the number of Lines
 int getMethodCount()
          Get the number of parsed methods
 int getNCSSCount()
          Get the number of NCCS
 int getPackageCount()
          Get the number of packages which have been parsed
 java.util.HashMap getPackageMap()
          Get a Map of all packages
 java.util.List getPackageNames()
          Get a list of names from all packages
 Rule getRule(java.lang.String ruleName)
          Get the Rule instance having the name
 java.util.HashMap getRulesMap()
          Get a Map of the applied Rules
 int getUnitTestClassCount()
          Get the number of unit test classes found
 int getUnitTestCount()
          Get the number of unit tests found
 java.util.List getViolatedCategories()
          Get a list of all violated categories
 java.util.List getViolatedRules()
          Get a list of all violated rules
 java.util.List getViolatedSeverities()
          Get a list of all violated severity levels
 java.util.List getViolationByRuleName(java.lang.String rule)
          Get a list of all violations against a specific rule
 int getViolationCount()
          Get the number of found violations
 java.util.List getViolationsByCategory(java.lang.String category)
          Get a list of violations against a specific category
 java.util.List getViolationsBySeverity(int severity)
          Get a list of all violations having a certain severity
 java.util.List getWorstCount(int count)
          Get a list of worst elements of spefic length from all classes which have been parsed.
 java.util.List getWorstCountFromPackage(java.lang.String pack, int count)
          Get a list of worst elements of spefic length from a specific package which has been parsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OverviewStatistics

public OverviewStatistics()
Method Detail

addResult

public void addResult(BatchResult result)
Add the result from a parsed file in batch mode

Parameters:
result - of batch run

getRule

public Rule getRule(java.lang.String ruleName)
Get the Rule instance having the name

Parameters:
ruleName -
Returns:
Rule

getViolatedRules

public java.util.List getViolatedRules()
Get a list of all violated rules

Returns:
a list of violated Rule objects

getViolatedCategories

public java.util.List getViolatedCategories()
Get a list of all violated categories

Returns:
a list of violated categories as String objects

getViolatedSeverities

public java.util.List getViolatedSeverities()
Get a list of all violated severity levels

Returns:
a list of violated severity levels as Integer objects

getViolationsBySeverity

public java.util.List getViolationsBySeverity(int severity)
Get a list of all violations having a certain severity

Parameters:
severity -
Returns:
list of Violation objects for a serverity

getViolationByRuleName

public java.util.List getViolationByRuleName(java.lang.String rule)
Get a list of all violations against a specific rule

Parameters:
rule -
Returns:
list of Violation objects for a specific Rule

getViolationsByCategory

public java.util.List getViolationsByCategory(java.lang.String category)
Get a list of violations against a specific category

Parameters:
category -
Returns:
list of Violation objects for a specific category

getRulesMap

public java.util.HashMap getRulesMap()
Get a Map of the applied Rules

Returns:
map of rules

getPackageMap

public java.util.HashMap getPackageMap()
Get a Map of all packages

Returns:
map of packages

getPackageNames

public java.util.List getPackageNames()
Get a list of names from all packages

Returns:
List of names as String objects

getClassNamesOfPackage

public java.util.List getClassNamesOfPackage(java.lang.String pack)
Get a list of all classes from a package

Parameters:
pack -
Returns:
list of all class names as String objects

getWorstCount

public java.util.List getWorstCount(int count)
Get a list of worst elements of spefic length from all classes which have been parsed. The returned list length is <= count

Parameters:
count -
Returns:
a list of WorstElement objects

getWorstCountFromPackage

public java.util.List getWorstCountFromPackage(java.lang.String pack,
                                               int count)
Get a list of worst elements of spefic length from a specific package which has been parsed. The returned list length is <= count

Parameters:
pack -
count -
Returns:
a list of WorstElement objects

getPackageCount

public int getPackageCount()
Get the number of packages which have been parsed

Returns:
number of packages

getClassCount

public int getClassCount()
Get the number of classes which have been parsed

Returns:
number of classess

getMethodCount

public int getMethodCount()
Get the number of parsed methods

Returns:
number of methods

getViolationCount

public int getViolationCount()
Get the number of found violations

Returns:
number of violations

getNCSSCount

public int getNCSSCount()
Get the number of NCCS

Returns:
number of NCSS

getFunctionPointCount

public double getFunctionPointCount()
Get the number of Function Points

Returns:
number of Function Points

getLineCount

public int getLineCount()
Get the number of Lines

Returns:
number of Lines

getUnitTestClassCount

public int getUnitTestClassCount()
Get the number of unit test classes found

Returns:
number of unit test classes

getUnitTestCount

public int getUnitTestCount()
Get the number of unit tests found

Returns:
number of unit tests

calculateAvgViolationsPerNcss

public double calculateAvgViolationsPerNcss()
Calculate the average number of violations per NCSS

Returns:
number of avg violations per NCSS

calculateAvgViolationsPerClass

public double calculateAvgViolationsPerClass()
Calculate the average number of violations per class

Returns:
number of avg violations per class

getHighestSeverityLevel

public int getHighestSeverityLevel()
Get the highes found severity level of all violations

Returns:
max severtity level


(c) 1999-2005 by Ralph Jocham (rjocham72@netscape.net)
JCSC is released under the terms of the GNU General Public License