Merge branch 'main' into rb/sensitive-get-query

This commit is contained in:
Alex Ford
2022-09-19 20:57:20 +01:00
committed by GitHub
600 changed files with 51296 additions and 25466 deletions

BIN
ruby/Cargo.lock generated

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,28 @@
class AstNode extends @ruby_ast_node_parent {
string toString() { none() }
}
class Location extends @location {
string toString() { none() }
}
class Wrapper = @ruby_body_statement or @ruby_block_body;
predicate astNodeInfo(AstNode child, AstNode parent, int primaryIndex, int secondaryIndex) {
not parent instanceof Wrapper and
exists(AstNode node, Location l |
ruby_ast_node_info(node, parent, primaryIndex, _) and
(
not node instanceof Wrapper and secondaryIndex = 0 and child = node
or
node instanceof Wrapper and ruby_ast_node_info(child, node, secondaryIndex, _)
)
)
}
from AstNode node, AstNode parent, int parent_index, Location loc
where
node =
rank[parent_index + 1](AstNode n, int i, int j | astNodeInfo(n, parent, i, j) | n order by i, j) and
ruby_ast_node_info(node, _, _, loc)
select node, parent, parent_index, loc

View File

@@ -0,0 +1,7 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode ruby_block, AstNode body, int index, AstNode child
where ruby_block_body(ruby_block, body) and ruby_block_body_child(body, index, child)
select ruby_block, index, child

View File

@@ -0,0 +1,7 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode ruby_class, AstNode body, int index, AstNode child
where ruby_class_body(ruby_class, body) and ruby_body_statement_child(body, index, child)
select ruby_class, index, child

View File

@@ -0,0 +1,8 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode ruby_do_block, AstNode body, int index, AstNode child
where ruby_do_block_body(ruby_do_block, body) and ruby_body_statement_child(body, index, child)
select ruby_do_block, index, child

View File

@@ -0,0 +1,14 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode ruby_method, int index, AstNode child
where
exists(AstNode body |
ruby_method_body(ruby_method, body) and ruby_body_statement_child(body, index, child)
)
or
ruby_method_body(ruby_method, child) and
not child instanceof @ruby_body_statement and
index = 0
select ruby_method, index, child

View File

@@ -0,0 +1,8 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode ruby_module, AstNode body, int index, AstNode child
where ruby_module_body(ruby_module, body) and ruby_body_statement_child(body, index, child)
select ruby_module, index, child

View File

@@ -0,0 +1,8 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode ruby_singleton_class, AstNode body, int index, AstNode child
where ruby_singleton_class_body(ruby_singleton_class, body) and ruby_body_statement_child(body, index, child)
select ruby_singleton_class, index, child

View File

@@ -0,0 +1,15 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode ruby_singleton_method, int index, AstNode child
where
exists(AstNode body |
ruby_singleton_method_body(ruby_singleton_method, body) and
ruby_body_statement_child(body, index, child)
)
or
ruby_singleton_method_body(ruby_singleton_method, child) and
not child instanceof @ruby_body_statement and
index = 0
select ruby_singleton_method, index, child

View File

@@ -0,0 +1,30 @@
description: Wrap class, module, method, and block bodies in a named node
compatibility: full
ruby_block_body.rel: delete
ruby_block_body_def.rel: delete
ruby_block_body_child.rel: delete
ruby_block_child.rel: run ruby_block_child.qlo
ruby_body_statement_child.rel: delete
ruby_body_statement_def.rel: delete
ruby_class_body.rel: delete
ruby_class_child.rel: run ruby_class_child.qlo
ruby_do_block_body.rel: delete
ruby_do_block_child.rel: run ruby_do_block_child.qlo
ruby_method_body.rel: delete
ruby_method_child.rel: run ruby_method_child.qlo
ruby_module_body.rel: delete
ruby_module_child.rel: run ruby_module_child.qlo
ruby_singleton_class_body.rel: delete
ruby_singleton_class_child.rel: run ruby_singleton_class_child.qlo
ruby_singleton_method_body.rel: delete
ruby_singleton_method_child.rel: run ruby_singleton_method_child.qlo
ruby_ast_node_info.rel: run ruby_ast_node_info.qlo

View File

@@ -11,7 +11,7 @@ flate2 = "1.0"
node-types = { path = "../node-types" }
tree-sitter = "0.19"
tree-sitter-embedded-template = { git = "https://github.com/tree-sitter/tree-sitter-embedded-template.git", rev = "1a538da253d73f896b9f6c0c7d79cda58791ac5c" }
tree-sitter-ruby = { git = "https://github.com/tree-sitter/tree-sitter-ruby.git", rev = "e75d04404c9dd71ad68850d5c672b226d5e694f3" }
tree-sitter-ruby = { git = "https://github.com/tree-sitter/tree-sitter-ruby.git", rev = "ad1043283b1f9daf4aad381b6a81f18a5a27fe7e" }
clap = "3.0"
tracing = "0.1"
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }

View File

@@ -12,4 +12,4 @@ node-types = { path = "../node-types" }
tracing = "0.1"
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
tree-sitter-embedded-template = { git = "https://github.com/tree-sitter/tree-sitter-embedded-template.git", rev = "1a538da253d73f896b9f6c0c7d79cda58791ac5c" }
tree-sitter-ruby = { git = "https://github.com/tree-sitter/tree-sitter-ruby.git", rev = "e75d04404c9dd71ad68850d5c672b226d5e694f3" }
tree-sitter-ruby = { git = "https://github.com/tree-sitter/tree-sitter-ruby.git", rev = "ad1043283b1f9daf4aad381b6a81f18a5a27fe7e" }

View File

@@ -0,0 +1,5 @@
---
category: deprecated
---
* Some classes/modules with upper-case acronyms in their name have been renamed to follow our style-guide.
The old name still exists as a deprecated alias.

View File

