Files
codeql/ruby/ql/lib/upgrades/4ba51641799d2aaa315c7323931e2dd2a94c9f9d/ruby_method_body.ql
2022-08-25 17:40:52 +02:00

21 lines
479 B
Plaintext

class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode node, AstNode body
where
ruby_method_def(node, _) and
(
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_method_child(node, _, _)
or
ruby_method_child(node, 0, body) and
not exists(AstNode n |
ruby_ast_node_info(n, node, _, _) and
ruby_tokeninfo(n, _, "end")
)
)
// TODO : handle end-less methods
select node, body