Python: Make implicit this receivers explicit

This commit is contained in:
Kasper Svendsen
2023-05-03 12:16:21 +02:00
parent 733a00039e
commit 3eb5a95ee3
5 changed files with 12 additions and 12 deletions

View File

@@ -55,16 +55,16 @@ deprecated class CustomPathNode extends TCustomPathNode {
predicate hasLocationInfo( predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn string filepath, int startline, int startcolumn, int endline, int endcolumn
) { ) {
asNode1().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) this.asNode1().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
or or
asNode2().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) this.asNode2().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
} }
/** Gets a textual representation of this element. */ /** Gets a textual representation of this element. */
string toString() { string toString() {
result = asNode1().toString() result = this.asNode1().toString()
or or
result = asNode2().toString() result = this.asNode2().toString()
} }
} }

View File

@@ -224,7 +224,7 @@ class ExternalApiUsedWithUntrustedData extends MkExternalApi {
/** Gets the number of untrusted sources used with this external API. */ /** Gets the number of untrusted sources used with this external API. */
int getNumberOfUntrustedSources() { int getNumberOfUntrustedSources() {
result = count(getUntrustedDataNode().getAnUntrustedSource()) result = count(this.getUntrustedDataNode().getAnUntrustedSource())
} }
/** Gets a textual representation of this element. */ /** Gets a textual representation of this element. */

View File

@@ -73,11 +73,11 @@ class UninitializedConfig extends TaintTracking::Configuration {
override predicate isBarrier(DataFlow::Node node, TaintKind kind) { override predicate isBarrier(DataFlow::Node node, TaintKind kind) {
kind instanceof Uninitialized and kind instanceof Uninitialized and
( (
definition(node.asVariable()) this.definition(node.asVariable())
or or
use(node.asVariable()) this.use(node.asVariable())
or or
sanitizingNode(node.asCfgNode()) this.sanitizingNode(node.asCfgNode())
) )
} }

View File

@@ -169,7 +169,7 @@ module LdapBind {
abstract predicate useSsl(); abstract predicate useSsl();
/** DEPRECATED: Alias for useSsl */ /** DEPRECATED: Alias for useSsl */
deprecated predicate useSSL() { useSsl() } deprecated predicate useSSL() { this.useSsl() }
} }
} }
@@ -199,7 +199,7 @@ class LdapBind extends DataFlow::Node instanceof LdapBind::Range {
predicate useSsl() { super.useSsl() } predicate useSsl() { super.useSsl() }
/** DEPRECATED: Alias for useSsl */ /** DEPRECATED: Alias for useSsl */
deprecated predicate useSSL() { useSsl() } deprecated predicate useSSL() { this.useSsl() }
} }
/** DEPRECATED: Alias for LdapBind */ /** DEPRECATED: Alias for LdapBind */

View File

@@ -65,8 +65,8 @@ class DefectResult extends int {
/** Gets the URL corresponding to the location of this query result. */ /** Gets the URL corresponding to the location of this query result. */
string getURL() { string getURL() {
result = result =
"file://" + getFile().getAbsolutePath() + ":" + getStartLine() + ":" + getStartColumn() + ":" + "file://" + this.getFile().getAbsolutePath() + ":" + this.getStartLine() + ":" +
getEndLine() + ":" + getEndColumn() this.getStartColumn() + ":" + this.getEndLine() + ":" + this.getEndColumn()
} }
} }