|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.phoenix.report.FileSummary
public final class FileSummary
This class encapsulates all finding information collected for a file or a group of files.
This class also allows to perform the magic quality calculation for the data collected in the summary.
| Constructor Summary | |
|---|---|
FileSummary()
Creates a new empty file summary object used to summarize findings for classes in all packages. |
|
FileSummary(String packagename)
Creates a new empty file summary object used to summarize findings for classes in in the given package. |
|
FileSummary(String className,
String packagename,
String reportfile,
int linesOfCode,
boolean withCoverage)
Creates a new empty file summary object used to summarize findings for the given class in the given package with link to the file and code information. |
|
| Method Summary | |
|---|---|
void |
add(File file)
Adds the counters from the given file to this summary. |
void |
add(FileSummary other)
Add the counters of an other FileSummary to this one. |
void |
addCoveredLine()
Increments the counter of covered lines. |
void |
addViolation(Severity severity)
Increments the counter for the given severity in this summary. |
static float |
calculateQuality(int loc,
int[] violations)
Calculates the quality as percentage represented as float. |
static float |
calculateQuality(int loc,
int info,
int warning,
int error,
int coverage,
int filtered,
int codestyle,
int design,
int cpd)
Calculates the quality percentage scored for the code. |
int |
compareTo(FileSummary o)
|
String |
getClassName()
|
int |
getCoverage()
|
float |
getCoverageAsFloat()
Get the coverage percentage in double precision. |
String |
getCoverageAsString()
Returns the coverage as user string. |
String |
getCoverageBar()
Generates a string containing xhtml code that renders to a bar that can be used as component of a web page to represent the amount of covered code. |
String |
getFullClassName()
|
String |
getHtmlLink()
|
int |
getLinesOfCode()
|
int |
getNotCoveredLinesOfCode()
|
int |
getNumberOfFiles()
|
int |
getNumberOfFindings()
All findings that are between Severity.INFO and
Severity.ERROR but not Severity.COVERAGE
are counted. |
String |
getPackage()
|
String |
getPercentBar()
Generates a string containing xhtml code that renders to a percentage bar that can be used as component of a web page. |
int |
getQuality()
Returns the magic quality as percentage int. |
float |
getQualityAsFloat()
Returns the magic quality as percentage float. |
int |
getViolations(Severity severity)
Returns the number of violations for the given severity. |
boolean |
isWithCoverage()
Returns true if this summary contains coverage data. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FileSummary()
public FileSummary(String packagename)
packagename - name of the package where this summary
is used for.
public FileSummary(String className,
String packagename,
String reportfile,
int linesOfCode,
boolean withCoverage)
className - the name of the class (without package
information).packagename - the name of the package where the class
resides in.reportfile - the name of the file where the html report
stored.linesOfCode - the number of lines in the file.withCoverage - true if coverage information is
available.| Method Detail |
|---|
public static float calculateQuality(int loc,
int[] violations)
loc - total number of lines of code. This is also the maximum
that might be returned by this method.violations - the array holding the violations of the severity
related to the position in the array. The elements of the
array are NOT modified.
public static float calculateQuality(int loc,
int info,
int warning,
int error,
int coverage,
int filtered,
int codestyle,
int design,
int cpd)
100 the minimum is 0.
loc - total number of lines of code. This is also the maximum
that might be returned by this method.info - number of info level findings.warning - number of warning level findings.error - number of error level findings.coverage - number of coverage level findings.filtered - number of filtered level findings.codestyle - number of codestyle level findings.design - number of design level findings.cpd - number of cpd level findings.
public String getClassName()
public String getPackage()
public int getNumberOfFiles()
public String toString()
toString in class Objectpublic void add(FileSummary other)
other - the FileSummary be added.public void add(File file)
file - the data to be added.public boolean isWithCoverage()
public void addCoveredLine()
public void addViolation(Severity severity)
severity - the severity of the counter to be incremented.public String getFullClassName()
public String getHtmlLink()
public int getLinesOfCode()
public int getQuality()
public float getQualityAsFloat()
public String getPercentBar()
public String getCoverageBar()
public int getViolations(Severity severity)
severity - the severity to check.
public float getCoverageAsFloat()
public String getCoverageAsString()
public int getCoverage()
public int getNotCoveredLinesOfCode()
public int getNumberOfFindings()
Severity.INFO and
Severity.ERROR but not Severity.COVERAGE
are counted.
public int compareTo(FileSummary o)
compareTo in interface Comparable<FileSummary>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||