mirror of
https://github.com/github/codeql.git
synced 2026-02-20 00:43:44 +01:00
drop MetricFile class
This commit is contained in:
@@ -169,12 +169,6 @@ class File extends Container, @file {
|
||||
/** Gets the URL of this file. */
|
||||
override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
|
||||
|
||||
/** Gets the metric file. */
|
||||
MetricFile getMetrics() { result = this }
|
||||
}
|
||||
|
||||
/** A wrapper providing metrics for a file */
|
||||
class MetricFile extends File {
|
||||
/** Gets the number of lines in this file. */
|
||||
int getNumberOfLines() { result = max(getAToken().getLocation().getEndLine()) }
|
||||
|
||||
|
||||
@@ -10,5 +10,5 @@
|
||||
import ruby
|
||||
|
||||
from File f, int n
|
||||
where n = f.getMetrics().getNumberOfLines()
|
||||
where n = f.getNumberOfLines()
|
||||
select f, n order by n desc
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
import ruby
|
||||
|
||||
from File f, int n
|
||||
where n = f.getMetrics().getNumberOfLinesOfCode()
|
||||
where n = f.getNumberOfLinesOfCode()
|
||||
select f, n order by n desc
|
||||
|
||||
@@ -10,5 +10,5 @@
|
||||
import ruby
|
||||
|
||||
from File f, int n
|
||||
where n = f.getMetrics().getNumberOfLinesOfComments()
|
||||
where n = f.getNumberOfLinesOfComments()
|
||||
select f, n order by n desc
|
||||
|
||||
Reference in New Issue
Block a user