<columns> element
Specifies the data columns to be included on summary pages. If not specified, default columns will be output.
Specific columns are defined as sub-elements to this one. See the clover-report.
Columns can be defined in a <clover-columns/> Ant type for referencing elsewhere in the build file.
Each column element takes an optional format
attribute which determines how the column's value is rendered. The format
attribute may be one of the following:
raw
— the actual value. Always used for total columnsbar
— render a bar chart (40px wide) showing the coverage percentagelongbar
— same asbar
above, except 200px wide%
— The coverage percentage value
Note that bar
and %
are not valid formats for total columns.
All column elements also take max
and/or min
threshold attributes. If the value for the column is outside the threshold, the value will be highlighted.
Table of Column Names
Column | Description | Valid Format Attributes |
---|---|---|
avgClassesPerFile | The average number of classes per file. |
|
avgMethodComplexity | The average number of paths per method. |
|
avgMethodsPerClass | The average number of methods per class. |
|
avgStatementsPerMethod | The average number of statements per method. |
|
complexity | Cyclomatic Complexity is a measure of the number of paths in your code. |
|
complexityDensity | The average complexity per statement. |
|
coveredBranches | The amount of covered branches. |
|
coveredElements | The total number of covered elements (branches + statements) in the project. |
|
coveredMethods | The amount of covered methods. |
|
coveredStatements | The amount of covered statements. |
|
expression | The body of this element will be evaluated as an arithmetic expression. All other column names can be referenced. See Clover EL. This column takes an optional title attribute. | raw |
filteredElements | The amount of elements that have been filtered out of the report. |
|
ncLineCount | The total number of non-comment lines. |
|
lineCount | The total number of lines. |
|
SUM | Scientifically Untested Metric. This is very similar to crap4j and is defined by this expression:
| raw |
percentageCoveredContribution | Helps you to work out how much an individual package, file or class contributes (percentage-wise) to the overall number of covered elements in the project. Useful for spotting quick wins. | raw;bar;%;longbar |
percentageUncoveredContribution | Helps you to work out how much an individual package, file or class contributes (percentage-wise) to the overall number of uncovered elements in the project. Useful for spotting quick wins. | raw;bar;%;longbar |
totalBranches | The total number of branches in the project. |
|
totalChildren | The number of lower order elements. The order of elements is: Project, Package, File, Class, Method, Statement |
|
totalClasses | The total number of classes below the package, project or file. |
|
totalElements | The total number of elements (branches + statements) in the project. |
|
totalFiles | The total number of files below the package or project. |
|
totalMethods | The total number of methods in the project. |
|
totalPercentageCovered | The total coverage. |
|
totalStatements | The total number of statements in the project. |
|
uncoveredBranches | Branches that were not executed. | raw;bar;%;longbar |
uncoveredElements | Elements that were not executed. | raw;bar;%;longbar |
uncoveredMethods | Methods that were not executed. | raw;bar;%;longbar |
uncoveredStatements | Statements that were not executed. | raw;bar;%;longbar |
Column Attributes
Each of the above column elements can take the following attributes:
Attribute | Description | Required |
---|---|---|
format | Determines how the value is rendered. Depending on the column, this may be one of | No. |
min | Sets a minimum threshold on the value of the column. If the value is less than this it will be highlighted. | No. |
max | Sets a maximum threshold on the value of the column. If the value is greater than this it will be highlighted. | No. |
scope | Controls at which level in the report the column will appear. The scope attribute can be one of: "package", "class" or "method". If omitted, the column will be used at every level in the report. Note that only the following columns support the scope attribute: expression, complexity, complexityDensity, coveredXXX, uncoveredXXX and totalXXX. | No. |
Clover Expression Language
Clover Expression Language enables you to combine any of Clover's built-in column types to produce a custom column. The following arithmetic operators are available: +, - , *, /, ^, (). Any of Clover's columns may be referenced.
A percentage sign, '%', before a column identifier will evaluate to the percentage of that columns data, rather than its raw value. e.g. %CoveredElements == (CoveredElements/TotalElements) * 100
Example:
<columns>
<expression title="SUM">complexity^2 * ((1 - %coveredElements/100)^3) + complexity</expression>
</columns>