ClassLineCount Metric

Metric for counting the number of lines for classes. Note that this metric measures the number of lines from the first line of the class to the last line of the class. The count includes all program statements, comment lines and whitespace.

Implemented by the org.gmetrics.metric.linecount.ClassLineCountMetric class.

Metric Properties

The following properties can be configured for this metric within a MetricSet. See Creating a MetricSet for information on the syntax of setting a metric property.

PropertyDescriptionDefault Value
enabledThis boolean property controls whether the metric is enabled. If set to false, then the metric is not included as part of the results or the output reports.true
functionsThis List<String> property contains the names of the functions to be calculated at the class and package levels and (potentially) included within the report(s). Valid values are: - "total" - "average" - "minimum" - "maximum"["total","average"]


  • The The C2 Wiki page for Lines of Code has a good discussion of the perils of using (abusing) lines of code as a measure of just about anything. Note: That page specifically refers to measuring non-comment lines. This metric only measures total lines, including statements, comments and whitespace.