factor semver to separate function

This commit is contained in:
Kylie Stradley
2024-10-21 20:59:42 -04:00
parent 2d5cd1a61a
commit 023e8cbe3e

View File

@@ -6,6 +6,11 @@ class UnversionedImmutableAction extends UsesStep {
UnversionedImmutableAction() {
immutableActionsDataModel(immutable_action) and
this.getCallee() = immutable_action and
not this.getVersion().regexpMatch("^(v)?[0-9]+(\\.[0-9]+)*(\\.[xX])?$")
isNotSemVer(this.getVersion())
}
}
bindingset[version]
predicate isNotSemVer(string version) {
not version.regexpMatch("^(v)?[0-9]+(\\.[0-9]+)*(\\.[xX])?$")
}