Skip to content

Commit d18be93

Browse files
authored
Merge pull request github#13004 from kaspersv/kaspersv/python-explicit-this-receiver
Python: Make implicit this receivers explicit
2 parents ca51200 + 3eb5a95 commit d18be93

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

python/ql/lib/semmle/python/security/dataflow/ChainedConfigs12.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ deprecated class CustomPathNode extends TCustomPathNode {
5555
predicate hasLocationInfo(
5656
string filepath, int startline, int startcolumn, int endline, int endcolumn
5757
) {
58-
asNode1().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
58+
this.asNode1().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
5959
or
60-
asNode2().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
60+
this.asNode2().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
6161
}
6262

6363
/** Gets a textual representation of this element. */
6464
string toString() {
65-
result = asNode1().toString()
65+
result = this.asNode1().toString()
6666
or
67-
result = asNode2().toString()
67+
result = this.asNode2().toString()
6868
}
6969
}
7070

python/ql/src/Security/CWE-020-ExternalAPIs/ExternalAPIs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class ExternalApiUsedWithUntrustedData extends MkExternalApi {
224224

225225
/** Gets the number of untrusted sources used with this external API. */
226226
int getNumberOfUntrustedSources() {
227-
result = count(getUntrustedDataNode().getAnUntrustedSource())
227+
result = count(this.getUntrustedDataNode().getAnUntrustedSource())
228228
}
229229

230230
/** Gets a textual representation of this element. */

python/ql/src/Variables/Undefined.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ class UninitializedConfig extends TaintTracking::Configuration {
7373
override predicate isBarrier(DataFlow::Node node, TaintKind kind) {
7474
kind instanceof Uninitialized and
7575
(
76-
definition(node.asVariable())
76+
this.definition(node.asVariable())
7777
or
78-
use(node.asVariable())
78+
this.use(node.asVariable())
7979
or
80-
sanitizingNode(node.asCfgNode())
80+
this.sanitizingNode(node.asCfgNode())
8181
)
8282
}
8383

python/ql/src/experimental/semmle/python/Concepts.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ module LdapBind {
169169
abstract predicate useSsl();
170170

171171
/** DEPRECATED: Alias for useSsl */
172-
deprecated predicate useSSL() { useSsl() }
172+
deprecated predicate useSSL() { this.useSsl() }
173173
}
174174
}
175175

@@ -199,7 +199,7 @@ class LdapBind extends DataFlow::Node instanceof LdapBind::Range {
199199
predicate useSsl() { super.useSsl() }
200200

201201
/** DEPRECATED: Alias for useSsl */
202-
deprecated predicate useSSL() { useSsl() }
202+
deprecated predicate useSSL() { this.useSsl() }
203203
}
204204

205205
/** DEPRECATED: Alias for LdapBind */

python/ql/src/external/DefectFilter.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ class DefectResult extends int {
6565
/** Gets the URL corresponding to the location of this query result. */
6666
string getURL() {
6767
result =
68-
"file://" + getFile().getAbsolutePath() + ":" + getStartLine() + ":" + getStartColumn() + ":" +
69-
getEndLine() + ":" + getEndColumn()
68+
"file://" + this.getFile().getAbsolutePath() + ":" + this.getStartLine() + ":" +
69+
this.getStartColumn() + ":" + this.getEndLine() + ":" + this.getEndColumn()
7070
}
7171
}
7272

0 commit comments

Comments
 (0)