We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
RedundantComparison.qll
1 parent 2f93b14 commit f86011fCopy full SHA for f86011f
python/ql/src/Expressions/RedundantComparison.qll
@@ -1,5 +1,8 @@
1
+/** Helper functions for queries having to do with redundant comparisons. */
2
+
3
import python
4
5
+/** A comparison where the left and right hand sides appear to be identical. */
6
class RedundantComparison extends Compare {
7
RedundantComparison() {
8
exists(Expr left, Expr right |
@@ -8,6 +11,15 @@ class RedundantComparison extends Compare {
11
)
9
12
}
10
13
14
+ /** Holds if this comparison could be due to a missing `self.`, for example
15
+ * ```python
16
+ * foo == foo
17
+ * ```
18
+ * instead of
19
20
+ * self.foo == foo
21
22
+ */
23
predicate maybeMissingSelf() {
24
exists(Name left |
25
this.compares(left, _, _) and
0 commit comments