Skip to content

Commit 563d0d6

Browse files
committed
rename existing getUrl predicate to getRepositoryUrl
1 parent 6c70cb4 commit 563d0d6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

java/ql/lib/semmle/code/xml/MavenPom.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ class DeclaredRepository extends PomElement {
380380
* Gets the url for this repository. If the `url` tag is present, this will
381381
* be the string contents of that tag.
382382
*/
383-
string getUrl() { result = this.getAChild("url").(PomElement).getValue() }
383+
string getRepositoryUrl() { result = this.getAChild("url").(PomElement).getValue() }
384384
}
385385

386386
/**

java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import java
1414
import semmle.code.xml.MavenPom
1515

1616
predicate isBintrayRepositoryUsage(DeclaredRepository repository) {
17-
repository.getUrl().matches("%.bintray.com%")
17+
repository.getRepositoryUrl().matches("%.bintray.com%")
1818
}
1919

2020
from DeclaredRepository repository
2121
where isBintrayRepositoryUsage(repository)
2222
select repository,
23-
"Downloading or uploading artifacts to deprecated repository " + repository.getUrl()
23+
"Downloading or uploading artifacts to deprecated repository " + repository.getRepositoryUrl()

java/ql/src/Security/CWE/CWE-829/InsecureDependencyResolution.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import java
1717
import semmle.code.xml.MavenPom
1818

1919
predicate isInsecureRepositoryUsage(DeclaredRepository repository) {
20-
repository.getUrl().regexpMatch("(?i)^(http|ftp)://(?!localhost[:/]).*")
20+
repository.getRepositoryUrl().regexpMatch("(?i)^(http|ftp)://(?!localhost[:/]).*")
2121
}
2222

2323
from DeclaredRepository repository
2424
where isInsecureRepositoryUsage(repository)
2525
select repository,
2626
"Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository " +
27-
repository.getUrl()
27+
repository.getRepositoryUrl()

0 commit comments

Comments
 (0)