@@ -60,10 +60,10 @@ class AstNode extends TAstNode {
final string getPrimaryQlClasses() { result = concat(this.getAPrimaryQlClass(), ",") }
/** Gets the enclosing module, if any. */
ModuleBase getEnclosingModule() { result = getEnclosingModule(scopeOfInclSynth(this)) }
final ModuleBase getEnclosingModule() { result = getEnclosingModule(scopeOfInclSynth(this)) }
/** Gets the enclosing method, if any. */
MethodBase getEnclosingMethod() { result = getEnclosingMethod(scopeOfInclSynth(this)) }
final MethodBase getEnclosingMethod() { result = getEnclosingMethod(scopeOfInclSynth(this)) }
/** Gets a textual representation of this node. */
cached

View File

@@ -33,7 +33,7 @@ module API {
* 3. Map the resulting API graph nodes to data-flow nodes, using `asSource` or `asSink`.
*
* For example, a simplified way to get arguments to `Foo.bar` would be
* ```codeql
* ```ql
* API::getTopLevelMember("Foo").getMethod("bar").getParameter(0).asSink()
* ```
*

View File

@@ -222,7 +222,7 @@ class HtmlEscaping extends Escaping {
}
/** Provides classes for modeling HTTP-related APIs. */
module HTTP {
module Http {
/** Provides classes for modeling HTTP servers. */
module Server {
/**
@@ -489,7 +489,7 @@ module HTTP {
* Extend this class to model new APIs. If you want to refine existing API models,
* extend `HttpResponse` instead.
*/
abstract class Range extends HTTP::Server::HttpResponse::Range {
abstract class Range extends Http::Server::HttpResponse::Range {
/** Gets the data-flow node that specifies the location of this HTTP redirect response. */
abstract DataFlow::Node getRedirectLocation();
}
@@ -574,6 +574,9 @@ module HTTP {
}
}
/** DEPRECATED: Alias for Http */
deprecated module HTTP = Http;
/**
* A data flow node that executes an operating system command,
* for instance by spawning a new process.
@@ -635,16 +638,12 @@ module CodeExecution {
* Extend this class to refine existing API models. If you want to model new APIs,
* extend `XmlParserCall::Range` instead.
*/
class XmlParserCall extends DataFlow::Node {
XmlParserCall::Range range;
XmlParserCall() { this = range }
class XmlParserCall extends DataFlow::Node instanceof XmlParserCall::Range {
/** Gets the argument that specifies the XML content to be parsed. */
DataFlow::Node getInput() { result = range.getInput() }
DataFlow::Node getInput() { result = super.getInput() }
/** Holds if this XML parser call is configured to process external entities */
predicate externalEntitiesEnabled() { range.externalEntitiesEnabled() }
predicate externalEntitiesEnabled() { super.externalEntitiesEnabled() }
}
/** Provides a class for modeling new XML parsing APIs. */
@@ -814,13 +813,9 @@ module CookieSecurityConfigurationSetting {
* Extend this class to refine existing API models. If you want to model new APIs,
* extend `Logging::Range` instead.
*/
class Logging extends DataFlow::Node {
Logging::Range range;
Logging() { this = range }
class Logging extends DataFlow::Node instanceof Logging::Range {
/** Gets an input that is logged. */
DataFlow::Node getAnInput() { result = range.getAnInput() }
DataFlow::Node getAnInput() { result = super.getAnInput() }
}
/** Provides a class for modeling new logging mechanisms. */

View File

@@ -51,25 +51,35 @@ class Ensure extends StmtSequence, TEnsure {
// Not defined by dispatch, as it should not be exposed
Ruby::AstNode getBodyStmtChild(TBodyStmt b, int i) {
result = any(Ruby::Method g | b = TMethod(g)).getChild(i)
or
result = any(Ruby::SingletonMethod g | b = TSingletonMethod(g)).getChild(i)
or
exists(Ruby::Lambda g | b = TLambda(g) |
result = g.getBody().(Ruby::DoBlock).getChild(i) or
result = g.getBody().(Ruby::Block).getChild(i)
exists(Ruby::Method g, Ruby::AstNode body | b = TMethod(g) and body = g.getBody() |
result = body.(Ruby::BodyStatement).getChild(i)
or
i = 0 and result = body and not body instanceof Ruby::BodyStatement
)
or
result = any(Ruby::DoBlock g | b = TDoBlock(g)).getChild(i)
exists(Ruby::SingletonMethod g, Ruby::AstNode body |
b = TSingletonMethod(g) and body = g.getBody()
|
result = body.(Ruby::BodyStatement).getChild(i)
or
i = 0 and result = body and not body instanceof Ruby::BodyStatement
)
or
exists(Ruby::Lambda g | b = TLambda(g) |
result = g.getBody().(Ruby::DoBlock).getBody().getChild(i) or
result = g.getBody().(Ruby::Block).getBody().getChild(i)
)
or
result = any(Ruby::DoBlock g | b = TDoBlock(g)).getBody().getChild(i)
or
result = any(Ruby::Program g | b = TToplevel(g)).getChild(i) and
not result instanceof Ruby::BeginBlock
or
result = any(Ruby::Class g | b = TClassDeclaration(g)).getChild(i)
result = any(Ruby::Class g | b = TClassDeclaration(g)).getBody().getChild(i)
or
result = any(Ruby::SingletonClass g | b = TSingletonClass(g)).getChild(i)
result = any(Ruby::SingletonClass g | b = TSingletonClass(g)).getBody().getChild(i)
or
result = any(Ruby::Module g | b = TModuleDeclaration(g)).getChild(i)
result = any(Ruby::Module g | b = TModuleDeclaration(g)).getBody().getChild(i)
or
result = any(Ruby::Begin g | b = TBeginExpr(g)).getChild(i)
}

View File

@@ -15,7 +15,7 @@ class BraceBlockReal extends BraceBlock, TBraceBlockReal {
toGenerated(result) = g.getParameters().getChild(n)
}
final override Stmt getStmt(int i) { toGenerated(result) = g.getChild(i) }
final override Stmt getStmt(int i) { toGenerated(result) = g.getBody().getChild(i) }
}
/**

View File

@@ -128,7 +128,7 @@ private AstNode specialParentOfInclSynth(AstNode n) {
n =
[
result.(Namespace).getScopeExpr(), result.(ClassDeclaration).getSuperclassExpr(),
result.(SingletonMethod).getObject()
result.(SingletonMethod).getObject(), result.(SingletonClass).getValue()
]
}

View File

@@ -311,15 +311,15 @@ module Ruby {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Block" }
/** Gets the node corresponding to the field `body`. */
final BlockBody getBody() { ruby_block_body(this, result) }
/** Gets the node corresponding to the field `parameters`. */
final BlockParameters getParameters() { ruby_block_parameters(this, result) }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { ruby_block_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
ruby_block_parameters(this, result) or ruby_block_child(this, _, result)
ruby_block_body(this, result) or ruby_block_parameters(this, result)
}
}
@@ -335,6 +335,18 @@ module Ruby {
final override AstNode getAFieldOrChild() { ruby_block_argument_child(this, result) }
}
/** A class representing `block_body` nodes. */
class BlockBody extends @ruby_block_body, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "BlockBody" }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { ruby_block_body_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { ruby_block_body_child(this, _, result) }
}
/** A class representing `block_parameter` nodes. */
class BlockParameter extends @ruby_block_parameter, AstNode {
/** Gets the name of the primary QL class for this element. */
@@ -364,6 +376,18 @@ module Ruby {
}
}
/** A class representing `body_statement` nodes. */
class BodyStatement extends @ruby_body_statement, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "BodyStatement" }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { ruby_body_statement_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { ruby_body_statement_child(this, _, result) }
}
/** A class representing `break` nodes. */
class Break extends @ruby_break, AstNode {
/** Gets the name of the primary QL class for this element. */
@@ -468,20 +492,20 @@ module Ruby {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Class" }
/** Gets the node corresponding to the field `body`. */
final BodyStatement getBody() { ruby_class_body(this, result) }
/** Gets the node corresponding to the field `name`. */
final AstNode getName() { ruby_class_def(this, result) }
/** Gets the node corresponding to the field `superclass`. */
final Superclass getSuperclass() { ruby_class_superclass(this, result) }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { ruby_class_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
ruby_class_body(this, result) or
ruby_class_def(this, result) or
ruby_class_superclass(this, result) or
ruby_class_child(this, _, result)
ruby_class_superclass(this, result)
}
}
@@ -592,15 +616,15 @@ module Ruby {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "DoBlock" }
/** Gets the node corresponding to the field `body`. */
final BodyStatement getBody() { ruby_do_block_body(this, result) }
/** Gets the node corresponding to the field `parameters`. */
final BlockParameters getParameters() { ruby_do_block_parameters(this, result) }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { ruby_do_block_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
ruby_do_block_parameters(this, result) or ruby_do_block_child(this, _, result)
ruby_do_block_body(this, result) or ruby_do_block_parameters(this, result)
}
}
@@ -1106,20 +1130,20 @@ module Ruby {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Method" }
/** Gets the node corresponding to the field `body`. */
final AstNode getBody() { ruby_method_body(this, result) }
/** Gets the node corresponding to the field `name`. */
final UnderscoreMethodName getName() { ruby_method_def(this, result) }
/** Gets the node corresponding to the field `parameters`. */
final MethodParameters getParameters() { ruby_method_parameters(this, result) }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { ruby_method_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
ruby_method_body(this, result) or
ruby_method_def(this, result) or
ruby_method_parameters(this, result) or
ruby_method_child(this, _, result)
ruby_method_parameters(this, result)
}
}
@@ -1140,15 +1164,15 @@ module Ruby {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Module" }
/** Gets the node corresponding to the field `body`. */
final BodyStatement getBody() { ruby_module_body(this, result) }
/** Gets the node corresponding to the field `name`. */
final AstNode getName() { ruby_module_def(this, result) }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { ruby_module_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
ruby_module_def(this, result) or ruby_module_child(this, _, result)
ruby_module_body(this, result) or ruby_module_def(this, result)
}
}
@@ -1504,15 +1528,15 @@ module Ruby {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "SingletonClass" }
/** Gets the node corresponding to the field `body`. */
final BodyStatement getBody() { ruby_singleton_class_body(this, result) }
/** Gets the node corresponding to the field `value`. */
final UnderscoreArg getValue() { ruby_singleton_class_def(this, result) }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { ruby_singleton_class_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
ruby_singleton_class_def(this, result) or ruby_singleton_class_child(this, _, result)
ruby_singleton_class_body(this, result) or ruby_singleton_class_def(this, result)
}
}
@@ -1521,6 +1545,9 @@ module Ruby {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "SingletonMethod" }
/** Gets the node corresponding to the field `body`. */
final AstNode getBody() { ruby_singleton_method_body(this, result) }
/** Gets the node corresponding to the field `name`. */
final UnderscoreMethodName getName() { ruby_singleton_method_def(this, result, _) }
@@ -1530,15 +1557,12 @@ module Ruby {
/** Gets the node corresponding to the field `parameters`. */
final MethodParameters getParameters() { ruby_singleton_method_parameters(this, result) }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { ruby_singleton_method_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
ruby_singleton_method_body(this, result) or
ruby_singleton_method_def(this, result, _) or
ruby_singleton_method_def(this, _, result) or
ruby_singleton_method_parameters(this, result) or
ruby_singleton_method_child(this, _, result)
ruby_singleton_method_parameters(this, result)
}
}

View File

@@ -200,18 +200,18 @@ private module Cached {
or
i = any(Ruby::Binary x).getRight()
or
i = any(Ruby::Block x).getChild(_)
or
i = any(Ruby::BlockArgument x).getChild()
or
i = any(Ruby::BlockBody x).getChild(_)
or
i = any(Ruby::BodyStatement x).getChild(_)
or
i = any(Ruby::Call x).getReceiver()
or
i = any(Ruby::Case x).getValue()
or
i = any(Ruby::CaseMatch x).getValue()
or
i = any(Ruby::Class x).getChild(_)
or
i = any(Ruby::Conditional x).getCondition()
or
i = any(Ruby::Conditional x).getConsequence()
@@ -220,8 +220,6 @@ private module Cached {
or
i = any(Ruby::Do x).getChild(_)
or
i = any(Ruby::DoBlock x).getChild(_)
or
i = any(Ruby::ElementReference x).getChild(_)
or
i = any(Ruby::ElementReference x).getObject()
@@ -250,9 +248,7 @@ private module Cached {
or
i = any(Ruby::KeywordParameter x).getValue()
or
i = any(Ruby::Method x).getChild(_)
or
i = any(Ruby::Module x).getChild(_)
i = any(Ruby::Method x).getBody()
or
i = any(Ruby::OperatorAssignment x).getRight()
or
@@ -282,9 +278,7 @@ private module Cached {
or
i = any(Ruby::SingletonClass x).getValue()
or
i = any(Ruby::SingletonClass x).getChild(_)
or
i = any(Ruby::SingletonMethod x).getChild(_)
i = any(Ruby::SingletonMethod x).getBody()
or
i = any(Ruby::SingletonMethod x).getObject()
or

View File

@@ -13,13 +13,9 @@ private import codeql.ruby.Frameworks
* Extend this class to refine existing API models. If you want to model new APIs,
* extend `RemoteFlowSource::Range` instead.
*/
class RemoteFlowSource extends DataFlow::Node {
RemoteFlowSource::Range self;
RemoteFlowSource() { this = self }
class RemoteFlowSource extends DataFlow::Node instanceof RemoteFlowSource::Range {
/** Gets a string that describes the type of this remote flow source. */
string getSourceType() { result = self.getSourceType() }
string getSourceType() { result = super.getSourceType() }
}
/** Provides a class for modeling new sources of remote user input. */

View File

@@ -613,7 +613,7 @@ private module ParameterNodes {
* where direct keyword matching is possible, since we construct a synthesized hash
* splat argument (`SynthHashSplatArgumentNode`) at the call site, which means that
* `taint(1)` will flow into `p1` both via normal keyword matching and via the synthesized
* nodes (and similarly for `p2`). However, this redunancy is OK since
* nodes (and similarly for `p2`). However, this redundancy is OK since
* (a) it means that type-tracking through keyword arguments also works in most cases,
* (b) read/store steps can be avoided when direct keyword matching is possible, and
* hence access path limits are not a concern, and

View File

@@ -46,7 +46,7 @@ class ActionControllerControllerClass extends ClassDeclaration {
* A public instance method defined within an `ActionController` controller class.
* This may be the target of a route handler, if such a route is defined.
*/
class ActionControllerActionMethod extends Method, HTTP::Server::RequestHandler::Range {
class ActionControllerActionMethod extends Method, Http::Server::RequestHandler::Range {
private ActionControllerControllerClass controllerClass;
ActionControllerActionMethod() { this = controllerClass.getAMethod() and not this.isPrivate() }
@@ -128,7 +128,7 @@ abstract class ParamsCall extends MethodCall {
* A `RemoteFlowSource::Range` to represent accessing the
* ActionController parameters available via the `params` method.
*/
class ParamsSource extends HTTP::Server::RequestInputAccess::Range {
class ParamsSource extends Http::Server::RequestInputAccess::Range {
ParamsSource() { this.asExpr().getExpr() instanceof ParamsCall }
override string getSourceType() { result = "ActionController::Metal#params" }
@@ -145,7 +145,7 @@ abstract class CookiesCall extends MethodCall {
* A `RemoteFlowSource::Range` to represent accessing the
* ActionController parameters available via the `cookies` method.
*/
class CookiesSource extends HTTP::Server::RequestInputAccess::Range {
class CookiesSource extends Http::Server::RequestInputAccess::Range {
CookiesSource() { this.asExpr().getExpr() instanceof CookiesCall }
override string getSourceType() { result = "ActionController::Metal#cookies" }
@@ -213,7 +213,7 @@ class RedirectToCall extends ActionControllerContextCall {
/**
* A call to the `redirect_to` method, as an `HttpRedirectResponse`.
*/
class ActionControllerRedirectResponse extends HTTP::Server::HttpRedirectResponse::Range {
class ActionControllerRedirectResponse extends Http::Server::HttpRedirectResponse::Range {
RedirectToCall redirectToCall;
ActionControllerRedirectResponse() { this.asExpr().getExpr() = redirectToCall }

View File

@@ -127,7 +127,7 @@ abstract class RenderCall extends MethodCall {
* A call to `render`, `render_to_body` or `render_to_string`, seen as an
* `HttpResponse`.
*/
private class RenderCallAsHttpResponse extends DataFlow::CallNode, HTTP::Server::HttpResponse::Range {
private class RenderCallAsHttpResponse extends DataFlow::CallNode, Http::Server::HttpResponse::Range {
RenderCallAsHttpResponse() {
this.asExpr().getExpr() instanceof RenderCall or
this.asExpr().getExpr() instanceof RenderToCall

View File

@@ -215,7 +215,7 @@ module ActiveResource {
Collection getCollection() { result = this.getReceiver() }
}
private class ModelClassMethodCallAsHttpRequest extends HTTP::Client::Request::Range,
private class ModelClassMethodCallAsHttpRequest extends Http::Client::Request::Range,
ModelClassMethodCall {
ModelClass cls;
@@ -239,7 +239,7 @@ module ActiveResource {
override DataFlow::Node getResponseBody() { result = this }
}
private class ModelInstanceMethodCallAsHttpRequest extends HTTP::Client::Request::Range,
private class ModelInstanceMethodCallAsHttpRequest extends Http::Client::Request::Range,
ModelInstanceMethodCall {
ModelClass cls;

View File

@@ -167,7 +167,7 @@ private class GraphqlResolvableClass extends ClassDeclaration {
* end
* ```
*/
class GraphqlResolveMethod extends Method, HTTP::Server::RequestHandler::Range {
class GraphqlResolveMethod extends Method, Http::Server::RequestHandler::Range {
private GraphqlResolvableClass resolvableClass;
GraphqlResolveMethod() { this = resolvableClass.getMethod("resolve") }
@@ -213,7 +213,7 @@ class GraphqlResolveMethod extends Method, HTTP::Server::RequestHandler::Range {
* end
* ```
*/
class GraphqlLoadMethod extends Method, HTTP::Server::RequestHandler::Range {
class GraphqlLoadMethod extends Method, Http::Server::RequestHandler::Range {
private GraphqlResolvableClass resolvableClass;
GraphqlLoadMethod() {
@@ -347,7 +347,7 @@ private class GraphqlFieldArgumentDefinitionMethodCall extends GraphqlSchemaObje
* end
* ```
*/
class GraphqlFieldResolutionMethod extends Method, HTTP::Server::RequestHandler::Range {
class GraphqlFieldResolutionMethod extends Method, Http::Server::RequestHandler::Range {
private GraphqlSchemaObjectClass schemaObjectClass;
GraphqlFieldResolutionMethod() {

View File

@@ -24,7 +24,7 @@ private import codeql.ruby.dataflow.internal.DataFlowImplForHttpClientLibraries
* TODO: pipelining, streaming responses
* https://github.com/excon/excon/blob/master/README.md
*/
class ExconHttpRequest extends HTTP::Client::Request::Range, DataFlow::CallNode {
class ExconHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode {
API::Node requestNode;
API::Node connectionNode;
DataFlow::Node connectionUse;

View File

@@ -23,7 +23,7 @@ private import codeql.ruby.dataflow.internal.DataFlowImplForHttpClientLibraries
* connection.get("/").body
* ```
*/
class FaradayHttpRequest extends HTTP::Client::Request::Range, DataFlow::CallNode {
class FaradayHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode {
API::Node requestNode;
API::Node connectionNode;
DataFlow::Node connectionUse;

View File

@@ -15,7 +15,7 @@ private import codeql.ruby.dataflow.internal.DataFlowImplForHttpClientLibraries
* HTTPClient.get_content("http://example.com")
* ```
*/
class HttpClientRequest extends HTTP::Client::Request::Range, DataFlow::CallNode {
class HttpClientRequest extends Http::Client::Request::Range, DataFlow::CallNode {
API::Node requestNode;
API::Node connectionNode;
string method;

View File

@@ -24,7 +24,7 @@ private import codeql.ruby.dataflow.internal.DataFlowImplForHttpClientLibraries
* MyClass.new("http://example.com")
* ```
*/
class HttpartyRequest extends HTTP::Client::Request::Range, DataFlow::CallNode {
class HttpartyRequest extends Http::Client::Request::Range, DataFlow::CallNode {
API::Node requestNode;
HttpartyRequest() {

View File

@@ -19,7 +19,7 @@ private import codeql.ruby.dataflow.internal.DataFlowImplForHttpClientLibraries
* response = req.get("/")
* ```
*/
class NetHttpRequest extends HTTP::Client::Request::Range, DataFlow::CallNode {
class NetHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode {
private DataFlow::CallNode request;
private DataFlow::Node responseBody;
private API::Node requestNode;

View File

@@ -19,7 +19,7 @@ private import codeql.ruby.dataflow.internal.DataFlowImplForHttpClientLibraries
* URI.parse("http://example.com").open.read
* ```
*/
class OpenUriRequest extends HTTP::Client::Request::Range, DataFlow::CallNode {
class OpenUriRequest extends Http::Client::Request::Range, DataFlow::CallNode {
API::Node requestNode;
OpenUriRequest() {
@@ -61,7 +61,7 @@ class OpenUriRequest extends HTTP::Client::Request::Range, DataFlow::CallNode {
* Kernel.open("http://example.com").read
* ```
*/
class OpenUriKernelOpenRequest extends HTTP::Client::Request::Range, DataFlow::CallNode {
class OpenUriKernelOpenRequest extends Http::Client::Request::Range, DataFlow::CallNode {
OpenUriKernelOpenRequest() {
this instanceof KernelMethodCall and
this.getMethodName() = "open"

View File

@@ -17,7 +17,7 @@ private import codeql.ruby.dataflow.internal.DataFlowImplForHttpClientLibraries
* RestClient::Request.execute(url: "http://example.com").body
* ```
*/
class RestClientHttpRequest extends HTTP::Client::Request::Range, DataFlow::CallNode {
class RestClientHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode {
API::Node requestNode;
API::Node connectionNode;

View File

@@ -15,7 +15,7 @@ private import codeql.ruby.dataflow.internal.DataFlowImplForHttpClientLibraries
* Typhoeus.get("http://example.com").body
* ```
*/
class TyphoeusHttpRequest extends HTTP::Client::Request::Range, DataFlow::CallNode {
class TyphoeusHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode {
API::Node requestNode;
TyphoeusHttpRequest() {

View File

@@ -12,10 +12,10 @@ private import HttpToFileAccessCustomizations::HttpToFileAccess
/**
* An access to a user-controlled HTTP request input, considered as a flow source for writing user-controlled data to files
*/
private class RequestInputAccessAsSource extends Source instanceof HTTP::Server::RequestInputAccess {
private class RequestInputAccessAsSource extends Source instanceof Http::Server::RequestInputAccess {
}
/** A response from an outgoing HTTP request, considered as a flow source for writing user-controlled data to files. */
private class HttpResponseAsSource extends Source {
HttpResponseAsSource() { this = any(HTTP::Client::Request r).getResponseBody() }
HttpResponseAsSource() { this = any(Http::Client::Request r).getResponseBody() }
}

View File

@@ -135,7 +135,7 @@ module InsecureDownload {
* In other words, if the URL is HTTP and the extension is in `unsafeExtension()`.
*/
private class HttpResponseAsSink extends Sink {
private HTTP::Client::Request req;
private Http::Client::Request req;
HttpResponseAsSink() {
this = req.getAUrlPart() and
@@ -155,7 +155,7 @@ module InsecureDownload {
/**
* Gets a node for the response from `request`, type-tracked using `t`.
*/
DataFlow::LocalSourceNode clientRequestResponse(TypeTracker t, HTTP::Client::Request request) {
DataFlow::LocalSourceNode clientRequestResponse(TypeTracker t, Http::Client::Request request) {
t.start() and
result = request.getResponseBody()
or
@@ -166,7 +166,7 @@ module InsecureDownload {
* A url that is downloaded through an insecure connection, where the result ends up being saved to a sensitive location.
*/
class FileWriteSink extends Sink {
HTTP::Client::Request request;
Http::Client::Request request;
FileWriteSink() {
// For example, in:

View File

@@ -96,7 +96,10 @@ class OverlyWideRange extends RegExpCharacterRange {
toCodePoint("A") <= high
or
// a non-alphanumeric char as part of the range boundaries
exists(int bound | bound = [low, high] | not isAlphanumeric(bound.toUnicode()))
exists(int bound | bound = [low, high] | not isAlphanumeric(bound.toUnicode())) and
// while still being ascii
low < 128 and
high < 128
) and
// allowlist for known ranges
not this = allowedWideRanges()

View File

@@ -45,7 +45,7 @@ module ServerSideRequestForgery {
/** The URL of an HTTP request, considered as a sink. */
class HttpRequestAsSink extends Sink {
HttpRequestAsSink() { exists(HTTP::Client::Request req | req.getAUrlPart() = this) }
HttpRequestAsSink() { exists(Http::Client::Request req | req.getAUrlPart() = this) }
}
/** A string interpolation with a fixed prefix, considered as a flow sanitizer. */

View File

@@ -57,7 +57,7 @@ module UrlRedirect {
*/
class RedirectLocationAsSink extends Sink {
RedirectLocationAsSink() {
exists(HTTP::Server::HttpRedirectResponse e, MethodBase method |
exists(Http::Server::HttpRedirectResponse e, MethodBase method |
this = e.getRedirectLocation() and
// We only want handlers for GET requests.
// Handlers for other HTTP methods are not as vulnerable to URL

View File

@@ -887,11 +887,10 @@ module PrefixConstruction<isCandidateSig/1 isCandidate> {
/**
* Holds if `state` is the textually last start state for the regular expression.
*/
private predicate lastStartState(State state) {
private predicate lastStartState(RelevantState state) {
exists(RegExpRoot root |
state =
max(State s, Location l |
s = stateInRelevantRegexp() and
max(RelevantState s, Location l |
isStartState(s) and
getRoot(s.getRepr()) = root and
l = s.getRepr().getLocation()
@@ -963,10 +962,17 @@ module PrefixConstruction<isCandidateSig/1 isCandidate> {
min(string c | delta(prev, any(InputSymbol symbol | c = intersect(Any(), symbol)), next))
}
/** Gets a state within a regular expression that contains a candidate state. */
pragma[noinline]
State stateInRelevantRegexp() {
exists(State s | isCandidate(s) | getRoot(s.getRepr()) = getRoot(result.getRepr()))
/** A state within a regular expression that contains a candidate state. */
class RelevantState instanceof State {
RelevantState() {
exists(State s | isCandidate(s) | getRoot(s.getRepr()) = getRoot(this.getRepr()))
}
/** Gets a string representation for this state in a regular expression. */
string toString() { result = State.super.toString() }
/** Gets the term represented by this state. */
RegExpTerm getRepr() { result = State.super.getRepr() }
}
}
@@ -1007,6 +1013,8 @@ module ReDoSPruning<isCandidateSig/2 isCandidate> {
import PrefixConstruction<isCandidateState/1> as Prefix
class RelevantState = Prefix::RelevantState;
/**
* Predicates for testing the presence of a rejecting suffix.
*
@@ -1040,32 +1048,26 @@ module ReDoSPruning<isCandidateSig/2 isCandidate> {
* This predicate might find impossible suffixes when searching for suffixes of length > 1, which can cause FPs.
*/
pragma[noinline]
private predicate isLikelyRejectable(State s) {
s = Prefix::stateInRelevantRegexp() and
(
// exists a reject edge with some char.
hasRejectEdge(s)
or
hasEdgeToLikelyRejectable(s)
or
// stopping here is rejection
isRejectState(s)
)
private predicate isLikelyRejectable(RelevantState s) {
// exists a reject edge with some char.
hasRejectEdge(s)
or
hasEdgeToLikelyRejectable(s)
or
// stopping here is rejection
isRejectState(s)
}
/**
* Holds if `s` is not an accept state, and there is no epsilon transition to an accept state.
*/
predicate isRejectState(State s) {
s = Prefix::stateInRelevantRegexp() and not epsilonSucc*(s) = Accept(_)
}
predicate isRejectState(RelevantState s) { not epsilonSucc*(s) = Accept(_) }
/**
* Holds if there is likely a non-empty suffix leading to rejection starting in `s`.
*/
pragma[noopt]
predicate hasEdgeToLikelyRejectable(State s) {
s = Prefix::stateInRelevantRegexp() and
predicate hasEdgeToLikelyRejectable(RelevantState s) {
// all edges (at least one) with some char leads to another state that is rejectable.
// the `next` states might not share a common suffix, which can cause FPs.
exists(string char | char = hasEdgeToLikelyRejectableHelper(s) |
@@ -1080,8 +1082,7 @@ module ReDoSPruning<isCandidateSig/2 isCandidate> {
* and `s` has not been found to be rejectable by `hasRejectEdge` or `isRejectState`.
*/
pragma[noinline]
private string hasEdgeToLikelyRejectableHelper(State s) {
s = Prefix::stateInRelevantRegexp() and
private string hasEdgeToLikelyRejectableHelper(RelevantState s) {
not hasRejectEdge(s) and
not isRejectState(s) and
deltaClosedChar(s, result, _)
@@ -1092,9 +1093,7 @@ module ReDoSPruning<isCandidateSig/2 isCandidate> {
* along epsilon edges, such that there is a transition from
* `prev` to `next` that the character symbol `char`.
*/
predicate deltaClosedChar(State prev, string char, State next) {
prev = Prefix::stateInRelevantRegexp() and
next = Prefix::stateInRelevantRegexp() and
predicate deltaClosedChar(RelevantState prev, string char, RelevantState next) {
deltaClosed(prev, getAnInputSymbolMatchingRelevant(char), next)
}

View File

@@ -247,20 +247,16 @@ ruby_binary_def(
int right: @ruby_underscore_expression ref
);
ruby_block_body(
unique int ruby_block: @ruby_block ref,
unique int body: @ruby_block_body ref
);
ruby_block_parameters(
unique int ruby_block: @ruby_block ref,
unique int parameters: @ruby_block_parameters ref
);
@ruby_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement
#keyset[ruby_block, index]
ruby_block_child(
int ruby_block: @ruby_block ref,
int index: int ref,
unique int child: @ruby_block_child_type ref
);
ruby_block_def(
unique int id: @ruby_block
);
@@ -274,6 +270,19 @@ ruby_block_argument_def(
unique int id: @ruby_block_argument
);
@ruby_block_body_child_type = @ruby_token_empty_statement | @ruby_underscore_statement
#keyset[ruby_block_body, index]
ruby_block_body_child(
int ruby_block_body: @ruby_block_body ref,
int index: int ref,
unique int child: @ruby_block_body_child_type ref
);
ruby_block_body_def(
unique int id: @ruby_block_body
);
ruby_block_parameter_name(
unique int ruby_block_parameter: @ruby_block_parameter ref,
unique int name: @ruby_token_identifier ref
@@ -303,6 +312,19 @@ ruby_block_parameters_def(
unique int id: @ruby_block_parameters
);
@ruby_body_statement_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement
#keyset[ruby_body_statement, index]
ruby_body_statement_child(
int ruby_body_statement: @ruby_body_statement ref,
int index: int ref,
unique int child: @ruby_body_statement_child_type ref
);
ruby_body_statement_def(
unique int id: @ruby_body_statement
);
ruby_break_child(
unique int ruby_break: @ruby_break ref,
unique int child: @ruby_argument_list ref
@@ -391,6 +413,11 @@ ruby_chained_string_def(
unique int id: @ruby_chained_string
);
ruby_class_body(
unique int ruby_class: @ruby_class ref,
unique int body: @ruby_body_statement ref
);
@ruby_class_name_type = @ruby_scope_resolution | @ruby_token_constant
ruby_class_superclass(
@@ -398,15 +425,6 @@ ruby_class_superclass(
unique int superclass: @ruby_superclass ref
);
@ruby_class_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement
#keyset[ruby_class, index]
ruby_class_child(
int ruby_class: @ruby_class ref,
int index: int ref,
unique int child: @ruby_class_child_type ref
);
ruby_class_def(
unique int id: @ruby_class,
int name: @ruby_class_name_type ref
@@ -478,20 +496,16 @@ ruby_do_def(
unique int id: @ruby_do
);
ruby_do_block_body(
unique int ruby_do_block: @ruby_do_block ref,
unique int body: @ruby_body_statement ref
);
ruby_do_block_parameters(
unique int ruby_do_block: @ruby_do_block ref,
unique int parameters: @ruby_block_parameters ref
);
@ruby_do_block_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement
#keyset[ruby_do_block, index]
ruby_do_block_child(
int ruby_do_block: @ruby_do_block ref,
int index: int ref,
unique int child: @ruby_do_block_child_type ref
);
ruby_do_block_def(
unique int id: @ruby_do_block
);
@@ -724,7 +738,7 @@ ruby_in_clause_def(
int pattern: @ruby_underscore_pattern_top_expr_body ref
);
@ruby_interpolation_child_type = @ruby_token_empty_statement | @ruby_underscore_statement
@ruby_interpolation_child_type = @ruby_token_empty_statement | @ruby_underscore_nonlocal_variable | @ruby_underscore_statement
#keyset[ruby_interpolation, index]
ruby_interpolation_child(
@@ -797,20 +811,18 @@ ruby_left_assignment_list_def(
unique int id: @ruby_left_assignment_list
);
@ruby_method_body_type = @ruby_body_statement | @ruby_rescue_modifier | @ruby_underscore_arg
ruby_method_body(
unique int ruby_method: @ruby_method ref,
unique int body: @ruby_method_body_type ref
);
ruby_method_parameters(
unique int ruby_method: @ruby_method ref,
unique int parameters: @ruby_method_parameters ref
);
@ruby_method_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_arg | @ruby_underscore_statement
#keyset[ruby_method, index]
ruby_method_child(
int ruby_method: @ruby_method ref,
int index: int ref,
unique int child: @ruby_method_child_type ref
);
ruby_method_def(
unique int id: @ruby_method,
int name: @ruby_underscore_method_name ref
@@ -829,17 +841,13 @@ ruby_method_parameters_def(
unique int id: @ruby_method_parameters
);
@ruby_module_name_type = @ruby_scope_resolution | @ruby_token_constant
@ruby_module_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement
#keyset[ruby_module, index]
ruby_module_child(
int ruby_module: @ruby_module ref,
int index: int ref,
unique int child: @ruby_module_child_type ref
ruby_module_body(
unique int ruby_module: @ruby_module ref,
unique int body: @ruby_body_statement ref
);
@ruby_module_name_type = @ruby_scope_resolution | @ruby_token_constant
ruby_module_def(
unique int id: @ruby_module,
int name: @ruby_module_name_type ref
@@ -1074,13 +1082,9 @@ ruby_setter_def(
int name: @ruby_token_identifier ref
);
@ruby_singleton_class_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement
#keyset[ruby_singleton_class, index]
ruby_singleton_class_child(
int ruby_singleton_class: @ruby_singleton_class ref,
int index: int ref,
unique int child: @ruby_singleton_class_child_type ref
ruby_singleton_class_body(
unique int ruby_singleton_class: @ruby_singleton_class ref,
unique int body: @ruby_body_statement ref
);
ruby_singleton_class_def(
@@ -1088,6 +1092,13 @@ ruby_singleton_class_def(
int value: @ruby_underscore_arg ref
);
@ruby_singleton_method_body_type = @ruby_body_statement | @ruby_rescue_modifier | @ruby_underscore_arg
ruby_singleton_method_body(
unique int ruby_singleton_method: @ruby_singleton_method ref,
unique int body: @ruby_singleton_method_body_type ref
);
@ruby_singleton_method_object_type = @ruby_underscore_arg | @ruby_underscore_variable
ruby_singleton_method_parameters(
@@ -1095,15 +1106,6 @@ ruby_singleton_method_parameters(
unique int parameters: @ruby_method_parameters ref
);
@ruby_singleton_method_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_arg | @ruby_underscore_statement
#keyset[ruby_singleton_method, index]
ruby_singleton_method_child(
int ruby_singleton_method: @ruby_singleton_method ref,
int index: int ref,
unique int child: @ruby_singleton_method_child_type ref
);
ruby_singleton_method_def(
unique int id: @ruby_singleton_method,
int name: @ruby_underscore_method_name ref,
@@ -1344,7 +1346,7 @@ case @ruby_token.kind of
;
@ruby_ast_node = @ruby_alias | @ruby_alternative_pattern | @ruby_argument_list | @ruby_array | @ruby_array_pattern | @ruby_as_pattern | @ruby_assignment | @ruby_bare_string | @ruby_bare_symbol | @ruby_begin | @ruby_begin_block | @ruby_binary | @ruby_block | @ruby_block_argument | @ruby_block_parameter | @ruby_block_parameters | @ruby_break | @ruby_call | @ruby_case__ | @ruby_case_match | @ruby_chained_string | @ruby_class | @ruby_complex | @ruby_conditional | @ruby_delimited_symbol | @ruby_destructured_left_assignment | @ruby_destructured_parameter | @ruby_do | @ruby_do_block | @ruby_element_reference | @ruby_else | @ruby_elsif | @ruby_end_block | @ruby_ensure | @ruby_exception_variable | @ruby_exceptions | @ruby_expression_reference_pattern | @ruby_find_pattern | @ruby_for | @ruby_hash | @ruby_hash_pattern | @ruby_hash_splat_argument | @ruby_hash_splat_parameter | @ruby_heredoc_body | @ruby_if | @ruby_if_guard | @ruby_if_modifier | @ruby_in | @ruby_in_clause | @ruby_interpolation | @ruby_keyword_parameter | @ruby_keyword_pattern | @ruby_lambda | @ruby_lambda_parameters | @ruby_left_assignment_list | @ruby_method | @ruby_method_parameters | @ruby_module | @ruby_next | @ruby_operator_assignment | @ruby_optional_parameter | @ruby_pair | @ruby_parenthesized_pattern | @ruby_parenthesized_statements | @ruby_pattern | @ruby_program | @ruby_range | @ruby_rational | @ruby_redo | @ruby_regex | @ruby_rescue | @ruby_rescue_modifier | @ruby_rest_assignment | @ruby_retry | @ruby_return | @ruby_right_assignment_list | @ruby_scope_resolution | @ruby_setter | @ruby_singleton_class | @ruby_singleton_method | @ruby_splat_argument | @ruby_splat_parameter | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_superclass | @ruby_symbol_array | @ruby_then | @ruby_token | @ruby_unary | @ruby_undef | @ruby_unless | @ruby_unless_guard | @ruby_unless_modifier | @ruby_until | @ruby_until_modifier | @ruby_variable_reference_pattern | @ruby_when | @ruby_while | @ruby_while_modifier | @ruby_yield
@ruby_ast_node = @ruby_alias | @ruby_alternative_pattern | @ruby_argument_list | @ruby_array | @ruby_array_pattern | @ruby_as_pattern | @ruby_assignment | @ruby_bare_string | @ruby_bare_symbol | @ruby_begin | @ruby_begin_block | @ruby_binary | @ruby_block | @ruby_block_argument | @ruby_block_body | @ruby_block_parameter | @ruby_block_parameters | @ruby_body_statement | @ruby_break | @ruby_call | @ruby_case__ | @ruby_case_match | @ruby_chained_string | @ruby_class | @ruby_complex | @ruby_conditional | @ruby_delimited_symbol | @ruby_destructured_left_assignment | @ruby_destructured_parameter | @ruby_do | @ruby_do_block | @ruby_element_reference | @ruby_else | @ruby_elsif | @ruby_end_block | @ruby_ensure | @ruby_exception_variable | @ruby_exceptions | @ruby_expression_reference_pattern | @ruby_find_pattern | @ruby_for | @ruby_hash | @ruby_hash_pattern | @ruby_hash_splat_argument | @ruby_hash_splat_parameter | @ruby_heredoc_body | @ruby_if | @ruby_if_guard | @ruby_if_modifier | @ruby_in | @ruby_in_clause | @ruby_interpolation | @ruby_keyword_parameter | @ruby_keyword_pattern | @ruby_lambda | @ruby_lambda_parameters | @ruby_left_assignment_list | @ruby_method | @ruby_method_parameters | @ruby_module | @ruby_next | @ruby_operator_assignment | @ruby_optional_parameter | @ruby_pair | @ruby_parenthesized_pattern | @ruby_parenthesized_statements | @ruby_pattern | @ruby_program | @ruby_range | @ruby_rational | @ruby_redo | @ruby_regex | @ruby_rescue | @ruby_rescue_modifier | @ruby_rest_assignment | @ruby_retry | @ruby_return | @ruby_right_assignment_list | @ruby_scope_resolution | @ruby_setter | @ruby_singleton_class | @ruby_singleton_method | @ruby_splat_argument | @ruby_splat_parameter | @ruby_string__ | @ruby_string_array | @ruby_subshell | @ruby_superclass | @ruby_symbol_array | @ruby_then | @ruby_token | @ruby_unary | @ruby_undef | @ruby_unless | @ruby_unless_guard | @ruby_unless_modifier | @ruby_until | @ruby_until_modifier | @ruby_variable_reference_pattern | @ruby_when | @ruby_while | @ruby_while_modifier | @ruby_yield
@ruby_ast_node_parent = @file | @ruby_ast_node

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
class Location extends @location {
string toString() { none() }
}
class File extends @file {
string toString() { none() }
}
private predicate body_statement(AstNode body, int index, Location loc) {
exists(AstNode node, AstNode child | ruby_ast_node_info(child, _, _, loc) |
ruby_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_class_child(node, index, child)
or
ruby_do_block_def(node) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_do_block_child(node, index, child)
or
ruby_method_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_method_child(node, index, child)
or
ruby_module_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_module_child(node, index, child)
or
ruby_singleton_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_class_child(node, index, child)
or
ruby_singleton_method_def(node, _, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_method_child(node, index, child)
or
ruby_block_def(node) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "}") and
ruby_block_child(node, index, child)
)
}
from Location loc, File file, int start_line, int start_column, int end_line, int end_column
where
locations_default(loc, file, start_line, start_column, end_line, end_column) and
not exists(AstNode node | ruby_ast_node_info(node, _, _, loc) and body_statement(node, _, _))
or
exists(AstNode node |
ruby_ast_node_info(node, _, _, loc) and
exists(Location first |
body_statement(node, 0, first) and
locations_default(first, pragma[only_bind_into](file), start_line, start_column, _, _)
) and
exists(Location last |
last = max(Location l, int i | body_statement(node, i, l) | l order by i) and
locations_default(last, pragma[only_bind_into](file), _, _, end_line, end_column)
)
)
select loc, file, start_line, start_column, end_line, end_column

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,76 @@
class AstNode extends @ruby_ast_node_parent {
string toString() { none() }
}
class Location extends @location {
string toString() { none() }
}
private predicate body_statement(AstNode body, AstNode firstChild) {
exists(AstNode node |
ruby_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_class_child(node, 0, firstChild)
or
ruby_do_block_def(node) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_do_block_child(node, 0, firstChild)
or
ruby_method_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_method_child(node, 0, firstChild)
or
ruby_module_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_module_child(node, 0, firstChild)
or
ruby_singleton_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_class_child(node, 0, firstChild)
or
ruby_singleton_method_def(node, _, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_method_child(node, 0, firstChild)
or
ruby_block_def(node) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "}") and
ruby_block_child(node, 0, firstChild)
)
}
private predicate body_statement_child(AstNode body, int index, AstNode child) {
exists(AstNode parent, AstNode firstChild, int firstChildIndex |
body_statement(body, firstChild) and
ruby_ast_node_info(firstChild, parent, firstChildIndex, _) and
child =
rank[index + 1](AstNode c, int i |
ruby_ast_node_info(c, parent, i, _) and i >= firstChildIndex and c != body
|
c order by i
)
)
}
private predicate astNodeInfo(AstNode node, AstNode parent, int parent_index, Location loc) {
ruby_ast_node_info(node, parent, parent_index, loc) and
not body_statement(node, _) and
not body_statement_child(_, _, node)
}
from AstNode node, AstNode parent, int parent_index, Location loc
where
astNodeInfo(node, parent, parent_index, loc)
or
body_statement_child(parent, parent_index, node) and ruby_ast_node_info(node, _, _, loc)
or
body_statement(node, _) and
ruby_ast_node_info(node, parent, _, loc) and
parent_index = count(AstNode n | astNodeInfo(n, parent, _, _))
select node, parent, parent_index, loc

View File

@@ -0,0 +1,11 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode ruby_block, AstNode body
where
ruby_block_def(ruby_block) and
ruby_ast_node_info(body, ruby_block, _, _) and
ruby_tokeninfo(body, _, "}") and
ruby_block_child(ruby_block, _, _)
select ruby_block, body

View File

@@ -0,0 +1,11 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode ruby_block, AstNode body, int index, AstNode child
where
ruby_block_def(ruby_block) and
ruby_ast_node_info(body, ruby_block, _, _) and
ruby_tokeninfo(body, _, "}") and
ruby_block_child(ruby_block, index, child)
select body, index, child

View File

@@ -0,0 +1,18 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
/*
* It's not possible to generate fresh IDs for the new ruby_block_body nodes,
* therefore we re-purpose the "}"-token that closes the block and use its ID instead.
* As a result the AST will be missing the "}" tokens, but those are unlikely to be used
* for anything.
*/
from AstNode ruby_block, AstNode body
where
ruby_block_def(ruby_block) and
ruby_ast_node_info(body, ruby_block, _, _) and
ruby_tokeninfo(body, _, "}") and
ruby_block_child(ruby_block, _, _)
select body

View File

@@ -0,0 +1,36 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode node, AstNode body, int index, AstNode child
where
ruby_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_class_child(node, index, child)
or
ruby_do_block_def(node) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_do_block_child(node, index, child)
or
ruby_method_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_method_child(node, index, child)
or
ruby_module_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_module_child(node, index, child)
or
ruby_singleton_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_class_child(node, index, child)
or
ruby_singleton_method_def(node, _, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_method_child(node, index, child)
select body, index, child

View File

@@ -0,0 +1,43 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
/*
* It's not possible to generate fresh IDs for the new ruby_body_statement nodes,
* therefore we re-purpose the "end"-token that closes the block and use its ID instead.
* As a result the AST will be missing the "end" tokens, but those are unlikely to be used
* for anything.
*/
from AstNode node, AstNode body
where
ruby_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_class_child(node, _, _)
or
ruby_do_block_def(node) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_do_block_child(node, _, _)
or
ruby_method_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_method_child(node, _, _)
or
ruby_module_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_module_child(node, _, _)
or
ruby_singleton_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_class_child(node, _, _)
or
ruby_singleton_method_def(node, _, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_method_child(node, _, _)
select body

View File

@@ -0,0 +1,11 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode node, AstNode body
where
ruby_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_class_child(node, _, _)
select node, body

View File

@@ -0,0 +1,11 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode node, AstNode body
where
ruby_do_block_def(node) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_do_block_child(node, _, _)
select node, body

View File

@@ -0,0 +1,20 @@
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

View File

@@ -0,0 +1,11 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode node, AstNode body
where
ruby_module_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_module_child(node, _, _)
select node, body

View File

@@ -0,0 +1,11 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode node, AstNode body
where
ruby_singleton_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_class_child(node, _, _)
select node, body

View File

@@ -0,0 +1,17 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
from AstNode node, AstNode body
where
ruby_singleton_method_def(node, _, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_method_child(node, _, _)
or
ruby_singleton_method_child(node, 0, body) and
not exists(AstNode n |
ruby_ast_node_info(n, node, _, _) and
ruby_tokeninfo(n, _, "end")
)
select node, body

View File

@@ -0,0 +1,46 @@
class AstNode extends @ruby_ast_node {
string toString() { none() }
}
private predicate body_statement(AstNode body) {
exists(AstNode node |
ruby_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_class_child(node, _, _)
or
ruby_do_block_def(node) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_do_block_child(node, _, _)
or
ruby_method_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_method_child(node, _, _)
or
ruby_module_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_module_child(node, _, _)
or
ruby_singleton_class_def(node, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_class_child(node, _, _)
or
ruby_singleton_method_def(node, _, _) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "end") and
ruby_singleton_method_child(node, _, _)
or
ruby_block_def(node) and
ruby_ast_node_info(body, node, _, _) and
ruby_tokeninfo(body, _, "}") and
ruby_block_child(node, _, _)
)
}
from AstNode token, int kind, string value
where ruby_tokeninfo(token, kind, value) and not body_statement(token)
select token, kind, value

View File

@@ -0,0 +1,33 @@
description: Wrap class, module, method, and block bodies in a named node
compatibility: partial
ruby_block_body.rel: run ruby_block_body.qlo
ruby_block_body_def.rel: run ruby_block_body_def.qlo
ruby_block_body_child.rel: run ruby_block_body_child.qlo
ruby_block_child.rel: delete
ruby_body_statement_child.rel: run ruby_body_statement_child.qlo
ruby_body_statement_def.rel: run ruby_body_statement_def.qlo
ruby_class_body.rel: run ruby_class_body.qlo
ruby_class_child.rel: delete
ruby_do_block_body.rel: run ruby_do_block_body.qlo
ruby_do_block_child.rel: delete
ruby_method_body.rel: run ruby_method_body.qlo
ruby_method_child.rel: delete
ruby_module_body.rel: run ruby_module_body.qlo
ruby_module_child.rel: delete
ruby_singleton_class_body.rel: run ruby_singleton_class_body.qlo
ruby_singleton_class_child.rel: delete
ruby_singleton_method_body.rel: run ruby_singleton_method_body.qlo
ruby_singleton_method_child.rel: delete
ruby_ast_node_info.rel: run ruby_ast_node_info.qlo
ruby_tokeninfo.rel: run ruby_tokeninfo.qlo
locations_default.rel: run locations_default.qlo

View File

@@ -16,7 +16,7 @@ import codeql.ruby.Concepts
import codeql.ruby.DataFlow
from
HTTP::Client::Request request, DataFlow::Node disablingNode, DataFlow::Node origin, string ending
Http::Client::Request request, DataFlow::Node disablingNode, DataFlow::Node origin, string ending
where
request.disablesCertificateValidation(disablingNode, origin) and
// Showing the origin is only useful when it's a different node than the one disabling

View File

@@ -2260,12 +2260,8 @@ literals/literals.rb:
# 189| getAnOperand/getLeftOperand: [LocalVariableAccess] query
# 189| getAnOperand/getRightOperand: [HereDoc] <<'DOC'
# 189| getComponent: [StringTextComponent]
# 189| text without
# 190| getComponent: [StringInterpolationComponent] #{...}
# 190| getStmt: [MethodCall] call to interpolation
# 190| getReceiver: [SelfVariableAccess] self
# 190| getComponent: [StringTextComponent] !
# 190|
# 189| text without #{ interpolation } !
# 189|
# 193| getStmt: [AssignExpr] ... = ...
# 193| getAnOperand/getLeftOperand: [LocalVariableAccess] output
# 193| getAnOperand/getRightOperand: [HereDoc] <<`SCRIPT`
@@ -2293,6 +2289,17 @@ literals/literals.rb:
# 199| getKey: [SymbolLiteral] :Z
# 199| getComponent: [StringTextComponent] Z
# 199| getValue: [ConstantReadAccess] Z
# 201| getStmt: [StringLiteral] "@foo: #{...} @@bar: #{...} $_..."
# 201| getComponent: [StringTextComponent] @foo:
# 201| getComponent: [StringInterpolationComponent] #{...}
# 201| getStmt: [InstanceVariableAccess] @foo
# 201| getReceiver: [SelfVariableAccess] self
# 201| getComponent: [StringTextComponent] @@bar:
# 201| getComponent: [StringInterpolationComponent] #{...}
# 201| getStmt: [ClassVariableAccess] @@bar
# 201| getComponent: [StringTextComponent] $_:
# 201| getComponent: [StringInterpolationComponent] #{...}
# 201| getStmt: [GlobalVariableAccess] $_
control/loops.rb:
# 1| [Toplevel] loops.rb
# 2| getStmt: [AssignExpr] ... = ...

File diff suppressed because it is too large Load Diff

View File

@@ -709,6 +709,7 @@ exprValue
| literals/literals.rb:168:9:168:13 | <<SQL | \nselect * from table\n | string |
| literals/literals.rb:175:11:175:16 | <<-BLA | \nsome text\nand some more\n | string |
| literals/literals.rb:180:9:180:19 | <<~SQUIGGLY | \n indented stuff\n | string |
| literals/literals.rb:189:9:189:15 | <<'DOC' | \n text without #{ interpolation } !\n | string |
| literals/literals.rb:193:10:193:19 | <<`SCRIPT` | \n cat file.txt\n | string |
| literals/literals.rb:197:5:197:6 | 42 | 42 | int |
| literals/literals.rb:198:2:198:2 | :x | :x | symbol |
@@ -1585,6 +1586,7 @@ exprCfgNodeValue
| literals/literals.rb:168:9:168:13 | <<SQL | \nselect * from table\n | string |
| literals/literals.rb:175:11:175:16 | <<-BLA | \nsome text\nand some more\n | string |
| literals/literals.rb:180:9:180:19 | <<~SQUIGGLY | \n indented stuff\n | string |
| literals/literals.rb:189:9:189:15 | <<'DOC' | \n text without #{ interpolation } !\n | string |
| literals/literals.rb:193:10:193:19 | <<`SCRIPT` | \n cat file.txt\n | string |
| literals/literals.rb:197:5:197:6 | 42 | 42 | int |
| literals/literals.rb:198:2:198:2 | :x | :x | symbol |

View File

@@ -227,7 +227,7 @@ allLiterals
| literals.rb:175:11:175:16 | <<-BLA | HereDoc | \nsome text\nand some more\n |
| literals.rb:180:9:180:19 | <<~SQUIGGLY | HereDoc | \n indented stuff\n |
| literals.rb:184:9:184:15 | <<"DOC" | HereDoc | <none> |
| literals.rb:189:9:189:15 | <<'DOC' | HereDoc | <none> |
| literals.rb:189:9:189:15 | <<'DOC' | HereDoc | \n text without #{ interpolation } !\n |
| literals.rb:193:10:193:19 | <<`SCRIPT` | HereDoc | \n cat file.txt\n |
| literals.rb:197:5:197:6 | 42 | IntegerLiteral | 42 |
| literals.rb:198:1:198:9 | {...} | HashLiteral | <none> |
@@ -237,6 +237,7 @@ allLiterals
| literals.rb:199:1:199:9 | {...} | HashLiteral | <none> |
| literals.rb:199:2:199:2 | :y | SymbolLiteral | :y |
| literals.rb:199:7:199:7 | :Z | SymbolLiteral | :Z |
| literals.rb:201:1:201:35 | "@foo: #{...} @@bar: #{...} $_..." | StringLiteral | <none> |
stringlikeLiterals
| literals.rb:59:1:59:2 | "" | |
| literals.rb:60:1:60:2 | "" | |
@@ -345,12 +346,13 @@ stringlikeLiterals
| literals.rb:175:11:175:16 | <<-BLA | \nsome text\nand some more\n |
| literals.rb:180:9:180:19 | <<~SQUIGGLY | \n indented stuff\n |
| literals.rb:184:9:184:15 | <<"DOC" | <none> |
| literals.rb:189:9:189:15 | <<'DOC' | <none> |
| literals.rb:189:9:189:15 | <<'DOC' | \n text without #{ interpolation } !\n |
| literals.rb:193:10:193:19 | <<`SCRIPT` | \n cat file.txt\n |
| literals.rb:198:2:198:2 | :x | :x |
| literals.rb:198:6:198:6 | :y | :y |
| literals.rb:199:2:199:2 | :y | :y |
| literals.rb:199:7:199:7 | :Z | :Z |
| literals.rb:201:1:201:35 | "@foo: #{...} @@bar: #{...} $_..." | <none> |
stringLiterals
| literals.rb:59:1:59:2 | "" | |
| literals.rb:60:1:60:2 | "" | |
@@ -405,6 +407,7 @@ stringLiterals
| literals.rb:163:1:163:34 | "abcdefghijklmnopqrstuvwxyzabcdef" | abcdefghijklmnopqrstuvwxyzabcdef |
| literals.rb:164:1:164:35 | "foobarfoobarfoobarfoobarfooba..." | foobarfoobarfoobarfoobarfoobarfoo |
| literals.rb:165:1:165:40 | "foobar\\\\foobar\\\\foobar\\\\fooba..." | foobar\\foobar\\foobar\\foobar\\foobar |
| literals.rb:201:1:201:35 | "@foo: #{...} @@bar: #{...} $_..." | <none> |
regExpLiterals
| literals.rb:149:1:149:2 | // | | |
| literals.rb:150:1:150:5 | /foo/ | foo | |
@@ -626,14 +629,18 @@ stringComponents
| literals.rb:184:9:184:15 | <<"DOC" | HereDoc | 0 | literals.rb:184:16:185:11 | \n text with | StringTextComponent |
| literals.rb:184:9:184:15 | <<"DOC" | HereDoc | 1 | literals.rb:185:12:185:29 | #{...} | StringInterpolationComponent |
| literals.rb:184:9:184:15 | <<"DOC" | HereDoc | 2 | literals.rb:185:30:185:32 | !\n | StringTextComponent |
| literals.rb:189:9:189:15 | <<'DOC' | HereDoc | 0 | literals.rb:189:16:190:14 | \n text without | StringTextComponent |
| literals.rb:189:9:189:15 | <<'DOC' | HereDoc | 1 | literals.rb:190:15:190:32 | #{...} | StringInterpolationComponent |
| literals.rb:189:9:189:15 | <<'DOC' | HereDoc | 2 | literals.rb:190:33:190:35 | !\n | StringTextComponent |
| literals.rb:189:9:189:15 | <<'DOC' | HereDoc | 0 | literals.rb:189:16:190:35 | \n text without #{ interpolation } !\n | StringTextComponent |
| literals.rb:193:10:193:19 | <<`SCRIPT` | HereDoc | 0 | literals.rb:193:20:194:14 | \n cat file.txt\n | StringTextComponent |
| literals.rb:198:2:198:2 | :x | SymbolLiteral | 0 | literals.rb:198:2:198:2 | x | StringTextComponent |
| literals.rb:198:6:198:6 | :y | SymbolLiteral | 0 | literals.rb:198:6:198:6 | y | StringTextComponent |
| literals.rb:199:2:199:2 | :y | SymbolLiteral | 0 | literals.rb:199:2:199:2 | y | StringTextComponent |
| literals.rb:199:7:199:7 | :Z | SymbolLiteral | 0 | literals.rb:199:7:199:7 | Z | StringTextComponent |
| literals.rb:201:1:201:35 | "@foo: #{...} @@bar: #{...} $_..." | StringLiteral | 0 | literals.rb:201:2:201:7 | @foo: | StringTextComponent |
| literals.rb:201:1:201:35 | "@foo: #{...} @@bar: #{...} $_..." | StringLiteral | 1 | literals.rb:201:8:201:12 | #{...} | StringInterpolationComponent |
| literals.rb:201:1:201:35 | "@foo: #{...} @@bar: #{...} $_..." | StringLiteral | 2 | literals.rb:201:13:201:20 | @@bar: | StringTextComponent |
| literals.rb:201:1:201:35 | "@foo: #{...} @@bar: #{...} $_..." | StringLiteral | 3 | literals.rb:201:21:201:26 | #{...} | StringInterpolationComponent |
| literals.rb:201:1:201:35 | "@foo: #{...} @@bar: #{...} $_..." | StringLiteral | 4 | literals.rb:201:27:201:31 | $_: | StringTextComponent |
| literals.rb:201:1:201:35 | "@foo: #{...} @@bar: #{...} $_..." | StringLiteral | 5 | literals.rb:201:32:201:34 | #{...} | StringInterpolationComponent |
stringInterpolations
| literals.rb:71:10:71:19 | #{...} | 0 | literals.rb:71:13:71:17 | ... + ... | AddExpr |
| literals.rb:72:12:72:21 | #{...} | 0 | literals.rb:72:15:72:19 | ... + ... | AddExpr |
@@ -659,7 +666,9 @@ stringInterpolations
| literals.rb:146:10:146:19 | #{...} | 0 | literals.rb:146:13:146:17 | ... - ... | SubExpr |
| literals.rb:171:14:171:22 | #{...} | 0 | literals.rb:171:17:171:20 | call to name | MethodCall |
| literals.rb:185:12:185:29 | #{...} | 0 | literals.rb:185:15:185:27 | call to interpolation | MethodCall |
| literals.rb:190:15:190:32 | #{...} | 0 | literals.rb:190:18:190:30 | call to interpolation | MethodCall |
| literals.rb:201:8:201:12 | #{...} | 0 | literals.rb:201:9:201:12 | @foo | InstanceVariableAccess |
| literals.rb:201:21:201:26 | #{...} | 0 | literals.rb:201:22:201:26 | @@bar | ClassVariableAccess |
| literals.rb:201:32:201:34 | #{...} | 0 | literals.rb:201:33:201:34 | $_ | GlobalVariableAccess |
concatenatedStrings
| literals.rb:75:1:75:17 | "..." "..." | foobarbaz | 0 | literals.rb:75:1:75:5 | "foo" |
| literals.rb:75:1:75:17 | "..." "..." | foobarbaz | 1 | literals.rb:75:7:75:11 | "bar" |

View File

@@ -196,4 +196,6 @@ SCRIPT
x = 42
{x:, y:5}
{y: , Z:}
{y: , Z:}
"@foo: #@foo @@bar: #@@bar $_: #$_"

View File

@@ -13,6 +13,6 @@ query predicate renderToCalls(RenderToCall c) { any() }
query predicate linkToCalls(LinkToCall c) { any() }
query predicate httpResponses(HTTP::Server::HttpResponse r, DataFlow::Node body, string mimeType) {
query predicate httpResponses(Http::Server::HttpResponse r, DataFlow::Node body, string mimeType) {
r.getBody() = body and r.getMimetype() = mimeType
}

View File

@@ -2,7 +2,7 @@ import codeql.ruby.Concepts
import codeql.ruby.DataFlow
query predicate httpRequests(
HTTP::Client::Request r, string framework, DataFlow::Node urlPart, DataFlow::Node responseBody
Http::Client::Request r, string framework, DataFlow::Node urlPart, DataFlow::Node responseBody
) {
r.getFramework() = framework and
r.getAUrlPart() = urlPart and

View File

@@ -155,7 +155,7 @@ modules.rb:
# 116| XX::YY
#-----| super -> YY
# 120| Test::Foo1::Bar::Baz
# 123| Test::Foo1::Bar::Baz
modules_rec.rb:
# 1| B::A

View File

@@ -79,6 +79,7 @@ getTarget
| modules.rb:90:24:90:36 | call to prepend | calls.rb:93:5:93:20 | prepend |
| modules.rb:96:3:96:14 | call to include | calls.rb:92:5:92:20 | include |
| modules.rb:102:3:102:16 | call to prepend | calls.rb:93:5:93:20 | prepend |
| modules.rb:126:6:126:11 | call to new | calls.rb:99:5:99:16 | new |
| modules_rec.rb:8:3:8:11 | call to prepend | calls.rb:93:5:93:20 | prepend |
| private.rb:2:3:3:5 | call to private | calls.rb:94:5:94:20 | private |
| private.rb:10:3:10:19 | call to private | calls.rb:94:5:94:20 | private |

View File

@@ -272,3 +272,107 @@ lookupMethod
| private.rb:42:1:60:3 | F | private3 | private.rb:55:3:56:5 | private3 |
| private.rb:42:1:60:3 | F | private4 | private.rb:58:3:59:5 | private4 |
| private.rb:42:1:60:3 | F | public | private.rb:46:3:47:5 | public |
enclosingMethod
| calls.rb:2:5:2:14 | call to puts | calls.rb:1:1:3:3 | foo |
| calls.rb:2:5:2:14 | self | calls.rb:1:1:3:3 | foo |
| calls.rb:2:10:2:14 | "foo" | calls.rb:1:1:3:3 | foo |
| calls.rb:2:11:2:13 | foo | calls.rb:1:1:3:3 | foo |
| calls.rb:8:5:8:14 | call to puts | calls.rb:7:1:9:3 | bar |
| calls.rb:8:5:8:14 | self | calls.rb:7:1:9:3 | bar |
| calls.rb:8:10:8:14 | "bar" | calls.rb:7:1:9:3 | bar |
| calls.rb:8:11:8:13 | bar | calls.rb:7:1:9:3 | bar |
| calls.rb:38:9:38:18 | call to instance_m | calls.rb:37:5:43:7 | baz |
| calls.rb:38:9:38:18 | self | calls.rb:37:5:43:7 | baz |
| calls.rb:39:9:39:12 | self | calls.rb:37:5:43:7 | baz |
| calls.rb:39:9:39:23 | call to instance_m | calls.rb:37:5:43:7 | baz |
| calls.rb:41:9:41:19 | call to singleton_m | calls.rb:37:5:43:7 | baz |
| calls.rb:41:9:41:19 | self | calls.rb:37:5:43:7 | baz |
| calls.rb:42:9:42:12 | self | calls.rb:37:5:43:7 | baz |
| calls.rb:42:9:42:24 | call to singleton_m | calls.rb:37:5:43:7 | baz |
| calls.rb:53:9:53:13 | call to super | calls.rb:52:5:54:7 | baz |
| calls.rb:62:18:62:18 | a | calls.rb:62:1:65:3 | optional_arg |
| calls.rb:62:18:62:18 | a | calls.rb:62:1:65:3 | optional_arg |
| calls.rb:62:22:62:22 | 4 | calls.rb:62:1:65:3 | optional_arg |
| calls.rb:62:25:62:25 | b | calls.rb:62:1:65:3 | optional_arg |
| calls.rb:62:25:62:25 | b | calls.rb:62:1:65:3 | optional_arg |
| calls.rb:62:28:62:28 | 5 | calls.rb:62:1:65:3 | optional_arg |
| calls.rb:63:5:63:5 | a | calls.rb:62:1:65:3 | optional_arg |
| calls.rb:63:5:63:16 | call to bit_length | calls.rb:62:1:65:3 | optional_arg |
| calls.rb:64:5:64:5 | b | calls.rb:62:1:65:3 | optional_arg |
| calls.rb:64:5:64:16 | call to bit_length | calls.rb:62:1:65:3 | optional_arg |
| calls.rb:68:5:68:11 | yield ... | calls.rb:67:1:69:3 | call_block |
| calls.rb:68:11:68:11 | 1 | calls.rb:67:1:69:3 | call_block |
| calls.rb:72:5:72:7 | var | calls.rb:71:1:75:3 | foo |
| calls.rb:72:5:72:18 | ... = ... | calls.rb:71:1:75:3 | foo |
| calls.rb:72:11:72:14 | Hash | calls.rb:71:1:75:3 | foo |
| calls.rb:72:11:72:18 | call to new | calls.rb:71:1:75:3 | foo |
| calls.rb:73:5:73:7 | var | calls.rb:71:1:75:3 | foo |
| calls.rb:73:5:73:10 | ...[...] | calls.rb:71:1:75:3 | foo |
| calls.rb:73:9:73:9 | 1 | calls.rb:71:1:75:3 | foo |
| calls.rb:74:5:74:29 | call to call_block | calls.rb:71:1:75:3 | foo |
| calls.rb:74:5:74:29 | self | calls.rb:71:1:75:3 | foo |
| calls.rb:74:16:74:29 | { ... } | calls.rb:71:1:75:3 | foo |
| calls.rb:74:19:74:19 | x | calls.rb:71:1:75:3 | foo |
| calls.rb:74:19:74:19 | x | calls.rb:71:1:75:3 | foo |
| calls.rb:74:22:74:24 | var | calls.rb:71:1:75:3 | foo |
| calls.rb:74:22:74:27 | ...[...] | calls.rb:71:1:75:3 | foo |
| calls.rb:74:26:74:26 | x | calls.rb:71:1:75:3 | foo |
| calls.rb:110:15:110:19 | &body | calls.rb:110:3:116:5 | foreach |
| calls.rb:110:16:110:19 | body | calls.rb:110:3:116:5 | foreach |
| calls.rb:111:5:111:5 | x | calls.rb:110:3:116:5 | foreach |
| calls.rb:111:5:111:9 | ... = ... | calls.rb:110:3:116:5 | foreach |
| calls.rb:111:9:111:9 | 0 | calls.rb:110:3:116:5 | foreach |
| calls.rb:112:5:115:7 | while ... | calls.rb:110:3:116:5 | foreach |
| calls.rb:112:11:112:11 | x | calls.rb:110:3:116:5 | foreach |
| calls.rb:112:11:112:25 | ... < ... | calls.rb:110:3:116:5 | foreach |
| calls.rb:112:15:112:18 | self | calls.rb:110:3:116:5 | foreach |
| calls.rb:112:15:112:25 | call to length | calls.rb:110:3:116:5 | foreach |
| calls.rb:112:26:115:7 | do ... | calls.rb:110:3:116:5 | foreach |
| calls.rb:113:9:113:24 | yield ... | calls.rb:110:3:116:5 | foreach |
| calls.rb:113:15:113:15 | x | calls.rb:110:3:116:5 | foreach |
| calls.rb:113:18:113:21 | self | calls.rb:110:3:116:5 | foreach |
| calls.rb:113:18:113:24 | ...[...] | calls.rb:110:3:116:5 | foreach |
| calls.rb:113:23:113:23 | x | calls.rb:110:3:116:5 | foreach |
| calls.rb:114:9:114:9 | x | calls.rb:110:3:116:5 | foreach |
| calls.rb:114:9:114:9 | x | calls.rb:110:3:116:5 | foreach |
| calls.rb:114:9:114:14 | ... += ... | calls.rb:110:3:116:5 | foreach |
| calls.rb:114:9:114:14 | ... = ... | calls.rb:110:3:116:5 | foreach |
| calls.rb:114:11:114:12 | ... + ... | calls.rb:110:3:116:5 | foreach |
| calls.rb:114:14:114:14 | 1 | calls.rb:110:3:116:5 | foreach |
| calls.rb:120:5:120:20 | yield ... | calls.rb:119:1:121:3 | funny |
| calls.rb:120:11:120:20 | "prefix: " | calls.rb:119:1:121:3 | funny |
| calls.rb:120:12:120:19 | prefix: | calls.rb:119:1:121:3 | funny |
| calls.rb:137:14:137:15 | &b | calls.rb:137:1:139:3 | indirect |
| calls.rb:137:15:137:15 | b | calls.rb:137:1:139:3 | indirect |
| calls.rb:138:5:138:17 | call to call_block | calls.rb:137:1:139:3 | indirect |
| calls.rb:138:5:138:17 | self | calls.rb:137:1:139:3 | indirect |
| calls.rb:138:16:138:17 | &... | calls.rb:137:1:139:3 | indirect |
| calls.rb:138:17:138:17 | b | calls.rb:137:1:139:3 | indirect |
| calls.rb:146:9:146:12 | self | calls.rb:145:5:147:7 | s_method |
| calls.rb:146:9:146:17 | call to to_s | calls.rb:145:5:147:7 | s_method |
| calls.rb:171:9:171:12 | self | calls.rb:170:5:172:7 | singleton_a |
| calls.rb:171:9:171:24 | call to singleton_b | calls.rb:170:5:172:7 | singleton_a |
| calls.rb:175:9:175:12 | self | calls.rb:174:5:176:7 | singleton_b |
| calls.rb:175:9:175:24 | call to singleton_c | calls.rb:174:5:176:7 | singleton_b |
| calls.rb:182:9:182:12 | self | calls.rb:181:5:183:7 | singleton_d |
| calls.rb:182:9:182:24 | call to singleton_a | calls.rb:181:5:183:7 | singleton_d |
| hello.rb:3:9:3:22 | return | hello.rb:2:5:4:7 | hello |
| hello.rb:3:16:3:22 | "hello" | hello.rb:2:5:4:7 | hello |
| hello.rb:3:17:3:21 | hello | hello.rb:2:5:4:7 | hello |
| hello.rb:6:9:6:22 | return | hello.rb:5:5:7:7 | world |
| hello.rb:6:16:6:22 | "world" | hello.rb:5:5:7:7 | world |
| hello.rb:6:17:6:21 | world | hello.rb:5:5:7:7 | world |
| hello.rb:14:9:14:20 | return | hello.rb:13:5:15:7 | message |
| hello.rb:14:16:14:20 | call to hello | hello.rb:13:5:15:7 | message |
| hello.rb:14:16:14:20 | self | hello.rb:13:5:15:7 | message |
| hello.rb:20:9:20:40 | return | hello.rb:19:5:21:7 | message |
| hello.rb:20:16:20:20 | call to super | hello.rb:19:5:21:7 | message |
| hello.rb:20:16:20:26 | ... + ... | hello.rb:19:5:21:7 | message |
| hello.rb:20:16:20:34 | ... + ... | hello.rb:19:5:21:7 | message |
| hello.rb:20:16:20:40 | ... + ... | hello.rb:19:5:21:7 | message |
| hello.rb:20:24:20:26 | " " | hello.rb:19:5:21:7 | message |
| hello.rb:20:25:20:25 | | hello.rb:19:5:21:7 | message |
| hello.rb:20:30:20:34 | call to world | hello.rb:19:5:21:7 | message |
| hello.rb:20:30:20:34 | self | hello.rb:19:5:21:7 | message |
| hello.rb:20:38:20:40 | "!" | hello.rb:19:5:21:7 | message |
| hello.rb:20:39:20:39 | ! | hello.rb:19:5:21:7 | message |

View File

@@ -6,3 +6,5 @@ query MethodBase getMethod(Module m, string name) {
}
query MethodBase lookupMethod(Module m, string name) { result = M::lookupMethod(m, name) }
query predicate enclosingMethod(AstNode n, MethodBase m) { m = n.getEnclosingMethod() }

View File

@@ -54,9 +54,9 @@ getModule
| modules.rb:107:1:110:3 | MM |
| modules.rb:108:3:109:5 | MM::MM |
| modules.rb:112:1:113:3 | YY |
| modules.rb:115:1:118:3 | XX |
| modules.rb:115:1:121:3 | XX |
| modules.rb:116:7:117:9 | XX::YY |
| modules.rb:120:1:121:3 | Test::Foo1::Bar::Baz |
| modules.rb:123:1:124:3 | Test::Foo1::Bar::Baz |
| modules_rec.rb:1:1:2:3 | B::A |
| modules_rec.rb:4:1:5:3 | A::B |
| private.rb:1:1:29:3 | E |
@@ -72,7 +72,7 @@ getADeclaration
| calls.rb:97:1:100:3 | Object | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:97:1:100:3 | Object | calls.rb:97:1:100:3 | Object |
| calls.rb:97:1:100:3 | Object | hello.rb:1:1:22:3 | hello.rb |
| calls.rb:97:1:100:3 | Object | modules.rb:1:1:121:4 | modules.rb |
| calls.rb:97:1:100:3 | Object | modules.rb:1:1:129:4 | modules.rb |
| calls.rb:97:1:100:3 | Object | modules_rec.rb:1:1:11:26 | modules_rec.rb |
| calls.rb:97:1:100:3 | Object | private.rb:1:1:60:3 | private.rb |
| calls.rb:102:1:104:3 | Hash | calls.rb:102:1:104:3 | Hash |
@@ -115,9 +115,9 @@ getADeclaration
| modules.rb:107:1:110:3 | MM | modules.rb:107:1:110:3 | MM |
| modules.rb:108:3:109:5 | MM::MM | modules.rb:108:3:109:5 | MM |
| modules.rb:112:1:113:3 | YY | modules.rb:112:1:113:3 | YY |
| modules.rb:115:1:118:3 | XX | modules.rb:115:1:118:3 | XX |
| modules.rb:115:1:121:3 | XX | modules.rb:115:1:121:3 | XX |
| modules.rb:116:7:117:9 | XX::YY | modules.rb:116:7:117:9 | YY |
| modules.rb:120:1:121:3 | Test::Foo1::Bar::Baz | modules.rb:120:1:121:3 | Baz |
| modules.rb:123:1:124:3 | Test::Foo1::Bar::Baz | modules.rb:123:1:124:3 | Baz |
| modules_rec.rb:1:1:2:3 | B::A | modules_rec.rb:1:1:2:3 | A |
| modules_rec.rb:4:1:5:3 | A::B | modules_rec.rb:4:1:5:3 | B |
| private.rb:1:1:29:3 | E | private.rb:1:1:29:3 | E |
@@ -205,9 +205,10 @@ resolveConstantReadAccess
| modules.rb:103:10:103:13 | Foo2 | Test::Foo2 |
| modules.rb:108:10:108:11 | MM | MM |
| modules.rb:116:18:116:19 | YY | YY |
| modules.rb:120:8:120:11 | Test | Test |
| modules.rb:120:8:120:17 | Foo1 | Test::Foo1 |
| modules.rb:120:8:120:22 | Bar | Test::Foo1::Bar |
| modules.rb:123:8:123:11 | Test | Test |
| modules.rb:123:8:123:17 | Foo1 | Test::Foo1 |
| modules.rb:123:8:123:22 | Bar | Test::Foo1::Bar |
| modules.rb:126:6:126:7 | XX | XX |
| modules_rec.rb:1:7:1:7 | B | B |
| modules_rec.rb:4:7:4:7 | A | A |
| modules_rec.rb:7:11:7:11 | B | B |
@@ -276,11 +277,519 @@ resolveConstantWriteAccess
| modules.rb:108:3:109:5 | MM | MM::MM |
| modules.rb:108:3:109:5 | MM | MM::MM::MM |
| modules.rb:112:1:113:3 | YY | YY |
| modules.rb:115:1:118:3 | XX | XX |
| modules.rb:115:1:121:3 | XX | XX |
| modules.rb:116:7:117:9 | YY | XX::YY |
| modules.rb:120:1:121:3 | Baz | Test::Foo1::Bar::Baz |
| modules.rb:123:1:124:3 | Baz | Test::Foo1::Bar::Baz |
| modules_rec.rb:1:1:2:3 | A | B::A |
| modules_rec.rb:4:1:5:3 | B | A::B |
| modules_rec.rb:7:1:9:3 | A | A |
| private.rb:1:1:29:3 | E | E |
| private.rb:42:1:60:3 | F | F |
enclosingModule
| calls.rb:1:1:3:3 | foo | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:2:5:2:14 | call to puts | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:2:5:2:14 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:2:10:2:14 | "foo" | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:2:11:2:13 | foo | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:5:1:5:3 | call to foo | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:5:1:5:3 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:7:1:9:3 | bar | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:7:5:7:8 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:8:5:8:14 | call to puts | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:8:5:8:14 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:8:10:8:14 | "bar" | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:8:11:8:13 | bar | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:11:1:11:4 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:11:1:11:8 | call to bar | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:13:1:13:4 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:13:1:13:8 | call to foo | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:15:1:24:3 | M | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:16:5:16:23 | instance_m | calls.rb:15:1:24:3 | M |
| calls.rb:17:5:17:29 | singleton_m | calls.rb:15:1:24:3 | M |
| calls.rb:17:9:17:12 | self | calls.rb:15:1:24:3 | M |
| calls.rb:19:5:19:14 | call to instance_m | calls.rb:15:1:24:3 | M |
| calls.rb:19:5:19:14 | self | calls.rb:15:1:24:3 | M |
| calls.rb:20:5:20:8 | self | calls.rb:15:1:24:3 | M |
| calls.rb:20:5:20:19 | call to instance_m | calls.rb:15:1:24:3 | M |
| calls.rb:22:5:22:15 | call to singleton_m | calls.rb:15:1:24:3 | M |
| calls.rb:22:5:22:15 | self | calls.rb:15:1:24:3 | M |
| calls.rb:23:5:23:8 | self | calls.rb:15:1:24:3 | M |
| calls.rb:23:5:23:20 | call to singleton_m | calls.rb:15:1:24:3 | M |
| calls.rb:26:1:26:1 | M | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:26:1:26:12 | call to instance_m | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:27:1:27:1 | M | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:27:1:27:13 | call to singleton_m | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:29:1:44:3 | C | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:30:5:30:13 | call to include | calls.rb:29:1:44:3 | C |
| calls.rb:30:5:30:13 | self | calls.rb:29:1:44:3 | C |
| calls.rb:30:13:30:13 | M | calls.rb:29:1:44:3 | C |
| calls.rb:31:5:31:14 | call to instance_m | calls.rb:29:1:44:3 | C |
| calls.rb:31:5:31:14 | self | calls.rb:29:1:44:3 | C |
| calls.rb:32:5:32:8 | self | calls.rb:29:1:44:3 | C |
| calls.rb:32:5:32:19 | call to instance_m | calls.rb:29:1:44:3 | C |
| calls.rb:34:5:34:15 | call to singleton_m | calls.rb:29:1:44:3 | C |
| calls.rb:34:5:34:15 | self | calls.rb:29:1:44:3 | C |
| calls.rb:35:5:35:8 | self | calls.rb:29:1:44:3 | C |
| calls.rb:35:5:35:20 | call to singleton_m | calls.rb:29:1:44:3 | C |
| calls.rb:37:5:43:7 | baz | calls.rb:29:1:44:3 | C |
| calls.rb:38:9:38:18 | call to instance_m | calls.rb:29:1:44:3 | C |
| calls.rb:38:9:38:18 | self | calls.rb:29:1:44:3 | C |
| calls.rb:39:9:39:12 | self | calls.rb:29:1:44:3 | C |
| calls.rb:39:9:39:23 | call to instance_m | calls.rb:29:1:44:3 | C |
| calls.rb:41:9:41:19 | call to singleton_m | calls.rb:29:1:44:3 | C |
| calls.rb:41:9:41:19 | self | calls.rb:29:1:44:3 | C |
| calls.rb:42:9:42:12 | self | calls.rb:29:1:44:3 | C |
| calls.rb:42:9:42:24 | call to singleton_m | calls.rb:29:1:44:3 | C |
| calls.rb:46:1:46:1 | c | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:46:1:46:9 | ... = ... | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:46:5:46:5 | C | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:46:5:46:9 | call to new | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:47:1:47:1 | c | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:47:1:47:5 | call to baz | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:48:1:48:1 | c | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:48:1:48:13 | call to singleton_m | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:49:1:49:1 | c | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:49:1:49:12 | call to instance_m | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:51:1:55:3 | D | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:51:11:51:11 | C | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:52:5:54:7 | baz | calls.rb:51:1:55:3 | D |
| calls.rb:53:9:53:13 | call to super | calls.rb:51:1:55:3 | D |
| calls.rb:57:1:57:1 | d | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:57:1:57:9 | ... = ... | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:57:5:57:5 | D | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:57:5:57:9 | call to new | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:58:1:58:1 | d | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:58:1:58:5 | call to baz | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:59:1:59:1 | d | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:59:1:59:13 | call to singleton_m | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:60:1:60:1 | d | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:60:1:60:12 | call to instance_m | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:62:1:65:3 | optional_arg | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:62:18:62:18 | a | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:62:18:62:18 | a | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:62:22:62:22 | 4 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:62:25:62:25 | b | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:62:25:62:25 | b | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:62:28:62:28 | 5 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:63:5:63:5 | a | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:63:5:63:16 | call to bit_length | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:64:5:64:5 | b | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:64:5:64:16 | call to bit_length | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:67:1:69:3 | call_block | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:68:5:68:11 | yield ... | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:68:11:68:11 | 1 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:71:1:75:3 | foo | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:72:5:72:7 | var | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:72:5:72:18 | ... = ... | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:72:11:72:14 | Hash | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:72:11:72:18 | call to new | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:73:5:73:7 | var | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:73:5:73:10 | ...[...] | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:73:9:73:9 | 1 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:74:5:74:29 | call to call_block | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:74:5:74:29 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:74:16:74:29 | { ... } | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:74:19:74:19 | x | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:74:19:74:19 | x | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:74:22:74:24 | var | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:74:22:74:27 | ...[...] | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:74:26:74:26 | x | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:77:1:80:3 | Integer | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:78:5:78:23 | bit_length | calls.rb:77:1:80:3 | Integer |
| calls.rb:79:5:79:16 | abs | calls.rb:77:1:80:3 | Integer |
| calls.rb:82:1:84:3 | String | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:83:5:83:23 | capitalize | calls.rb:82:1:84:3 | String |
| calls.rb:86:1:88:3 | Kernel | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:87:5:87:17 | puts | calls.rb:86:1:88:3 | Kernel |
| calls.rb:90:1:95:3 | Module | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:91:5:91:24 | module_eval | calls.rb:90:1:95:3 | Module |
| calls.rb:92:5:92:20 | include | calls.rb:90:1:95:3 | Module |
| calls.rb:93:5:93:20 | prepend | calls.rb:90:1:95:3 | Module |
| calls.rb:94:5:94:20 | private | calls.rb:90:1:95:3 | Module |
| calls.rb:97:1:100:3 | Object | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:97:16:97:21 | Module | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:98:5:98:18 | call to include | calls.rb:97:1:100:3 | Object |
| calls.rb:98:5:98:18 | self | calls.rb:97:1:100:3 | Object |
| calls.rb:98:13:98:18 | Kernel | calls.rb:97:1:100:3 | Object |
| calls.rb:99:5:99:16 | new | calls.rb:97:1:100:3 | Object |
| calls.rb:102:1:104:3 | Hash | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:103:5:103:15 | [] | calls.rb:102:1:104:3 | Hash |
| calls.rb:106:1:117:3 | Array | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:107:3:107:13 | [] | calls.rb:106:1:117:3 | Array |
| calls.rb:108:3:108:17 | length | calls.rb:106:1:117:3 | Array |
| calls.rb:110:3:116:5 | foreach | calls.rb:106:1:117:3 | Array |
| calls.rb:110:15:110:19 | &body | calls.rb:106:1:117:3 | Array |
| calls.rb:110:16:110:19 | body | calls.rb:106:1:117:3 | Array |
| calls.rb:111:5:111:5 | x | calls.rb:106:1:117:3 | Array |
| calls.rb:111:5:111:9 | ... = ... | calls.rb:106:1:117:3 | Array |
| calls.rb:111:9:111:9 | 0 | calls.rb:106:1:117:3 | Array |
| calls.rb:112:5:115:7 | while ... | calls.rb:106:1:117:3 | Array |
| calls.rb:112:11:112:11 | x | calls.rb:106:1:117:3 | Array |
| calls.rb:112:11:112:25 | ... < ... | calls.rb:106:1:117:3 | Array |
| calls.rb:112:15:112:18 | self | calls.rb:106:1:117:3 | Array |
| calls.rb:112:15:112:25 | call to length | calls.rb:106:1:117:3 | Array |
| calls.rb:112:26:115:7 | do ... | calls.rb:106:1:117:3 | Array |
| calls.rb:113:9:113:24 | yield ... | calls.rb:106:1:117:3 | Array |
| calls.rb:113:15:113:15 | x | calls.rb:106:1:117:3 | Array |
| calls.rb:113:18:113:21 | self | calls.rb:106:1:117:3 | Array |
| calls.rb:113:18:113:24 | ...[...] | calls.rb:106:1:117:3 | Array |
| calls.rb:113:23:113:23 | x | calls.rb:106:1:117:3 | Array |
| calls.rb:114:9:114:9 | x | calls.rb:106:1:117:3 | Array |
| calls.rb:114:9:114:9 | x | calls.rb:106:1:117:3 | Array |
| calls.rb:114:9:114:14 | ... += ... | calls.rb:106:1:117:3 | Array |
| calls.rb:114:9:114:14 | ... = ... | calls.rb:106:1:117:3 | Array |
| calls.rb:114:11:114:12 | ... + ... | calls.rb:106:1:117:3 | Array |
| calls.rb:114:14:114:14 | 1 | calls.rb:106:1:117:3 | Array |
| calls.rb:119:1:121:3 | funny | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:120:5:120:20 | yield ... | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:120:11:120:20 | "prefix: " | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:120:12:120:19 | prefix: | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:123:1:123:30 | call to funny | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:123:1:123:30 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:123:7:123:30 | { ... } | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:123:10:123:10 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:123:10:123:10 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:123:13:123:29 | call to puts | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:123:13:123:29 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:123:18:123:18 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:123:18:123:29 | call to capitalize | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:125:1:125:3 | "a" | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:125:1:125:14 | call to capitalize | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:125:2:125:2 | a | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:126:1:126:1 | 1 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:126:1:126:12 | call to bit_length | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:127:1:127:1 | 1 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:127:1:127:5 | call to abs | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:1:129:13 | Array | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:1:129:13 | [...] | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:1:129:13 | call to [] | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:1:129:62 | call to foreach | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:2:129:4 | "a" | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:3:129:3 | a | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:6:129:8 | "b" | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:7:129:7 | b | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:10:129:12 | "c" | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:11:129:11 | c | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:23:129:62 | { ... } | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:26:129:26 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:26:129:26 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:29:129:29 | v | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:29:129:29 | v | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:32:129:61 | call to puts | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:32:129:61 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:37:129:61 | "#{...} -> #{...}" | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:38:129:41 | #{...} | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:40:129:40 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:42:129:45 | -> | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:46:129:60 | #{...} | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:48:129:48 | v | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:129:48:129:59 | call to capitalize | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:1:131:7 | Array | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:1:131:7 | [...] | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:1:131:7 | call to [] | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:1:131:35 | call to foreach | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:2:131:2 | 1 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:4:131:4 | 2 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:6:131:6 | 3 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:17:131:35 | { ... } | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:20:131:20 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:20:131:20 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:23:131:23 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:131:23:131:34 | call to bit_length | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:1:133:7 | Array | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:1:133:7 | [...] | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:1:133:7 | call to [] | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:1:133:40 | call to foreach | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:2:133:2 | 1 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:4:133:4 | 2 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:6:133:6 | 3 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:17:133:40 | { ... } | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:20:133:20 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:20:133:20 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:23:133:39 | call to puts | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:23:133:39 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:28:133:28 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:133:28:133:39 | call to capitalize | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:1:135:8 | Array | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:1:135:8 | [...] | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:1:135:8 | call to [] | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:1:135:37 | call to foreach | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:2:135:2 | 1 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:4:135:5 | - ... | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:5:135:5 | 2 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:7:135:7 | 3 | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:18:135:37 | { ... } | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:21:135:21 | _ | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:21:135:21 | _ | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:24:135:24 | v | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:24:135:24 | v | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:27:135:36 | call to puts | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:27:135:36 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:32:135:32 | v | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:135:32:135:36 | call to abs | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:137:1:139:3 | indirect | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:137:14:137:15 | &b | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:137:15:137:15 | b | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:138:5:138:17 | call to call_block | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:138:5:138:17 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:138:16:138:17 | &... | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:138:17:138:17 | b | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:141:1:141:28 | call to indirect | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:141:1:141:28 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:141:10:141:28 | { ... } | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:141:13:141:13 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:141:13:141:13 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:141:16:141:16 | i | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:141:16:141:27 | call to bit_length | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:144:1:148:3 | S | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:145:5:147:7 | s_method | calls.rb:144:1:148:3 | S |
| calls.rb:146:9:146:12 | self | calls.rb:144:1:148:3 | S |
| calls.rb:146:9:146:17 | call to to_s | calls.rb:144:1:148:3 | S |
| calls.rb:150:1:153:3 | A | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:150:11:150:11 | S | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:151:5:152:7 | to_s | calls.rb:150:1:153:3 | A |
| calls.rb:155:1:158:3 | B | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:155:11:155:11 | S | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:156:5:157:7 | to_s | calls.rb:155:1:158:3 | B |
| calls.rb:160:1:160:1 | S | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:160:1:160:5 | call to new | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:160:1:160:14 | call to s_method | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:161:1:161:1 | A | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:161:1:161:5 | call to new | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:161:1:161:14 | call to s_method | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:162:1:162:1 | B | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:162:1:162:5 | call to new | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:162:1:162:14 | call to s_method | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:164:1:165:3 | private_on_main | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:167:1:167:15 | call to private_on_main | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:167:1:167:15 | self | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:169:1:184:3 | Singletons | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:170:5:172:7 | singleton_a | calls.rb:169:1:184:3 | Singletons |
| calls.rb:170:9:170:12 | self | calls.rb:169:1:184:3 | Singletons |
| calls.rb:171:9:171:12 | self | calls.rb:169:1:184:3 | Singletons |
| calls.rb:171:9:171:24 | call to singleton_b | calls.rb:169:1:184:3 | Singletons |
| calls.rb:174:5:176:7 | singleton_b | calls.rb:169:1:184:3 | Singletons |
| calls.rb:174:9:174:12 | self | calls.rb:169:1:184:3 | Singletons |
| calls.rb:175:9:175:12 | self | calls.rb:169:1:184:3 | Singletons |
| calls.rb:175:9:175:24 | call to singleton_c | calls.rb:169:1:184:3 | Singletons |
| calls.rb:178:5:179:7 | singleton_c | calls.rb:169:1:184:3 | Singletons |
| calls.rb:178:9:178:12 | self | calls.rb:169:1:184:3 | Singletons |
| calls.rb:181:5:183:7 | singleton_d | calls.rb:169:1:184:3 | Singletons |
| calls.rb:181:9:181:12 | self | calls.rb:169:1:184:3 | Singletons |
| calls.rb:182:9:182:12 | self | calls.rb:169:1:184:3 | Singletons |
| calls.rb:182:9:182:24 | call to singleton_a | calls.rb:169:1:184:3 | Singletons |
| calls.rb:186:1:186:10 | Singletons | calls.rb:1:1:186:22 | calls.rb |
| calls.rb:186:1:186:22 | call to singleton_a | calls.rb:1:1:186:22 | calls.rb |
| hello.rb:1:1:8:3 | EnglishWords | hello.rb:1:1:22:3 | hello.rb |
| hello.rb:2:5:4:7 | hello | hello.rb:1:1:8:3 | EnglishWords |
| hello.rb:3:9:3:22 | return | hello.rb:1:1:8:3 | EnglishWords |
| hello.rb:3:16:3:22 | "hello" | hello.rb:1:1:8:3 | EnglishWords |
| hello.rb:3:17:3:21 | hello | hello.rb:1:1:8:3 | EnglishWords |
| hello.rb:5:5:7:7 | world | hello.rb:1:1:8:3 | EnglishWords |
| hello.rb:6:9:6:22 | return | hello.rb:1:1:8:3 | EnglishWords |
| hello.rb:6:16:6:22 | "world" | hello.rb:1:1:8:3 | EnglishWords |
| hello.rb:6:17:6:21 | world | hello.rb:1:1:8:3 | EnglishWords |
| hello.rb:11:1:16:3 | Greeting | hello.rb:1:1:22:3 | hello.rb |
| hello.rb:12:5:12:24 | call to include | hello.rb:11:1:16:3 | Greeting |
| hello.rb:12:5:12:24 | self | hello.rb:11:1:16:3 | Greeting |
| hello.rb:12:13:12:24 | EnglishWords | hello.rb:11:1:16:3 | Greeting |
| hello.rb:13:5:15:7 | message | hello.rb:11:1:16:3 | Greeting |
| hello.rb:14:9:14:20 | return | hello.rb:11:1:16:3 | Greeting |
| hello.rb:14:16:14:20 | call to hello | hello.rb:11:1:16:3 | Greeting |
| hello.rb:14:16:14:20 | self | hello.rb:11:1:16:3 | Greeting |
| hello.rb:18:1:22:3 | HelloWorld | hello.rb:1:1:22:3 | hello.rb |
| hello.rb:18:20:18:27 | Greeting | hello.rb:1:1:22:3 | hello.rb |
| hello.rb:19:5:21:7 | message | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:9:20:40 | return | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:16:20:20 | call to super | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:16:20:26 | ... + ... | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:16:20:34 | ... + ... | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:16:20:40 | ... + ... | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:24:20:26 | " " | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:25:20:25 | | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:30:20:34 | call to world | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:30:20:34 | self | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:38:20:40 | "!" | hello.rb:18:1:22:3 | HelloWorld |
| hello.rb:20:39:20:39 | ! | hello.rb:18:1:22:3 | HelloWorld |
| modules.rb:1:1:2:3 | Empty | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:4:1:24:3 | Foo | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:5:3:14:5 | Bar | modules.rb:4:1:24:3 | Foo |
| modules.rb:6:5:7:7 | ClassInFooBar | modules.rb:5:3:14:5 | Bar |
| modules.rb:9:5:10:7 | method_in_foo_bar | modules.rb:5:3:14:5 | Bar |
| modules.rb:12:5:12:26 | call to puts | modules.rb:5:3:14:5 | Bar |
| modules.rb:12:5:12:26 | self | modules.rb:5:3:14:5 | Bar |
| modules.rb:12:10:12:26 | "module Foo::Bar" | modules.rb:5:3:14:5 | Bar |
| modules.rb:12:11:12:25 | module Foo::Bar | modules.rb:5:3:14:5 | Bar |
| modules.rb:13:5:13:15 | $global_var | modules.rb:5:3:14:5 | Bar |
| modules.rb:13:5:13:19 | ... = ... | modules.rb:5:3:14:5 | Bar |
| modules.rb:13:19:13:19 | 0 | modules.rb:5:3:14:5 | Bar |
| modules.rb:16:3:17:5 | method_in_foo | modules.rb:4:1:24:3 | Foo |
| modules.rb:19:3:20:5 | ClassInFoo | modules.rb:4:1:24:3 | Foo |
| modules.rb:22:3:22:19 | call to puts | modules.rb:4:1:24:3 | Foo |
| modules.rb:22:3:22:19 | self | modules.rb:4:1:24:3 | Foo |
| modules.rb:22:8:22:19 | "module Foo" | modules.rb:4:1:24:3 | Foo |
| modules.rb:22:9:22:18 | module Foo | modules.rb:4:1:24:3 | Foo |
| modules.rb:23:3:23:13 | $global_var | modules.rb:4:1:24:3 | Foo |
| modules.rb:23:3:23:17 | ... = ... | modules.rb:4:1:24:3 | Foo |
| modules.rb:23:17:23:17 | 1 | modules.rb:4:1:24:3 | Foo |
| modules.rb:26:1:35:3 | Foo | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:27:3:28:5 | method_in_another_definition_of_foo | modules.rb:26:1:35:3 | Foo |
| modules.rb:30:3:31:5 | ClassInAnotherDefinitionOfFoo | modules.rb:26:1:35:3 | Foo |
| modules.rb:33:3:33:25 | call to puts | modules.rb:26:1:35:3 | Foo |
| modules.rb:33:3:33:25 | self | modules.rb:26:1:35:3 | Foo |
| modules.rb:33:8:33:25 | "module Foo again" | modules.rb:26:1:35:3 | Foo |
| modules.rb:33:9:33:24 | module Foo again | modules.rb:26:1:35:3 | Foo |
| modules.rb:34:3:34:13 | $global_var | modules.rb:26:1:35:3 | Foo |
| modules.rb:34:3:34:17 | ... = ... | modules.rb:26:1:35:3 | Foo |
| modules.rb:34:17:34:17 | 2 | modules.rb:26:1:35:3 | Foo |
| modules.rb:37:1:46:3 | Bar | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:38:3:39:5 | method_a | modules.rb:37:1:46:3 | Bar |
| modules.rb:41:3:42:5 | method_b | modules.rb:37:1:46:3 | Bar |
| modules.rb:44:3:44:19 | call to puts | modules.rb:37:1:46:3 | Bar |
| modules.rb:44:3:44:19 | self | modules.rb:37:1:46:3 | Bar |
| modules.rb:44:8:44:19 | "module Bar" | modules.rb:37:1:46:3 | Bar |
| modules.rb:44:9:44:18 | module Bar | modules.rb:37:1:46:3 | Bar |
| modules.rb:45:3:45:13 | $global_var | modules.rb:37:1:46:3 | Bar |
| modules.rb:45:3:45:17 | ... = ... | modules.rb:37:1:46:3 | Bar |
| modules.rb:45:17:45:17 | 3 | modules.rb:37:1:46:3 | Bar |
| modules.rb:48:1:57:3 | Bar | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:48:8:48:10 | Foo | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:49:3:50:5 | ClassInAnotherDefinitionOfFooBar | modules.rb:48:1:57:3 | Bar |
| modules.rb:52:3:53:5 | method_in_another_definition_of_foo_bar | modules.rb:48:1:57:3 | Bar |
| modules.rb:55:3:55:30 | call to puts | modules.rb:48:1:57:3 | Bar |
| modules.rb:55:3:55:30 | self | modules.rb:48:1:57:3 | Bar |
| modules.rb:55:8:55:30 | "module Foo::Bar again" | modules.rb:48:1:57:3 | Bar |
| modules.rb:55:9:55:29 | module Foo::Bar again | modules.rb:48:1:57:3 | Bar |
| modules.rb:56:3:56:13 | $global_var | modules.rb:48:1:57:3 | Bar |
| modules.rb:56:3:56:17 | ... = ... | modules.rb:48:1:57:3 | Bar |
| modules.rb:56:17:56:17 | 4 | modules.rb:48:1:57:3 | Bar |
| modules.rb:60:1:61:3 | MyModuleInGlobalScope | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:63:1:81:3 | Test | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:65:3:68:5 | Foo1 | modules.rb:63:1:81:3 | Test |
| modules.rb:66:5:67:7 | Bar | modules.rb:65:3:68:5 | Foo1 |
| modules.rb:66:11:66:14 | Foo1 | modules.rb:65:3:68:5 | Foo1 |
| modules.rb:70:3:74:5 | Foo2 | modules.rb:63:1:81:3 | Test |
| modules.rb:71:5:71:19 | Foo2 | modules.rb:70:3:74:5 | Foo2 |
| modules.rb:72:5:73:7 | Bar | modules.rb:70:3:74:5 | Foo2 |
| modules.rb:72:11:72:14 | Foo2 | modules.rb:70:3:74:5 | Foo2 |
| modules.rb:76:3:80:5 | Foo3 | modules.rb:63:1:81:3 | Test |
| modules.rb:77:5:77:8 | Foo3 | modules.rb:76:3:80:5 | Foo3 |
| modules.rb:77:5:77:17 | ... = ... | modules.rb:76:3:80:5 | Foo3 |
| modules.rb:77:12:77:17 | Object | modules.rb:76:3:80:5 | Foo3 |
| modules.rb:78:5:79:7 | Bar | modules.rb:76:3:80:5 | Foo3 |
| modules.rb:78:11:78:14 | Foo3 | modules.rb:76:3:80:5 | Foo3 |
| modules.rb:83:1:86:3 | Other | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:84:3:85:5 | Foo1 | modules.rb:83:1:86:3 | Other |
| modules.rb:88:1:93:3 | IncludeTest | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:89:3:89:16 | call to include | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:89:3:89:16 | self | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:89:11:89:16 | Test | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:90:3:90:8 | Object | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:90:3:90:38 | call to module_eval | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:90:22:90:38 | { ... } | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:90:24:90:36 | call to prepend | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:90:24:90:36 | self | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:90:32:90:36 | Other | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:91:3:92:5 | Y | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:91:10:91:13 | Foo1 | modules.rb:88:1:93:3 | IncludeTest |
| modules.rb:95:1:99:3 | IncludeTest2 | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:96:3:96:14 | call to include | modules.rb:95:1:99:3 | IncludeTest2 |
| modules.rb:96:3:96:14 | self | modules.rb:95:1:99:3 | IncludeTest2 |
| modules.rb:96:11:96:14 | Test | modules.rb:95:1:99:3 | IncludeTest2 |
| modules.rb:97:3:98:5 | Z | modules.rb:95:1:99:3 | IncludeTest2 |
| modules.rb:97:10:97:13 | Foo1 | modules.rb:95:1:99:3 | IncludeTest2 |
| modules.rb:101:1:105:3 | PrependTest | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:102:3:102:16 | call to prepend | modules.rb:101:1:105:3 | PrependTest |
| modules.rb:102:3:102:16 | self | modules.rb:101:1:105:3 | PrependTest |
| modules.rb:102:11:102:16 | Test | modules.rb:101:1:105:3 | PrependTest |
| modules.rb:103:3:104:5 | Y | modules.rb:101:1:105:3 | PrependTest |
| modules.rb:103:10:103:13 | Foo2 | modules.rb:101:1:105:3 | PrependTest |
| modules.rb:107:1:110:3 | MM | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:108:3:109:5 | MM | modules.rb:107:1:110:3 | MM |
| modules.rb:108:10:108:11 | MM | modules.rb:107:1:110:3 | MM |
| modules.rb:112:1:113:3 | YY | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:115:1:121:3 | XX | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:116:7:117:9 | YY | modules.rb:115:1:121:3 | XX |
| modules.rb:116:18:116:19 | YY | modules.rb:115:1:121:3 | XX |
| modules.rb:119:7:120:9 | class << ... | modules.rb:115:1:121:3 | XX |
| modules.rb:119:16:119:19 | self | modules.rb:115:1:121:3 | XX |
| modules.rb:123:1:124:3 | Baz | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:123:8:123:11 | Test | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:123:8:123:17 | Foo1 | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:123:8:123:22 | Bar | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:126:1:126:2 | xx | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:126:1:126:11 | ... = ... | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:126:6:126:7 | XX | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:126:6:126:11 | call to new | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:128:1:129:3 | class << ... | modules.rb:1:1:129:4 | modules.rb |
| modules.rb:128:10:128:11 | xx | modules.rb:1:1:129:4 | modules.rb |
| modules_rec.rb:1:1:2:3 | A | modules_rec.rb:1:1:11:26 | modules_rec.rb |
| modules_rec.rb:1:7:1:7 | B | modules_rec.rb:1:1:11:26 | modules_rec.rb |
| modules_rec.rb:4:1:5:3 | B | modules_rec.rb:1:1:11:26 | modules_rec.rb |
| modules_rec.rb:4:7:4:7 | A | modules_rec.rb:1:1:11:26 | modules_rec.rb |
| modules_rec.rb:7:1:9:3 | A | modules_rec.rb:1:1:11:26 | modules_rec.rb |
| modules_rec.rb:7:11:7:11 | B | modules_rec.rb:1:1:11:26 | modules_rec.rb |
| modules_rec.rb:8:3:8:11 | call to prepend | modules_rec.rb:7:1:9:3 | A |
| modules_rec.rb:8:3:8:11 | self | modules_rec.rb:7:1:9:3 | A |
| modules_rec.rb:8:11:8:11 | B | modules_rec.rb:7:1:9:3 | A |
| modules_rec.rb:11:1:11:9 | call to prepend | modules_rec.rb:1:1:11:26 | modules_rec.rb |
| modules_rec.rb:11:1:11:9 | self | modules_rec.rb:1:1:11:26 | modules_rec.rb |
| modules_rec.rb:11:9:11:9 | A | modules_rec.rb:1:1:11:26 | modules_rec.rb |
| private.rb:1:1:29:3 | E | private.rb:1:1:60:3 | private.rb |
| private.rb:2:3:3:5 | call to private | private.rb:1:1:29:3 | E |
| private.rb:2:3:3:5 | self | private.rb:1:1:29:3 | E |
| private.rb:2:11:3:5 | private1 | private.rb:1:1:29:3 | E |
| private.rb:5:3:6:5 | public | private.rb:1:1:29:3 | E |
| private.rb:8:3:9:5 | private2 | private.rb:1:1:29:3 | E |
| private.rb:10:3:10:19 | call to private | private.rb:1:1:29:3 | E |
| private.rb:10:3:10:19 | self | private.rb:1:1:29:3 | E |
| private.rb:10:11:10:19 | :private2 | private.rb:1:1:29:3 | E |
| private.rb:10:11:10:19 | private2 | private.rb:1:1:29:3 | E |
| private.rb:12:3:12:9 | call to private | private.rb:1:1:29:3 | E |
| private.rb:12:3:12:9 | self | private.rb:1:1:29:3 | E |
| private.rb:14:3:15:5 | private3 | private.rb:1:1:29:3 | E |
| private.rb:17:3:18:5 | private4 | private.rb:1:1:29:3 | E |
| private.rb:20:3:21:5 | public2 | private.rb:1:1:29:3 | E |
| private.rb:20:7:20:10 | self | private.rb:1:1:29:3 | E |
| private.rb:23:3:24:5 | call to private_class_method | private.rb:1:1:29:3 | E |
| private.rb:23:3:24:5 | self | private.rb:1:1:29:3 | E |
| private.rb:23:24:24:5 | private5 | private.rb:1:1:29:3 | E |
| private.rb:23:28:23:31 | self | private.rb:1:1:29:3 | E |
| private.rb:26:3:27:5 | private6 | private.rb:1:1:29:3 | E |
| private.rb:26:7:26:10 | self | private.rb:1:1:29:3 | E |
| private.rb:28:3:28:32 | call to private_class_method | private.rb:1:1:29:3 | E |
| private.rb:28:3:28:32 | self | private.rb:1:1:29:3 | E |
| private.rb:28:24:28:32 | :private6 | private.rb:1:1:29:3 | E |
| private.rb:28:24:28:32 | private6 | private.rb:1:1:29:3 | E |
| private.rb:31:1:32:3 | private_on_main | private.rb:1:1:60:3 | private.rb |
| private.rb:34:1:34:1 | E | private.rb:1:1:60:3 | private.rb |
| private.rb:34:1:34:5 | call to new | private.rb:1:1:60:3 | private.rb |
| private.rb:34:1:34:14 | call to private1 | private.rb:1:1:60:3 | private.rb |
| private.rb:35:1:35:1 | E | private.rb:1:1:60:3 | private.rb |
| private.rb:35:1:35:5 | call to new | private.rb:1:1:60:3 | private.rb |
| private.rb:35:1:35:14 | call to private2 | private.rb:1:1:60:3 | private.rb |
| private.rb:36:1:36:1 | E | private.rb:1:1:60:3 | private.rb |
| private.rb:36:1:36:5 | call to new | private.rb:1:1:60:3 | private.rb |
| private.rb:36:1:36:14 | call to private3 | private.rb:1:1:60:3 | private.rb |
| private.rb:37:1:37:1 | E | private.rb:1:1:60:3 | private.rb |
| private.rb:37:1:37:5 | call to new | private.rb:1:1:60:3 | private.rb |
| private.rb:37:1:37:14 | call to private4 | private.rb:1:1:60:3 | private.rb |
| private.rb:38:1:38:1 | E | private.rb:1:1:60:3 | private.rb |
| private.rb:38:1:38:5 | call to new | private.rb:1:1:60:3 | private.rb |
| private.rb:38:1:38:12 | call to public | private.rb:1:1:60:3 | private.rb |
| private.rb:40:1:40:15 | call to private_on_main | private.rb:1:1:60:3 | private.rb |
| private.rb:40:1:40:15 | self | private.rb:1:1:60:3 | private.rb |
| private.rb:42:1:60:3 | F | private.rb:1:1:60:3 | private.rb |
| private.rb:43:3:44:5 | call to private | private.rb:42:1:60:3 | F |
| private.rb:43:3:44:5 | self | private.rb:42:1:60:3 | F |
| private.rb:43:11:44:5 | private1 | private.rb:42:1:60:3 | F |
| private.rb:46:3:47:5 | public | private.rb:42:1:60:3 | F |
| private.rb:49:3:50:5 | private2 | private.rb:42:1:60:3 | F |
| private.rb:51:3:51:19 | call to private | private.rb:42:1:60:3 | F |
| private.rb:51:3:51:19 | self | private.rb:42:1:60:3 | F |
| private.rb:51:11:51:19 | :private2 | private.rb:42:1:60:3 | F |
| private.rb:51:11:51:19 | private2 | private.rb:42:1:60:3 | F |
| private.rb:53:3:53:9 | call to private | private.rb:42:1:60:3 | F |
| private.rb:53:3:53:9 | self | private.rb:42:1:60:3 | F |
| private.rb:55:3:56:5 | private3 | private.rb:42:1:60:3 | F |
| private.rb:58:3:59:5 | private4 | private.rb:42:1:60:3 | F |

View File

@@ -18,3 +18,5 @@ query predicate resolveConstantReadAccess(ConstantReadAccess a, string s) {
query predicate resolveConstantWriteAccess(ConstantWriteAccess c, string s) {
s = Internal::resolveConstantWriteAccess(c)
}
query predicate enclosingModule(AstNode n, ModuleBase m) { m = n.getEnclosingModule() }

View File

@@ -115,7 +115,15 @@ end
module XX
class YY < YY
end
class << self
end
end
module Test::Foo1::Bar::Baz
end
xx = XX.new
class << xx
end

View File

@@ -147,7 +147,7 @@ modules.rb:
# 116| XX::YY
#-----| -> YY
# 120| Test::Foo1::Bar::Baz
# 123| Test::Foo1::Bar::Baz
modules_rec.rb:
# 1| B::A