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.
1 parent 5d3a541 commit 7d5fbf5Copy full SHA for 7d5fbf5
ruby/ql/src/queries/performance/ConstantModification.ql
@@ -0,0 +1,14 @@
1
+import ruby
2
+import codeql.ruby.ast.Expr
3
+import codeql.ruby.ast.Constant
4
+import codeql.ruby.ast.Variable
5
+
6
+predicate relevantModification(Expr e) {
7
+ e instanceof ClassVariableWriteAccess
8
+ or
9
+ exists(e.(ConstantAssignment).getScopeExpr())
10
+}
11
12
+from Expr e
13
+where relevantModification(e) and exists(e.getEnclosingCallable())
14
+select e
0 commit comments