Hi Stefan,
Thank you for your interest. There is indeed a way to get the number of lines of an XML file, and we will add it in the default library in the next version. Until then, you need to include this .QL class in your query or personal library:
class MetricXMLFile extends XMLFile {
Location getLocation() { files(this,_,_,_,result) }
int getNumberOfLines() {
result = this.getLocation().getNumberOfLines()
}
}
and use it in the following way to get the total number of lines for all Java and XML files in your working set:
select
sum(MetricPackage p | p.fromSource() | p.getNumberOfLinesOfCode())
+ sum(MetricXMLFile f | | f.getNumberOfLines()) as numberOfLines
Hope it helps.