Skip to content

Commit 023e8cb

Browse files
committed
factor semver to separate function
1 parent 2d5cd1a commit 023e8cb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ql/lib/codeql/actions/security/UseOfUnversionedImmutableAction.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ class UnversionedImmutableAction extends UsesStep {
66
UnversionedImmutableAction() {
77
immutableActionsDataModel(immutable_action) and
88
this.getCallee() = immutable_action and
9-
not this.getVersion().regexpMatch("^(v)?[0-9]+(\\.[0-9]+)*(\\.[xX])?$")
9+
isNotSemVer(this.getVersion())
1010
}
1111
}
12+
13+
bindingset[version]
14+
predicate isNotSemVer(string version) {
15+
not version.regexpMatch("^(v)?[0-9]+(\\.[0-9]+)*(\\.[xX])?$")
16+
}

0 commit comments

Comments
 (0)