|
The number of lines in the source of this type. The count includes
white space and comments.
Pre-packaged Queries
Query name = "Semmle/Metrics/Types/Size/RefTypes that are large in terms of LOC"
Reports types that occur in source form in the working set, with > 500 lines of code, as a bar chart, in decreasing order.
from MetricRefType t, int n
where t.fromSource() and n = t.getNumberOfLines() and n > 500
select t,n order by n desc
Query name="Semmle/Metrics/Types/Size/RefTypes that are very small"
Reports types in the source
that are not anonymous, not an enumeration, and that have less
than 10 lines of code, in a bar chart, in increasing order.
from MetricRefType t, int n
where t.fromSource()
and
n = t.getNumberOfLines()
and
n < 10
and
not(((Class)t).isAnonymous())
and
not(t instanceof EnumType)
select t,n order by n
.QL source for metric
This metric is defined in the class MetricRefType, and its
definition reads:
int getNumberOfLines() {
result = this.getLocation().getNumberOfLines()
}
|