rename existing getUrl predicate to getRepositoryUrl

This commit is contained in:
Erik Krogh Kristensen
2022-04-06 15:09:21 +02:00
parent 6c70cb4581
commit 563d0d6532
3 changed files with 5 additions and 5 deletions

View File

@@ -380,7 +380,7 @@ class DeclaredRepository extends PomElement {
* Gets the url for this repository. If the `url` tag is present, this will
* be the string contents of that tag.
*/
string getUrl() { result = this.getAChild("url").(PomElement).getValue() }
string getRepositoryUrl() { result = this.getAChild("url").(PomElement).getValue() }
}
/**

View File

@@ -14,10 +14,10 @@ import java
import semmle.code.xml.MavenPom
predicate isBintrayRepositoryUsage(DeclaredRepository repository) {
repository.getUrl().matches("%.bintray.com%")
repository.getRepositoryUrl().matches("%.bintray.com%")
}
from DeclaredRepository repository
where isBintrayRepositoryUsage(repository)
select repository,
"Downloading or uploading artifacts to deprecated repository " + repository.getUrl()
"Downloading or uploading artifacts to deprecated repository " + repository.getRepositoryUrl()

View File

@@ -17,11 +17,11 @@ import java
import semmle.code.xml.MavenPom
predicate isInsecureRepositoryUsage(DeclaredRepository repository) {
repository.getUrl().regexpMatch("(?i)^(http|ftp)://(?!localhost[:/]).*")
repository.getRepositoryUrl().regexpMatch("(?i)^(http|ftp)://(?!localhost[:/]).*")
}
from DeclaredRepository repository
where isInsecureRepositoryUsage(repository)
select repository,
"Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository " +
repository.getUrl()
repository.getRepositoryUrl()