mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Ruby: Move language specific code out of FileSystem.qll (at least for now).
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
private import codeql.Locations
|
||||
private import codeql.util.FileSystem
|
||||
private import codeql.ruby.Diagnostics
|
||||
|
||||
private module Input implements InputSig {
|
||||
abstract class ContainerBase extends @container {
|
||||
@@ -35,20 +34,3 @@ class File extends Container, Impl::File {
|
||||
/** Holds if this file was extracted from ordinary source code. */
|
||||
predicate fromSource() { any() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A successfully extracted file, that is, a file that was extracted and
|
||||
* contains no extraction errors or warnings.
|
||||
*/
|
||||
class SuccessfullyExtractedFile extends File {
|
||||
SuccessfullyExtractedFile() {
|
||||
not exists(Diagnostic d |
|
||||
d.getLocation().getFile() = this and
|
||||
(
|
||||
d instanceof ExtractionError
|
||||
or
|
||||
d instanceof ExtractionWarning
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ private import ast.internal.Scope
|
||||
private import ast.internal.Synthesis
|
||||
private import ast.internal.TreeSitter
|
||||
private import Customizations
|
||||
private import Diagnostics
|
||||
|
||||
cached
|
||||
private module Cached {
|
||||
@@ -166,3 +167,20 @@ class RubyFile extends File {
|
||||
/** Gets the number of lines of comments in this file. */
|
||||
int getNumberOfLinesOfComments() { result = count(int line | this.line(line, true)) }
|
||||
}
|
||||
|
||||
/**
|
||||
* A successfully extracted file, that is, a file that was extracted and
|
||||
* contains no extraction errors or warnings.
|
||||
*/
|
||||
class SuccessfullyExtractedFile extends RubyFile {
|
||||
SuccessfullyExtractedFile() {
|
||||
not exists(Diagnostic d |
|
||||
d.getLocation().getFile() = this and
|
||||
(
|
||||
d instanceof ExtractionError
|
||||
or
|
||||
d instanceof ExtractionWarning
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user