mirror of
https://github.com/github/codeql.git
synced 2026-01-29 22:32:58 +01:00
Dependencies: Make getAnImport() more precise
In particular, ensure that the go file importing the dependency is under the directory of the file where the dependency is declared. Co-authored-by: Max Schaefer <max-schaefer@github.com>
This commit is contained in:
@@ -26,7 +26,12 @@ abstract class Dependency extends Locatable {
|
||||
/**
|
||||
* An import of this dependency.
|
||||
*/
|
||||
ImportSpec getAnImport() { result.getPath() = this.getDepPath() }
|
||||
ImportSpec getAnImport() {
|
||||
result.getPath() = this.getDepPath() and
|
||||
exists(Folder parent | parent.getAFile() = this.getFile() |
|
||||
parent.getAFolder*().getAFile() = result.getFile()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user