fix all ql/use-string-compare

This commit is contained in:
Erik Krogh Kristensen
2022-05-17 13:48:21 +02:00
parent 440e6214f0
commit 86e97c32d6
26 changed files with 62 additions and 61 deletions

View File

@@ -43,7 +43,7 @@ private module Authlib {
override DataFlow::Node getAlgorithm() {
exists(KeyValuePair headerDict |
headerDict = this.getArg(0).asExpr().(Dict).getItem(_) and
headerDict.getKey().(Str_).getS().matches("alg") and
headerDict.getKey().(Str_).getS() = "alg" and
result.asExpr() = headerDict.getValue()
)
}

View File

@@ -104,28 +104,28 @@ class ThriftType extends ThriftNamedElement {
/** A thrift typedef */
class ThriftTypeDef extends ThriftNamedElement {
ThriftTypeDef() { kind.matches("typedef") }
ThriftTypeDef() { kind = "typedef" }
override ThriftElement getNameElement() { result = this.getChild(2).getChild(0) }
}
/** A thrift enum declaration */
class ThriftEnum extends ThriftNamedElement {
ThriftEnum() { kind.matches("enum") }
ThriftEnum() { kind = "enum" }
override ThriftElement getNameElement() { result = this.getChild(0).getChild(0) }
}
/** A thrift enum field */
class ThriftEnumField extends ThriftNamedElement {
ThriftEnumField() { kind.matches("enumfield") }
ThriftEnumField() { kind = "enumfield" }
override ThriftElement getNameElement() { result = this.getChild(0).getChild(0) }
}
/** A thrift service declaration */
class ThriftService extends ThriftNamedElement {
ThriftService() { kind.matches("service") }
ThriftService() { kind = "service" }
override ThriftElement getNameElement() { result = this.getChild(0).getChild(0) }
@@ -139,7 +139,7 @@ class ThriftService extends ThriftNamedElement {
/** A thrift function declaration */
class ThriftFunction extends ThriftNamedElement {
ThriftFunction() { kind.matches("function") }
ThriftFunction() { kind = "function" }
override ThriftElement getNameElement() { result = this.getChild(2).getChild(0) }
@@ -166,7 +166,7 @@ class ThriftFunction extends ThriftNamedElement {
}
class ThriftField extends ThriftNamedElement {
ThriftField() { kind.matches("field") }
ThriftField() { kind = "field" }
override ThriftElement getNameElement() { result = this.getChild(4) }
@@ -174,7 +174,7 @@ class ThriftField extends ThriftNamedElement {
}
class ThriftStruct extends ThriftNamedElement {
ThriftStruct() { kind.matches("struct") }
ThriftStruct() { kind = "struct" }
override ThriftElement getNameElement() { result = this.getChild(0).getChild(0) }
@@ -184,7 +184,7 @@ class ThriftStruct extends ThriftNamedElement {
}
class ThriftException extends ThriftNamedElement {
ThriftException() { kind.matches("exception") }
ThriftException() { kind = "exception" }
override ThriftElement getNameElement() { result = this.getChild(0).getChild(0) }
@@ -194,7 +194,7 @@ class ThriftException extends ThriftNamedElement {
}
class ThriftThrows extends ThriftElement {
ThriftThrows() { kind.matches("throws") }
ThriftThrows() { kind = "throws" }
ThriftField getAThrows() { result = this.getChild(_) }
}