mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Ruby: restrict to a use of 'self' in singleton methods
This commit is contained in:
@@ -413,7 +413,8 @@ private module Cached {
|
||||
// end
|
||||
// end
|
||||
// ```
|
||||
selfInMethod(sourceNode.(SsaSelfDefinitionNode).getVariable(), _, m.getSuperClass*())
|
||||
selfInMethod(sourceNode.(SsaSelfDefinitionNode).getVariable(), any(SingletonMethod sm),
|
||||
m.getSuperClass*())
|
||||
)
|
||||
)
|
||||
or
|
||||
|
||||
@@ -8,7 +8,6 @@ getTarget
|
||||
| calls.rb:17:1:17:8 | call to bar | calls.rb:13:1:15:3 | bar |
|
||||
| calls.rb:19:1:19:8 | call to foo | calls.rb:1:1:3:3 | foo |
|
||||
| calls.rb:19:1:19:8 | call to foo | calls.rb:85:1:89:3 | foo |
|
||||
| calls.rb:23:9:23:19 | call to singleton_m | calls.rb:25:5:27:7 | singleton_m |
|
||||
| calls.rb:32:5:32:15 | call to singleton_m | calls.rb:25:5:27:7 | singleton_m |
|
||||
| calls.rb:33:5:33:20 | call to singleton_m | calls.rb:25:5:27:7 | singleton_m |
|
||||
| calls.rb:37:1:37:13 | call to singleton_m | calls.rb:25:5:27:7 | singleton_m |
|
||||
@@ -77,7 +76,6 @@ getTarget
|
||||
| calls.rb:224:9:224:24 | call to singleton_g | calls.rb:236:1:238:3 | singleton_g |
|
||||
| calls.rb:224:9:224:24 | call to singleton_g | calls.rb:243:1:245:3 | singleton_g |
|
||||
| calls.rb:224:9:224:24 | call to singleton_g | calls.rb:251:5:253:7 | singleton_g |
|
||||
| calls.rb:224:9:224:24 | call to singleton_g | calls.rb:267:1:269:3 | singleton_g |
|
||||
| calls.rb:228:1:228:22 | call to singleton_a | calls.rb:191:5:194:7 | singleton_a |
|
||||
| calls.rb:229:1:229:22 | call to singleton_f | calls.rb:218:9:220:11 | singleton_f |
|
||||
| calls.rb:231:6:231:19 | call to new | calls.rb:117:5:117:16 | new |
|
||||
@@ -263,8 +261,8 @@ getTarget
|
||||
| private.rb:104:1:104:20 | call to new | calls.rb:117:5:117:16 | new |
|
||||
| private.rb:104:1:104:28 | call to call_m1 | private.rb:91:3:93:5 | call_m1 |
|
||||
| private.rb:105:1:105:20 | call to new | calls.rb:117:5:117:16 | new |
|
||||
| toplevel_self_singleton.rb:10:9:10:27 | call to ab_singleton_method | toplevel_self_singleton.rb:3:9:4:11 | ab_singleton_method |
|
||||
unresolvedCall
|
||||
| calls.rb:23:9:23:19 | call to singleton_m |
|
||||
| calls.rb:26:9:26:18 | call to instance_m |
|
||||
| calls.rb:29:5:29:14 | call to instance_m |
|
||||
| calls.rb:30:5:30:19 | call to instance_m |
|
||||
@@ -349,6 +347,7 @@ unresolvedCall
|
||||
| private.rb:100:7:100:29 | call to m1 |
|
||||
| private.rb:105:1:105:23 | call to m1 |
|
||||
| toplevel_self_singleton.rb:8:1:12:3 | call to do_something |
|
||||
| toplevel_self_singleton.rb:10:9:10:27 | call to ab_singleton_method |
|
||||
privateMethod
|
||||
| calls.rb:1:1:3:3 | foo |
|
||||
| calls.rb:39:1:41:3 | call_instance_m |
|
||||
|
||||
Reference in New Issue
Block a user