mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Ruby: Distinguish symbols from strings in ConstantValue
This commit is contained in:
@@ -239,7 +239,7 @@ module HTTP {
|
||||
string getUrlPattern() {
|
||||
exists(CfgNodes::ExprNodes::StringlikeLiteralCfgNode strNode |
|
||||
this.getUrlPatternArg().getALocalSource() = DataFlow::exprNode(strNode) and
|
||||
result = strNode.getExpr().getConstantValue().getString()
|
||||
result = strNode.getExpr().getConstantValue().getStringOrSymbol()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ module HTTP {
|
||||
string getMimetype() {
|
||||
exists(CfgNodes::ExprNodes::StringlikeLiteralCfgNode strNode |
|
||||
this.getMimetypeOrContentTypeArg().getALocalSource() = DataFlow::exprNode(strNode) and
|
||||
result = strNode.getExpr().getConstantValue().getString().splitAt(";", 0)
|
||||
result = strNode.getExpr().getConstantValue().getStringOrSymbol().splitAt(";", 0)
|
||||
)
|
||||
or
|
||||
not exists(this.getMimetypeOrContentTypeArg()) and
|
||||
|
||||
@@ -41,7 +41,7 @@ class Call extends Expr instanceof CallImpl {
|
||||
final Expr getKeywordArgument(string keyword) {
|
||||
exists(Pair p |
|
||||
p = this.getAnArgument() and
|
||||
p.getKey().(SymbolLiteral).getConstantValue().isString(keyword) and
|
||||
p.getKey().getConstantValue().isSymbol(keyword) and
|
||||
result = p.getValue()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ class ConstantValue extends TConstantValue {
|
||||
or
|
||||
result = this.getString()
|
||||
or
|
||||
result = ":" + this.getSymbol()
|
||||
or
|
||||
result = this.getBoolean().toString()
|
||||
or
|
||||
this.isNil() and result = "nil"
|
||||
@@ -54,6 +56,18 @@ class ConstantValue extends TConstantValue {
|
||||
/** Holds if this is the string value `s`. */
|
||||
predicate isString(string s) { s = this.getString() }
|
||||
|
||||
/** Gets the symbol value (exluding the `:` prefix), if this is a symbol. */
|
||||
string getSymbol() { this = TSymbol(result) }
|
||||
|
||||
/** Holds if this is the symbol value `:s`. */
|
||||
predicate isSymbol(string s) { s = this.getSymbol() }
|
||||
|
||||
/** Gets the string or symbol value, if any. */
|
||||
string getStringOrSymbol() { result = [this.getString(), this.getSymbol()] }
|
||||
|
||||
/** Holds if this is the string value `s` or the symbol value `:s`. */
|
||||
predicate isStringOrSymbol(string s) { s = this.getStringOrSymbol() }
|
||||
|
||||
/** Gets the Boolean value, if this is a Boolean. */
|
||||
boolean getBoolean() { this = TBoolean(result) }
|
||||
|
||||
@@ -81,6 +95,9 @@ module ConstantValue {
|
||||
/** A constant string value. */
|
||||
class ConstantStringValue extends ConstantValue, TString { }
|
||||
|
||||
/** A constant symbol value. */
|
||||
class ConstantSymbolValue extends ConstantValue, TSymbol { }
|
||||
|
||||
/** A constant Boolean value. */
|
||||
class ConstantBooleanValue extends ConstantValue, TBoolean { }
|
||||
|
||||
|
||||
@@ -464,10 +464,12 @@ class StringConcatenation extends Expr, TStringConcatenation {
|
||||
* ```
|
||||
*/
|
||||
final string getConcatenatedValueText() {
|
||||
forall(StringLiteral c | c = this.getString(_) | exists(c.getConstantValue().getString())) and
|
||||
forall(StringLiteral c | c = this.getString(_) |
|
||||
exists(c.getConstantValue().getStringOrSymbol())
|
||||
) and
|
||||
result =
|
||||
concat(string valueText, int i |
|
||||
valueText = this.getString(i).getConstantValue().getString()
|
||||
valueText = this.getString(i).getConstantValue().getStringOrSymbol()
|
||||
|
|
||||
valueText order by i
|
||||
)
|
||||
|
||||
@@ -761,8 +761,8 @@ class SymbolLiteral extends StringlikeLiteral, TSymbolLiteral {
|
||||
// Tree-sitter gives us value text including the colon, which we skip.
|
||||
private string getSimpleSymbolValue(Ruby::SimpleSymbol ss) { result = ss.getValue().suffix(1) }
|
||||
|
||||
private class RequiredStringConstantValue7 extends RequiredConstantValue {
|
||||
override predicate requiredString(string s) { s = getSimpleSymbolValue(_) }
|
||||
private class RequiredSymbolConstantValue extends RequiredConstantValue {
|
||||
override predicate requiredSymbol(string s) { s = getSimpleSymbolValue(_) }
|
||||
}
|
||||
|
||||
private class SimpleSymbolLiteral extends SymbolLiteral, TSimpleSymbolLiteral {
|
||||
@@ -770,8 +770,8 @@ private class SimpleSymbolLiteral extends SymbolLiteral, TSimpleSymbolLiteral {
|
||||
|
||||
SimpleSymbolLiteral() { this = TSimpleSymbolLiteral(g) }
|
||||
|
||||
final override ConstantValue::ConstantStringValue getConstantValue() {
|
||||
result.isString(getSimpleSymbolValue(g))
|
||||
final override ConstantValue::ConstantSymbolValue getConstantValue() {
|
||||
result.isSymbol(getSimpleSymbolValue(g))
|
||||
}
|
||||
|
||||
final override string toString() { result = g.getValue() }
|
||||
@@ -795,8 +795,8 @@ private class BareSymbolLiteral extends ComplexSymbolLiteral, TBareSymbolLiteral
|
||||
final override StringComponent getComponent(int i) { toGenerated(result) = g.getChild(i) }
|
||||
}
|
||||
|
||||
private class RequiredStringConstantValue8 extends RequiredConstantValue {
|
||||
override predicate requiredString(string s) { s = any(Ruby::HashKeySymbol h).getValue() }
|
||||
private class RequiredSymbolConstantValue2 extends RequiredConstantValue {
|
||||
override predicate requiredSymbol(string s) { s = any(Ruby::HashKeySymbol h).getValue() }
|
||||
}
|
||||
|
||||
private class HashKeySymbolLiteral extends SymbolLiteral, THashKeySymbolLiteral {
|
||||
@@ -804,8 +804,8 @@ private class HashKeySymbolLiteral extends SymbolLiteral, THashKeySymbolLiteral
|
||||
|
||||
HashKeySymbolLiteral() { this = THashKeySymbolLiteral(g) }
|
||||
|
||||
final override ConstantValue::ConstantStringValue getConstantValue() {
|
||||
result.isString(g.getValue())
|
||||
final override ConstantValue::ConstantSymbolValue getConstantValue() {
|
||||
result.isSymbol(g.getValue())
|
||||
}
|
||||
|
||||
final override string toString() { result = ":" + g.getValue() }
|
||||
@@ -829,7 +829,7 @@ class SubshellLiteral extends StringlikeLiteral, TSubshellLiteral {
|
||||
final override StringComponent getComponent(int i) { toGenerated(result) = g.getChild(i) }
|
||||
}
|
||||
|
||||
private class RequiredStringConstantValue9 extends RequiredConstantValue {
|
||||
private class RequiredStringConstantValue7 extends RequiredConstantValue {
|
||||
override predicate requiredString(string s) { s = any(Ruby::Character c).getValue() }
|
||||
}
|
||||
|
||||
@@ -1131,7 +1131,7 @@ private string getMethodName(MethodName::Token t) {
|
||||
result = t.(Ruby::Setter).getName().getValue() + "="
|
||||
}
|
||||
|
||||
private class RequiredStringConstantValue10 extends RequiredConstantValue {
|
||||
private class RequiredStringConstantValue8 extends RequiredConstantValue {
|
||||
override predicate requiredString(string s) { s = getMethodName(_) }
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ private class MethodModifier extends MethodCall {
|
||||
predicate modifiesMethod(Namespace n, string name) {
|
||||
this = n.getAStmt() and
|
||||
[
|
||||
this.getMethodArgument().(StringlikeLiteral).getConstantValue().getString(),
|
||||
this.getMethodArgument().getConstantValue().getStringOrSymbol(),
|
||||
this.getMethodArgument().(MethodBase).getName()
|
||||
] = name
|
||||
}
|
||||
|
||||
@@ -271,7 +271,9 @@ class HashPattern extends CasePattern, THashPattern {
|
||||
|
||||
/** Gets the value for a given key name. */
|
||||
CasePattern getValueByKey(string key) {
|
||||
exists(int i | this.getKey(i).getConstantValue().isString(key) and result = this.getValue(i))
|
||||
exists(int i |
|
||||
this.getKey(i).getConstantValue().isStringOrSymbol(key) and result = this.getValue(i)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@ newtype TConstantValue =
|
||||
any(RequiredConstantValue x).requiredComplex(real, imaginary)
|
||||
} or
|
||||
TString(string s) { any(RequiredConstantValue x).requiredString(s) } or
|
||||
TSymbol(string s) { any(RequiredConstantValue x).requiredSymbol(s) } or
|
||||
TBoolean(boolean b) { b in [false, true] } or
|
||||
TNil()
|
||||
|
||||
@@ -26,4 +27,6 @@ class RequiredConstantValue extends MkRequiredConstantValue {
|
||||
predicate requiredComplex(float real, float imaginary) { none() }
|
||||
|
||||
predicate requiredString(string s) { none() }
|
||||
|
||||
predicate requiredSymbol(string s) { none() }
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ module ExprNodes {
|
||||
final ExprCfgNode getKeywordArgument(string keyword) {
|
||||
exists(PairCfgNode n |
|
||||
e.hasCfgChild(e.getAnArgument(), this, n) and
|
||||
n.getKey().getExpr().(SymbolLiteral).getConstantValue().isString(keyword) and
|
||||
n.getKey().getExpr().getConstantValue().isSymbol(keyword) and
|
||||
result = n.getValue()
|
||||
)
|
||||
}
|
||||
@@ -643,7 +643,19 @@ module ExprNodes {
|
||||
}
|
||||
|
||||
private class RequiredStringConstantValue extends RequiredConstantValue {
|
||||
override predicate requiredString(string s) { s = getStringlikeLiteralCfgNodeValue(_) }
|
||||
override predicate requiredString(string s) {
|
||||
exists(StringlikeLiteralCfgNode n |
|
||||
s = getStringlikeLiteralCfgNodeValue(n) and
|
||||
not n.getExpr() instanceof SymbolLiteral
|
||||
)
|
||||
}
|
||||
|
||||
override predicate requiredSymbol(string s) {
|
||||
exists(StringlikeLiteralCfgNode n |
|
||||
s = getStringlikeLiteralCfgNodeValue(n) and
|
||||
n.getExpr() instanceof SymbolLiteral
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** A control-flow node that wraps a `StringlikeLiteral` AST expression. */
|
||||
@@ -658,8 +670,10 @@ module ExprNodes {
|
||||
/** Gets a component of this `StringlikeLiteral` */
|
||||
StringComponentCfgNode getAComponent() { result = this.getComponent(_) }
|
||||
|
||||
final override ConstantValue::ConstantStringValue getConstantValue() {
|
||||
result.isString(getStringlikeLiteralCfgNodeValue(this))
|
||||
final override ConstantValue getConstantValue() {
|
||||
if this.getExpr() instanceof SymbolLiteral
|
||||
then result.isSymbol(getStringlikeLiteralCfgNodeValue(this))
|
||||
else result.isString(getStringlikeLiteralCfgNodeValue(this))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -167,14 +167,14 @@ private class Argument extends CfgNodes::ExprCfgNode {
|
||||
exists(int i |
|
||||
this = call.getArgument(i) and
|
||||
not this.getExpr() instanceof BlockArgument and
|
||||
not exists(this.getExpr().(Pair).getKey().getConstantValue().getString()) and
|
||||
not exists(this.getExpr().(Pair).getKey().getConstantValue().getSymbol()) and
|
||||
arg.isPositional(i)
|
||||
)
|
||||
or
|
||||
exists(CfgNodes::ExprNodes::PairCfgNode p |
|
||||
p = call.getArgument(_) and
|
||||
this = p.getValue() and
|
||||
arg.isKeyword(p.getKey().getConstantValue().getString())
|
||||
arg.isKeyword(p.getKey().getConstantValue().getSymbol())
|
||||
)
|
||||
or
|
||||
this = call.getReceiver() and arg.isSelf()
|
||||
|
||||
@@ -176,7 +176,7 @@ class RedirectToCall extends ActionControllerContextCall {
|
||||
/** Gets the `ActionControllerActionMethod` to redirect to, if any */
|
||||
ActionControllerActionMethod getRedirectActionMethod() {
|
||||
exists(string methodName |
|
||||
this.getKeywordArgument("action").getConstantValue().isString(methodName) and
|
||||
this.getKeywordArgument("action").getConstantValue().isStringOrSymbol(methodName) and
|
||||
methodName = result.getName() and
|
||||
result.getEnclosingModule() = this.getControllerClass()
|
||||
)
|
||||
@@ -225,7 +225,7 @@ class ActionControllerHelperMethod extends Method {
|
||||
this.getEnclosingModule() = controllerClass and
|
||||
exists(MethodCall helperMethodMarker |
|
||||
helperMethodMarker.getMethodName() = "helper_method" and
|
||||
helperMethodMarker.getAnArgument().getConstantValue().isString(this.getName()) and
|
||||
helperMethodMarker.getAnArgument().getConstantValue().isStringOrSymbol(this.getName()) and
|
||||
helperMethodMarker.getEnclosingModule() = controllerClass
|
||||
)
|
||||
}
|
||||
@@ -291,7 +291,7 @@ class ActionControllerSkipForgeryProtectionCall extends CSRFProtectionSetting::R
|
||||
call.getMethodName() = "skip_forgery_protection"
|
||||
or
|
||||
call.getMethodName() = "skip_before_action" and
|
||||
call.getAnArgument().getConstantValue().isString("verify_authenticity_token")
|
||||
call.getAnArgument().getConstantValue().isStringOrSymbol("verify_authenticity_token")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ private class ActionControllerProtectFromForgeryCall extends CSRFProtectionSetti
|
||||
}
|
||||
|
||||
private string getWithValueText() {
|
||||
result = callExpr.getKeywordArgument("with").getConstantValue().getString()
|
||||
result = callExpr.getKeywordArgument("with").getConstantValue().getSymbol()
|
||||
}
|
||||
|
||||
// Calls without `with: :exception` can allow for bypassing CSRF protection
|
||||
|
||||
@@ -82,7 +82,7 @@ abstract class RenderCall extends MethodCall {
|
||||
}
|
||||
|
||||
private string getTemplatePathValue() {
|
||||
result = this.getTemplatePathArgument().getConstantValue().getString()
|
||||
result = this.getTemplatePathArgument().getConstantValue().getStringOrSymbol()
|
||||
}
|
||||
|
||||
// everything up to and including the final slash, but ignoring any leading slash
|
||||
|
||||
@@ -28,7 +28,7 @@ private DataFlow::Node ioInstance() {
|
||||
// will execute a shell command and read its output rather than reading from the
|
||||
// filesystem.
|
||||
private predicate pathArgSpawnsSubprocess(Expr arg) {
|
||||
arg.getConstantValue().getString().charAt(0) = "|"
|
||||
arg.getConstantValue().getStringOrSymbol().charAt(0) = "|"
|
||||
}
|
||||
|
||||
private DataFlow::Node fileInstanceInstantiation() {
|
||||
|
||||
@@ -300,7 +300,7 @@ class GraphqlFieldDefinitionMethodCall extends GraphqlSchemaObjectClassMethodCal
|
||||
GraphqlFieldDefinitionMethodCall() { this.getMethodName() = "field" }
|
||||
|
||||
/** Gets the name of this GraphQL field. */
|
||||
string getFieldName() { result = this.getArgument(0).getConstantValue().getString() }
|
||||
string getFieldName() { result = this.getArgument(0).getConstantValue().getStringOrSymbol() }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -336,7 +336,7 @@ private class GraphqlFieldArgumentDefinitionMethodCall extends GraphqlSchemaObje
|
||||
string getFieldName() { result = this.getFieldDefinition().getFieldName() }
|
||||
|
||||
/** Gets the name of the argument (i.e. the first argument to this `argument` method call) */
|
||||
string getArgumentName() { result = this.getArgument(0).getConstantValue().getString() }
|
||||
string getArgumentName() { result = this.getArgument(0).getConstantValue().getStringOrSymbol() }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -385,7 +385,7 @@ class GraphqlFieldResolutionMethod extends Method, HTTP::Server::RequestHandler:
|
||||
exists(GraphqlFieldDefinitionMethodCall defn |
|
||||
// field :foo, resolver_method: :custom_method
|
||||
// def custom_method(...)
|
||||
defn.getKeywordArgument("resolver_method").getConstantValue().isString(this.getName())
|
||||
defn.getKeywordArgument("resolver_method").getConstantValue().isStringOrSymbol(this.getName())
|
||||
or
|
||||
// field :foo
|
||||
// def foo(...)
|
||||
@@ -396,7 +396,7 @@ class GraphqlFieldResolutionMethod extends Method, HTTP::Server::RequestHandler:
|
||||
|
||||
/** Gets the method call which is the definition of the field corresponding to this resolver method. */
|
||||
GraphqlFieldDefinitionMethodCall getDefinition() {
|
||||
result.getKeywordArgument("resolver_method").getConstantValue().isString(this.getName())
|
||||
result.getKeywordArgument("resolver_method").getConstantValue().isStringOrSymbol(this.getName())
|
||||
or
|
||||
not exists(result.getKeywordArgument("resolver_method").(SymbolLiteral)) and
|
||||
result.getFieldName() = this.getName()
|
||||
|
||||
@@ -173,10 +173,11 @@ private module Settings {
|
||||
class NillableStringlikeSetting extends LiteralSetting {
|
||||
NillableStringlikeSetting() {
|
||||
value instanceof ConstantValue::ConstantStringValue or
|
||||
value instanceof ConstantValue::ConstantSymbolValue or
|
||||
value instanceof ConstantValue::ConstantNilValue
|
||||
}
|
||||
|
||||
string getStringValue() { result = value.getString() }
|
||||
string getStringValue() { result = value.getStringOrSymbol() }
|
||||
|
||||
predicate isNilValue() { value.isNil() }
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ private class LibXmlRubyXmlParserCall extends XmlParserCall::Range, DataFlow::Ca
|
||||
override predicate externalEntitiesEnabled() {
|
||||
exists(Pair pair |
|
||||
pair = this.getArgument(1).asExpr().getExpr().(HashLiteral).getAKeyValuePair() and
|
||||
pair.getKey().getConstantValue().isString("options") and
|
||||
pair.getKey().getConstantValue().isStringOrSymbol("options") and
|
||||
pair.getValue() =
|
||||
[
|
||||
trackEnableFeature(TNOENT()), trackEnableFeature(TDTDLOAD()),
|
||||
|
||||
@@ -119,7 +119,7 @@ private predicate setsDefaultVerification(DataFlow::CallNode callNode, boolean v
|
||||
|
||||
private predicate isSslVerifyPeerLiteral(DataFlow::Node node) {
|
||||
exists(DataFlow::LocalSourceNode literal |
|
||||
literal.asExpr().getExpr().getConstantValue().isString("ssl_verify_peer") and
|
||||
literal.asExpr().getExpr().getConstantValue().isStringOrSymbol("ssl_verify_peer") and
|
||||
literal.flowsTo(node)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ private predicate isSslOptionsPairDisablingValidation(Pair p) {
|
||||
/** Holds if `node` represents the symbol literal with the given `valueText`. */
|
||||
private predicate isSymbolLiteral(DataFlow::Node node, string valueText) {
|
||||
exists(DataFlow::LocalSourceNode literal |
|
||||
literal.asExpr().getExpr().getConstantValue().isString(valueText) and
|
||||
literal.asExpr().getExpr().getConstantValue().isStringOrSymbol(valueText) and
|
||||
literal.flowsTo(node)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ class HttpartyRequest extends HTTP::Client::Request::Range {
|
||||
/** Holds if `node` represents the symbol literal `verify` or `verify_peer`. */
|
||||
private predicate isVerifyLiteral(DataFlow::Node node) {
|
||||
exists(DataFlow::LocalSourceNode literal |
|
||||
literal.asExpr().getExpr().getConstantValue().isString(["verify", "verify_peer"]) and
|
||||
literal.asExpr().getExpr().getConstantValue().isStringOrSymbol(["verify", "verify_peer"]) and
|
||||
literal.flowsTo(node)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ private predicate isSslVerifyModeNonePair(Pair p) {
|
||||
/** Holds if `node` can represent the symbol literal `:ssl_verify_mode`. */
|
||||
private predicate isSslVerifyModeLiteral(DataFlow::Node node) {
|
||||
exists(DataFlow::LocalSourceNode literal |
|
||||
literal.asExpr().getExpr().getConstantValue().isString("ssl_verify_mode") and
|
||||
literal.asExpr().getExpr().getConstantValue().isStringOrSymbol("ssl_verify_mode") and
|
||||
literal.flowsTo(node)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ private predicate isVerifySslNonePair(Pair p) {
|
||||
/** Holds if `node` can represent the symbol literal `:verify_ssl`. */
|
||||
private predicate isSslVerifyModeLiteral(DataFlow::Node node) {
|
||||
exists(DataFlow::LocalSourceNode literal |
|
||||
literal.asExpr().getExpr().getConstantValue().isString("verify_ssl") and
|
||||
literal.asExpr().getExpr().getConstantValue().isStringOrSymbol("verify_ssl") and
|
||||
literal.flowsTo(node)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ private predicate isSslVerifyPeerFalsePair(Pair p) {
|
||||
/** Holds if `node` represents the symbol literal `verify` or `verify_peer`. */
|
||||
private predicate isSslVerifyPeerLiteral(DataFlow::Node node) {
|
||||
exists(DataFlow::LocalSourceNode literal |
|
||||
literal.asExpr().getExpr().getConstantValue().isString("ssl_verifypeer") and
|
||||
literal.asExpr().getExpr().getConstantValue().isStringOrSymbol("ssl_verifypeer") and
|
||||
literal.flowsTo(node)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -74,9 +74,9 @@ module UnsafeDeserialization {
|
||||
}
|
||||
|
||||
private predicate isOjModePair(Pair p, string modeValue) {
|
||||
p.getKey().getConstantValue().isString("mode") and
|
||||
p.getKey().getConstantValue().isStringOrSymbol("mode") and
|
||||
exists(DataFlow::LocalSourceNode symbolLiteral, DataFlow::Node value |
|
||||
symbolLiteral.asExpr().getExpr().getConstantValue().isString(modeValue) and
|
||||
symbolLiteral.asExpr().getExpr().getConstantValue().isSymbol(modeValue) and
|
||||
symbolLiteral.flowsTo(value) and
|
||||
value.asExpr().getExpr() = p.getValue()
|
||||
)
|
||||
|
||||
@@ -141,7 +141,7 @@ private module Shared {
|
||||
exists(RenderCall call, Pair kvPair |
|
||||
call.getLocals().getAKeyValuePair() = kvPair and
|
||||
kvPair.getValue() = value and
|
||||
kvPair.getKey().getConstantValue().isString(hashKey) and
|
||||
kvPair.getKey().getConstantValue().isStringOrSymbol(hashKey) and
|
||||
call.getTemplateFile() = erb
|
||||
)
|
||||
}
|
||||
@@ -154,7 +154,7 @@ private module Shared {
|
||||
argNode.asExpr() = refNode.getArgument(0) and
|
||||
refNode.getReceiver().getExpr().(MethodCall).getMethodName() = "local_assigns" and
|
||||
argNode.getALocalSource() = DataFlow::exprNode(strNode) and
|
||||
strNode.getExpr().getConstantValue().isString(hashKey) and
|
||||
strNode.getExpr().getConstantValue().isStringOrSymbol(hashKey) and
|
||||
erb = refNode.getFile()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
| calls/calls.rb:26:7:26:7 | 1 | 1 |
|
||||
| calls/calls.rb:36:9:36:11 | 100 | 100 |
|
||||
| calls/calls.rb:36:14:36:16 | 200 | 200 |
|
||||
| calls/calls.rb:278:5:278:8 | :blah | blah |
|
||||
| calls/calls.rb:279:5:279:8 | :blah | blah |
|
||||
| calls/calls.rb:278:5:278:8 | :blah | :blah |
|
||||
| calls/calls.rb:279:5:279:8 | :blah | :blah |
|
||||
| calls/calls.rb:288:11:288:16 | "blah" | blah |
|
||||
| calls/calls.rb:289:11:289:11 | 1 | 1 |
|
||||
| calls/calls.rb:289:14:289:14 | 2 | 2 |
|
||||
@@ -142,20 +142,20 @@
|
||||
| control/cases.rb:49:12:49:12 | 4 | 4 |
|
||||
| control/cases.rb:50:9:50:9 | 3 | 3 |
|
||||
| control/cases.rb:51:10:51:10 | 3 | 3 |
|
||||
| control/cases.rb:52:6:52:6 | :a | a |
|
||||
| control/cases.rb:53:6:53:6 | :a | a |
|
||||
| control/cases.rb:52:6:52:6 | :a | :a |
|
||||
| control/cases.rb:53:6:53:6 | :a | :a |
|
||||
| control/cases.rb:53:9:53:9 | 5 | 5 |
|
||||
| control/cases.rb:54:6:54:6 | :a | a |
|
||||
| control/cases.rb:54:6:54:6 | :a | :a |
|
||||
| control/cases.rb:54:9:54:9 | 5 | 5 |
|
||||
| control/cases.rb:55:6:55:6 | :a | a |
|
||||
| control/cases.rb:55:6:55:6 | :a | :a |
|
||||
| control/cases.rb:55:9:55:9 | 5 | 5 |
|
||||
| control/cases.rb:55:12:55:12 | :b | b |
|
||||
| control/cases.rb:56:6:56:6 | :a | a |
|
||||
| control/cases.rb:55:12:55:12 | :b | :b |
|
||||
| control/cases.rb:56:6:56:6 | :a | :a |
|
||||
| control/cases.rb:56:9:56:9 | 5 | 5 |
|
||||
| control/cases.rb:56:12:56:12 | :b | b |
|
||||
| control/cases.rb:57:6:57:6 | :a | a |
|
||||
| control/cases.rb:56:12:56:12 | :b | :b |
|
||||
| control/cases.rb:57:6:57:6 | :a | :a |
|
||||
| control/cases.rb:57:9:57:9 | 5 | 5 |
|
||||
| control/cases.rb:57:12:57:12 | :b | b |
|
||||
| control/cases.rb:57:12:57:12 | :b | :b |
|
||||
| control/cases.rb:59:7:59:7 | 5 | 5 |
|
||||
| control/cases.rb:60:7:60:7 | 5 | 5 |
|
||||
| control/cases.rb:61:7:61:7 | 1 | 1 |
|
||||
@@ -177,28 +177,28 @@
|
||||
| control/cases.rb:68:14:68:14 | 4 | 4 |
|
||||
| control/cases.rb:69:10:69:10 | 3 | 3 |
|
||||
| control/cases.rb:70:11:70:11 | 3 | 3 |
|
||||
| control/cases.rb:71:7:71:7 | :a | a |
|
||||
| control/cases.rb:72:7:72:7 | :a | a |
|
||||
| control/cases.rb:71:7:71:7 | :a | :a |
|
||||
| control/cases.rb:72:7:72:7 | :a | :a |
|
||||
| control/cases.rb:72:10:72:10 | 5 | 5 |
|
||||
| control/cases.rb:73:7:73:7 | :a | a |
|
||||
| control/cases.rb:73:7:73:7 | :a | :a |
|
||||
| control/cases.rb:73:10:73:10 | 5 | 5 |
|
||||
| control/cases.rb:74:7:74:7 | :a | a |
|
||||
| control/cases.rb:74:7:74:7 | :a | :a |
|
||||
| control/cases.rb:74:10:74:10 | 5 | 5 |
|
||||
| control/cases.rb:74:13:74:13 | :b | b |
|
||||
| control/cases.rb:75:7:75:7 | :a | a |
|
||||
| control/cases.rb:74:13:74:13 | :b | :b |
|
||||
| control/cases.rb:75:7:75:7 | :a | :a |
|
||||
| control/cases.rb:75:10:75:10 | 5 | 5 |
|
||||
| control/cases.rb:75:13:75:13 | :b | b |
|
||||
| control/cases.rb:76:7:76:7 | :a | a |
|
||||
| control/cases.rb:75:13:75:13 | :b | :b |
|
||||
| control/cases.rb:76:7:76:7 | :a | :a |
|
||||
| control/cases.rb:76:10:76:10 | 5 | 5 |
|
||||
| control/cases.rb:76:13:76:13 | :b | b |
|
||||
| control/cases.rb:76:13:76:13 | :b | :b |
|
||||
| control/cases.rb:84:7:84:8 | 42 | 42 |
|
||||
| control/cases.rb:87:6:87:6 | 5 | 5 |
|
||||
| control/cases.rb:88:7:88:9 | foo | 42 |
|
||||
| control/cases.rb:89:6:89:13 | "string" | string |
|
||||
| control/cases.rb:90:9:90:11 | "foo" | foo |
|
||||
| control/cases.rb:90:13:90:15 | "bar" | bar |
|
||||
| control/cases.rb:91:9:91:11 | :"foo" | foo |
|
||||
| control/cases.rb:91:13:91:15 | :"bar" | bar |
|
||||
| control/cases.rb:91:9:91:11 | :"foo" | :foo |
|
||||
| control/cases.rb:91:13:91:15 | :"bar" | :bar |
|
||||
| control/cases.rb:92:6:92:17 | /.*abc[0-9]/ | .*abc[0-9] |
|
||||
| control/cases.rb:93:6:93:6 | 5 | 5 |
|
||||
| control/cases.rb:93:11:93:12 | 10 | 10 |
|
||||
@@ -212,8 +212,8 @@
|
||||
| control/cases.rb:100:45:100:52 | __FILE__ | control/cases.rb |
|
||||
| control/cases.rb:100:56:100:67 | __ENCODING__ | UTF-8 |
|
||||
| control/cases.rb:101:18:101:19 | 10 | 10 |
|
||||
| control/cases.rb:102:6:102:9 | :foo | foo |
|
||||
| control/cases.rb:103:6:103:15 | :"foo bar" | foo bar |
|
||||
| control/cases.rb:102:6:102:9 | :foo | :foo |
|
||||
| control/cases.rb:103:6:103:15 | :"foo bar" | :foo bar |
|
||||
| control/cases.rb:104:6:104:7 | - ... | -5 |
|
||||
| control/cases.rb:104:7:104:7 | 5 | 5 |
|
||||
| control/cases.rb:104:11:104:13 | + ... | 10 |
|
||||
@@ -227,14 +227,14 @@
|
||||
| control/cases.rb:130:11:130:11 | 1 | 1 |
|
||||
| control/cases.rb:130:14:130:14 | 2 | 2 |
|
||||
| control/cases.rb:131:18:131:18 | 1 | 1 |
|
||||
| control/cases.rb:139:7:139:7 | :x | x |
|
||||
| control/cases.rb:140:16:140:16 | :x | x |
|
||||
| control/cases.rb:139:7:139:7 | :x | :x |
|
||||
| control/cases.rb:140:16:140:16 | :x | :x |
|
||||
| control/cases.rb:140:18:140:18 | 1 | 1 |
|
||||
| control/cases.rb:141:16:141:16 | :x | x |
|
||||
| control/cases.rb:141:16:141:16 | :x | :x |
|
||||
| control/cases.rb:141:18:141:18 | 1 | 1 |
|
||||
| control/cases.rb:141:21:141:21 | :a | a |
|
||||
| control/cases.rb:142:11:142:11 | :y | y |
|
||||
| control/cases.rb:144:11:144:11 | :a | a |
|
||||
| control/cases.rb:141:21:141:21 | :a | :a |
|
||||
| control/cases.rb:142:11:142:11 | :y | :y |
|
||||
| control/cases.rb:144:11:144:11 | :a | :a |
|
||||
| control/cases.rb:144:14:144:14 | 1 | 1 |
|
||||
| control/conditionals.rb:2:5:2:5 | 0 | 0 |
|
||||
| control/conditionals.rb:3:5:3:5 | 0 | 0 |
|
||||
@@ -301,15 +301,15 @@
|
||||
| control/loops.rb:16:13:16:14 | 10 | 10 |
|
||||
| control/loops.rb:22:5:22:7 | 0 | 0 |
|
||||
| control/loops.rb:22:10:22:14 | 1 | 1 |
|
||||
| control/loops.rb:22:20:22:22 | :foo | foo |
|
||||
| control/loops.rb:22:20:22:22 | :foo | :foo |
|
||||
| control/loops.rb:22:25:22:25 | 0 | 0 |
|
||||
| control/loops.rb:22:28:22:30 | :bar | bar |
|
||||
| control/loops.rb:22:28:22:30 | :bar | :bar |
|
||||
| control/loops.rb:22:33:22:33 | 1 | 1 |
|
||||
| control/loops.rb:28:6:28:8 | 0 | 0 |
|
||||
| control/loops.rb:28:11:28:15 | 1 | 1 |
|
||||
| control/loops.rb:28:22:28:24 | :foo | foo |
|
||||
| control/loops.rb:28:22:28:24 | :foo | :foo |
|
||||
| control/loops.rb:28:27:28:27 | 0 | 0 |
|
||||
| control/loops.rb:28:30:28:32 | :bar | bar |
|
||||
| control/loops.rb:28:30:28:32 | :bar | :bar |
|
||||
| control/loops.rb:28:35:28:35 | 1 | 1 |
|
||||
| control/loops.rb:35:11:35:11 | y | 0 |
|
||||
| control/loops.rb:36:8:36:8 | 1 | 1 |
|
||||
@@ -436,22 +436,22 @@
|
||||
| literals/literals.rb:79:1:79:5 | ?\\M-a | ?\\M-a |
|
||||
| literals/literals.rb:80:1:80:8 | ?\\M-\\C-a | ?\\M-\\C-a |
|
||||
| literals/literals.rb:81:1:81:8 | ?\\C-\\M-a | ?\\C-\\M-a |
|
||||
| literals/literals.rb:84:1:84:3 | :"" | |
|
||||
| literals/literals.rb:85:1:85:6 | :hello | hello |
|
||||
| literals/literals.rb:86:1:86:10 | :"foo bar" | foo bar |
|
||||
| literals/literals.rb:87:1:87:10 | :"bar baz" | bar baz |
|
||||
| literals/literals.rb:88:3:88:5 | :foo | foo |
|
||||
| literals/literals.rb:84:1:84:3 | :"" | : |
|
||||
| literals/literals.rb:85:1:85:6 | :hello | :hello |
|
||||
| literals/literals.rb:86:1:86:10 | :"foo bar" | :foo bar |
|
||||
| literals/literals.rb:87:1:87:10 | :"bar baz" | :bar baz |
|
||||
| literals/literals.rb:88:3:88:5 | :foo | :foo |
|
||||
| literals/literals.rb:88:8:88:12 | "bar" | bar |
|
||||
| literals/literals.rb:89:1:89:10 | :"wibble" | wibble |
|
||||
| literals/literals.rb:90:1:90:17 | :"wibble wobble" | wibble wobble |
|
||||
| literals/literals.rb:91:1:91:30 | :"foo_#{...}_#{...}_#{...}" | foo_4_bar_bar |
|
||||
| literals/literals.rb:89:1:89:10 | :"wibble" | :wibble |
|
||||
| literals/literals.rb:90:1:90:17 | :"wibble wobble" | :wibble wobble |
|
||||
| literals/literals.rb:91:1:91:30 | :"foo_#{...}_#{...}_#{...}" | :foo_4_bar_bar |
|
||||
| literals/literals.rb:91:10:91:10 | 2 | 2 |
|
||||
| literals/literals.rb:91:10:91:14 | ... + ... | 4 |
|
||||
| literals/literals.rb:91:14:91:14 | 2 | 2 |
|
||||
| literals/literals.rb:91:19:91:21 | bar | bar |
|
||||
| literals/literals.rb:91:26:91:28 | BAR | bar |
|
||||
| literals/literals.rb:92:1:92:30 | :"foo_#{ 2 + 2}_#{bar}_#{BAR}" | foo_#{ 2 + 2}_#{bar}_#{BAR} |
|
||||
| literals/literals.rb:93:1:93:18 | :"foo_#{ 3 - 2 }" | foo_#{ 3 - 2 } |
|
||||
| literals/literals.rb:92:1:92:30 | :"foo_#{ 2 + 2}_#{bar}_#{BAR}" | :foo_#{ 2 + 2}_#{bar}_#{BAR} |
|
||||
| literals/literals.rb:93:1:93:18 | :"foo_#{ 3 - 2 }" | :foo_#{ 3 - 2 } |
|
||||
| literals/literals.rb:97:2:97:2 | 1 | 1 |
|
||||
| literals/literals.rb:97:5:97:5 | 2 | 2 |
|
||||
| literals/literals.rb:97:8:97:8 | 3 | 3 |
|
||||
@@ -484,38 +484,38 @@
|
||||
| literals/literals.rb:106:18:106:23 | "#{bar}" | #{bar} |
|
||||
| literals/literals.rb:106:25:106:30 | "#{BAR}" | #{BAR} |
|
||||
| literals/literals.rb:106:32:106:34 | "baz" | baz |
|
||||
| literals/literals.rb:110:4:110:6 | :"foo" | foo |
|
||||
| literals/literals.rb:110:8:110:10 | :"bar" | bar |
|
||||
| literals/literals.rb:110:12:110:14 | :"baz" | baz |
|
||||
| literals/literals.rb:111:4:111:6 | :"foo" | foo |
|
||||
| literals/literals.rb:111:8:111:10 | :"bar" | bar |
|
||||
| literals/literals.rb:111:12:111:14 | :"baz" | baz |
|
||||
| literals/literals.rb:112:4:112:6 | :"foo" | foo |
|
||||
| literals/literals.rb:112:8:112:20 | :"bar#{...}" | bar6 |
|
||||
| literals/literals.rb:110:4:110:6 | :"foo" | :foo |
|
||||
| literals/literals.rb:110:8:110:10 | :"bar" | :bar |
|
||||
| literals/literals.rb:110:12:110:14 | :"baz" | :baz |
|
||||
| literals/literals.rb:111:4:111:6 | :"foo" | :foo |
|
||||
| literals/literals.rb:111:8:111:10 | :"bar" | :bar |
|
||||
| literals/literals.rb:111:12:111:14 | :"baz" | :baz |
|
||||
| literals/literals.rb:112:4:112:6 | :"foo" | :foo |
|
||||
| literals/literals.rb:112:8:112:20 | :"bar#{...}" | :bar6 |
|
||||
| literals/literals.rb:112:14:112:14 | 2 | 2 |
|
||||
| literals/literals.rb:112:14:112:18 | ... + ... | 6 |
|
||||
| literals/literals.rb:112:18:112:18 | 4 | 4 |
|
||||
| literals/literals.rb:112:22:112:27 | :"#{...}" | bar |
|
||||
| literals/literals.rb:112:22:112:27 | :"#{...}" | :bar |
|
||||
| literals/literals.rb:112:24:112:26 | bar | bar |
|
||||
| literals/literals.rb:112:29:112:34 | :"#{...}" | bar |
|
||||
| literals/literals.rb:112:29:112:34 | :"#{...}" | :bar |
|
||||
| literals/literals.rb:112:31:112:33 | BAR | bar |
|
||||
| literals/literals.rb:112:36:112:38 | :"baz" | baz |
|
||||
| literals/literals.rb:113:4:113:6 | :"foo" | foo |
|
||||
| literals/literals.rb:113:8:113:12 | :"bar#{" | bar#{ |
|
||||
| literals/literals.rb:113:14:113:14 | :"2" | 2 |
|
||||
| literals/literals.rb:113:16:113:16 | :"+" | + |
|
||||
| literals/literals.rb:113:18:113:18 | :"4" | 4 |
|
||||
| literals/literals.rb:113:20:113:20 | :"}" | } |
|
||||
| literals/literals.rb:113:22:113:27 | :"#{bar}" | #{bar} |
|
||||
| literals/literals.rb:113:29:113:34 | :"#{BAR}" | #{BAR} |
|
||||
| literals/literals.rb:113:36:113:38 | :"baz" | baz |
|
||||
| literals/literals.rb:117:3:117:5 | :foo | foo |
|
||||
| literals/literals.rb:112:36:112:38 | :"baz" | :baz |
|
||||
| literals/literals.rb:113:4:113:6 | :"foo" | :foo |
|
||||
| literals/literals.rb:113:8:113:12 | :"bar#{" | :bar#{ |
|
||||
| literals/literals.rb:113:14:113:14 | :"2" | :2 |
|
||||
| literals/literals.rb:113:16:113:16 | :"+" | :+ |
|
||||
| literals/literals.rb:113:18:113:18 | :"4" | :4 |
|
||||
| literals/literals.rb:113:20:113:20 | :"}" | :} |
|
||||
| literals/literals.rb:113:22:113:27 | :"#{bar}" | :#{bar} |
|
||||
| literals/literals.rb:113:29:113:34 | :"#{BAR}" | :#{BAR} |
|
||||
| literals/literals.rb:113:36:113:38 | :"baz" | :baz |
|
||||
| literals/literals.rb:117:3:117:5 | :foo | :foo |
|
||||
| literals/literals.rb:117:8:117:8 | 1 | 1 |
|
||||
| literals/literals.rb:117:11:117:14 | :bar | bar |
|
||||
| literals/literals.rb:117:11:117:14 | :bar | :bar |
|
||||
| literals/literals.rb:117:19:117:19 | 2 | 2 |
|
||||
| literals/literals.rb:117:22:117:26 | "baz" | baz |
|
||||
| literals/literals.rb:117:31:117:31 | 3 | 3 |
|
||||
| literals/literals.rb:118:3:118:5 | :foo | foo |
|
||||
| literals/literals.rb:118:3:118:5 | :foo | :foo |
|
||||
| literals/literals.rb:118:8:118:8 | 7 | 7 |
|
||||
| literals/literals.rb:121:2:121:2 | 1 | 1 |
|
||||
| literals/literals.rb:121:5:121:6 | 10 | 10 |
|
||||
@@ -572,11 +572,11 @@
|
||||
| misc/misc.erb:2:15:2:37 | "main_include_admin.js" | main_include_admin.js |
|
||||
| misc/misc.rb:1:7:1:11 | "bar" | bar |
|
||||
| misc/misc.rb:3:7:3:9 | foo | foo |
|
||||
| misc/misc.rb:3:12:3:15 | :foo | foo |
|
||||
| misc/misc.rb:3:12:3:15 | :foo | :foo |
|
||||
| misc/misc.rb:3:18:3:21 | foo= | foo= |
|
||||
| misc/misc.rb:3:24:3:25 | [] | [] |
|
||||
| misc/misc.rb:3:28:3:30 | []= | []= |
|
||||
| misc/misc.rb:4:7:4:19 | :"foo_#{...}" | foo_bar |
|
||||
| misc/misc.rb:4:7:4:19 | :"foo_#{...}" | :foo_bar |
|
||||
| misc/misc.rb:4:15:4:17 | bar | bar |
|
||||
| misc/misc.rb:5:7:5:9 | nil | nil |
|
||||
| misc/misc.rb:5:12:5:15 | true | true |
|
||||
@@ -584,15 +584,15 @@
|
||||
| misc/misc.rb:5:25:5:29 | super | super |
|
||||
| misc/misc.rb:5:32:5:35 | self | self |
|
||||
| misc/misc.rb:7:7:7:9 | new | new |
|
||||
| misc/misc.rb:7:11:7:14 | :old | old |
|
||||
| misc/misc.rb:7:11:7:14 | :old | :old |
|
||||
| misc/misc.rb:8:7:8:10 | foo= | foo= |
|
||||
| misc/misc.rb:8:12:8:14 | []= | []= |
|
||||
| misc/misc.rb:9:7:9:11 | super | super |
|
||||
| misc/misc.rb:9:13:9:16 | self | self |
|
||||
| misc/misc.rb:10:7:10:17 | :"\\n#{...}" | \\nbar |
|
||||
| misc/misc.rb:10:7:10:17 | :"\\n#{...}" | :\\nbar |
|
||||
| misc/misc.rb:10:13:10:15 | bar | bar |
|
||||
| misc/misc.rb:10:19:10:24 | :"foo" | foo |
|
||||
| modules/classes.rb:11:28:11:31 | :baz | baz |
|
||||
| misc/misc.rb:10:19:10:24 | :"foo" | :foo |
|
||||
| modules/classes.rb:11:28:11:31 | :baz | :baz |
|
||||
| modules/classes.rb:22:10:22:12 | "a" | a |
|
||||
| modules/classes.rb:26:10:26:12 | "b" | b |
|
||||
| modules/classes.rb:30:17:30:19 | 123 | 123 |
|
||||
@@ -641,11 +641,11 @@
|
||||
| operations/operations.rb:28:10:28:12 | foo | 0 |
|
||||
| operations/operations.rb:29:17:29:17 | 1 | 1 |
|
||||
| operations/operations.rb:29:22:29:22 | 2 | 2 |
|
||||
| operations/operations.rb:29:26:29:26 | :a | a |
|
||||
| operations/operations.rb:29:26:29:26 | :a | :a |
|
||||
| operations/operations.rb:29:28:29:28 | 3 | 3 |
|
||||
| operations/operations.rb:29:34:29:34 | :b | b |
|
||||
| operations/operations.rb:29:34:29:34 | :b | :b |
|
||||
| operations/operations.rb:29:36:29:36 | 4 | 4 |
|
||||
| operations/operations.rb:29:39:29:39 | :c | c |
|
||||
| operations/operations.rb:29:39:29:39 | :c | :c |
|
||||
| operations/operations.rb:29:41:29:41 | 5 | 5 |
|
||||
| operations/operations.rb:32:1:32:1 | w | 0 |
|
||||
| operations/operations.rb:32:1:32:7 | ... + ... | 234 |
|
||||
@@ -736,9 +736,9 @@
|
||||
| operations/operations.rb:95:15:95:15 | 5 | 5 |
|
||||
| operations/operations.rb:96:16:96:16 | 6 | 6 |
|
||||
| params/params.rb:41:46:41:46 | 7 | 7 |
|
||||
| params/params.rb:47:19:47:21 | :bar | bar |
|
||||
| params/params.rb:47:19:47:21 | :bar | :bar |
|
||||
| params/params.rb:47:24:47:24 | 2 | 2 |
|
||||
| params/params.rb:47:27:47:29 | :foo | foo |
|
||||
| params/params.rb:47:27:47:29 | :foo | :foo |
|
||||
| params/params.rb:47:32:47:32 | 3 | 3 |
|
||||
| params/params.rb:49:37:49:39 | 100 | 100 |
|
||||
| params/params.rb:53:44:53:44 | 3 | 3 |
|
||||
|
||||
@@ -74,20 +74,20 @@ allLiterals
|
||||
| literals.rb:79:1:79:5 | ?\\M-a | CharacterLiteral | ?\\M-a |
|
||||
| literals.rb:80:1:80:8 | ?\\M-\\C-a | CharacterLiteral | ?\\M-\\C-a |
|
||||
| literals.rb:81:1:81:8 | ?\\C-\\M-a | CharacterLiteral | ?\\C-\\M-a |
|
||||
| literals.rb:84:1:84:3 | :"" | SymbolLiteral | |
|
||||
| literals.rb:85:1:85:6 | :hello | SymbolLiteral | hello |
|
||||
| literals.rb:86:1:86:10 | :"foo bar" | SymbolLiteral | foo bar |
|
||||
| literals.rb:87:1:87:10 | :"bar baz" | SymbolLiteral | bar baz |
|
||||
| literals.rb:84:1:84:3 | :"" | SymbolLiteral | : |
|
||||
| literals.rb:85:1:85:6 | :hello | SymbolLiteral | :hello |
|
||||
| literals.rb:86:1:86:10 | :"foo bar" | SymbolLiteral | :foo bar |
|
||||
| literals.rb:87:1:87:10 | :"bar baz" | SymbolLiteral | :bar baz |
|
||||
| literals.rb:88:1:88:14 | {...} | HashLiteral | <none> |
|
||||
| literals.rb:88:3:88:5 | :foo | SymbolLiteral | foo |
|
||||
| literals.rb:88:3:88:5 | :foo | SymbolLiteral | :foo |
|
||||
| literals.rb:88:8:88:12 | "bar" | StringLiteral | bar |
|
||||
| literals.rb:89:1:89:10 | :"wibble" | SymbolLiteral | wibble |
|
||||
| literals.rb:90:1:90:17 | :"wibble wobble" | SymbolLiteral | wibble wobble |
|
||||
| literals.rb:91:1:91:30 | :"foo_#{...}_#{...}_#{...}" | SymbolLiteral | foo_4_bar_bar |
|
||||
| literals.rb:89:1:89:10 | :"wibble" | SymbolLiteral | :wibble |
|
||||
| literals.rb:90:1:90:17 | :"wibble wobble" | SymbolLiteral | :wibble wobble |
|
||||
| literals.rb:91:1:91:30 | :"foo_#{...}_#{...}_#{...}" | SymbolLiteral | :foo_4_bar_bar |
|
||||
| literals.rb:91:10:91:10 | 2 | IntegerLiteral | 2 |
|
||||
| literals.rb:91:14:91:14 | 2 | IntegerLiteral | 2 |
|
||||
| literals.rb:92:1:92:30 | :"foo_#{ 2 + 2}_#{bar}_#{BAR}" | SymbolLiteral | foo_#{ 2 + 2}_#{bar}_#{BAR} |
|
||||
| literals.rb:93:1:93:18 | :"foo_#{ 3 - 2 }" | SymbolLiteral | foo_#{ 3 - 2 } |
|
||||
| literals.rb:92:1:92:30 | :"foo_#{ 2 + 2}_#{bar}_#{BAR}" | SymbolLiteral | :foo_#{ 2 + 2}_#{bar}_#{BAR} |
|
||||
| literals.rb:93:1:93:18 | :"foo_#{ 3 - 2 }" | SymbolLiteral | :foo_#{ 3 - 2 } |
|
||||
| literals.rb:96:1:96:2 | [...] | ArrayLiteral | <none> |
|
||||
| literals.rb:97:1:97:9 | [...] | ArrayLiteral | <none> |
|
||||
| literals.rb:97:2:97:2 | 1 | IntegerLiteral | 1 |
|
||||
@@ -128,41 +128,41 @@ allLiterals
|
||||
| literals.rb:106:32:106:34 | "baz" | StringLiteral | baz |
|
||||
| literals.rb:109:1:109:4 | %i(...) | ArrayLiteral | <none> |
|
||||
| literals.rb:110:1:110:15 | %i(...) | ArrayLiteral | <none> |
|
||||
| literals.rb:110:4:110:6 | :"foo" | SymbolLiteral | foo |
|
||||
| literals.rb:110:8:110:10 | :"bar" | SymbolLiteral | bar |
|
||||
| literals.rb:110:12:110:14 | :"baz" | SymbolLiteral | baz |
|
||||
| literals.rb:110:4:110:6 | :"foo" | SymbolLiteral | :foo |
|
||||
| literals.rb:110:8:110:10 | :"bar" | SymbolLiteral | :bar |
|
||||
| literals.rb:110:12:110:14 | :"baz" | SymbolLiteral | :baz |
|
||||
| literals.rb:111:1:111:15 | %i(...) | ArrayLiteral | <none> |
|
||||
| literals.rb:111:4:111:6 | :"foo" | SymbolLiteral | foo |
|
||||
| literals.rb:111:8:111:10 | :"bar" | SymbolLiteral | bar |
|
||||
| literals.rb:111:12:111:14 | :"baz" | SymbolLiteral | baz |
|
||||
| literals.rb:111:4:111:6 | :"foo" | SymbolLiteral | :foo |
|
||||
| literals.rb:111:8:111:10 | :"bar" | SymbolLiteral | :bar |
|
||||
| literals.rb:111:12:111:14 | :"baz" | SymbolLiteral | :baz |
|
||||
| literals.rb:112:1:112:39 | %i(...) | ArrayLiteral | <none> |
|
||||
| literals.rb:112:4:112:6 | :"foo" | SymbolLiteral | foo |
|
||||
| literals.rb:112:8:112:20 | :"bar#{...}" | SymbolLiteral | bar6 |
|
||||
| literals.rb:112:4:112:6 | :"foo" | SymbolLiteral | :foo |
|
||||
| literals.rb:112:8:112:20 | :"bar#{...}" | SymbolLiteral | :bar6 |
|
||||
| literals.rb:112:14:112:14 | 2 | IntegerLiteral | 2 |
|
||||
| literals.rb:112:18:112:18 | 4 | IntegerLiteral | 4 |
|
||||
| literals.rb:112:22:112:27 | :"#{...}" | SymbolLiteral | bar |
|
||||
| literals.rb:112:29:112:34 | :"#{...}" | SymbolLiteral | bar |
|
||||
| literals.rb:112:36:112:38 | :"baz" | SymbolLiteral | baz |
|
||||
| literals.rb:112:22:112:27 | :"#{...}" | SymbolLiteral | :bar |
|
||||
| literals.rb:112:29:112:34 | :"#{...}" | SymbolLiteral | :bar |
|
||||
| literals.rb:112:36:112:38 | :"baz" | SymbolLiteral | :baz |
|
||||
| literals.rb:113:1:113:39 | %i(...) | ArrayLiteral | <none> |
|
||||
| literals.rb:113:4:113:6 | :"foo" | SymbolLiteral | foo |
|
||||
| literals.rb:113:8:113:12 | :"bar#{" | SymbolLiteral | bar#{ |
|
||||
| literals.rb:113:14:113:14 | :"2" | SymbolLiteral | 2 |
|
||||
| literals.rb:113:16:113:16 | :"+" | SymbolLiteral | + |
|
||||
| literals.rb:113:18:113:18 | :"4" | SymbolLiteral | 4 |
|
||||
| literals.rb:113:20:113:20 | :"}" | SymbolLiteral | } |
|
||||
| literals.rb:113:22:113:27 | :"#{bar}" | SymbolLiteral | #{bar} |
|
||||
| literals.rb:113:29:113:34 | :"#{BAR}" | SymbolLiteral | #{BAR} |
|
||||
| literals.rb:113:36:113:38 | :"baz" | SymbolLiteral | baz |
|
||||
| literals.rb:113:4:113:6 | :"foo" | SymbolLiteral | :foo |
|
||||
| literals.rb:113:8:113:12 | :"bar#{" | SymbolLiteral | :bar#{ |
|
||||
| literals.rb:113:14:113:14 | :"2" | SymbolLiteral | :2 |
|
||||
| literals.rb:113:16:113:16 | :"+" | SymbolLiteral | :+ |
|
||||
| literals.rb:113:18:113:18 | :"4" | SymbolLiteral | :4 |
|
||||
| literals.rb:113:20:113:20 | :"}" | SymbolLiteral | :} |
|
||||
| literals.rb:113:22:113:27 | :"#{bar}" | SymbolLiteral | :#{bar} |
|
||||
| literals.rb:113:29:113:34 | :"#{BAR}" | SymbolLiteral | :#{BAR} |
|
||||
| literals.rb:113:36:113:38 | :"baz" | SymbolLiteral | :baz |
|
||||
| literals.rb:116:1:116:2 | {...} | HashLiteral | <none> |
|
||||
| literals.rb:117:1:117:33 | {...} | HashLiteral | <none> |
|
||||
| literals.rb:117:3:117:5 | :foo | SymbolLiteral | foo |
|
||||
| literals.rb:117:3:117:5 | :foo | SymbolLiteral | :foo |
|
||||
| literals.rb:117:8:117:8 | 1 | IntegerLiteral | 1 |
|
||||
| literals.rb:117:11:117:14 | :bar | SymbolLiteral | bar |
|
||||
| literals.rb:117:11:117:14 | :bar | SymbolLiteral | :bar |
|
||||
| literals.rb:117:19:117:19 | 2 | IntegerLiteral | 2 |
|
||||
| literals.rb:117:22:117:26 | "baz" | StringLiteral | baz |
|
||||
| literals.rb:117:31:117:31 | 3 | IntegerLiteral | 3 |
|
||||
| literals.rb:118:1:118:17 | {...} | HashLiteral | <none> |
|
||||
| literals.rb:118:3:118:5 | :foo | SymbolLiteral | foo |
|
||||
| literals.rb:118:3:118:5 | :foo | SymbolLiteral | :foo |
|
||||
| literals.rb:118:8:118:8 | 7 | IntegerLiteral | 7 |
|
||||
| literals.rb:121:2:121:2 | 1 | IntegerLiteral | 1 |
|
||||
| literals.rb:121:2:121:6 | _ .. _ | RangeLiteral | <none> |
|
||||
@@ -250,17 +250,17 @@ stringlikeLiterals
|
||||
| literals.rb:68:7:68:11 | "bar" | bar |
|
||||
| literals.rb:69:1:69:14 | "foo #{...}" | foo bar |
|
||||
| literals.rb:70:1:70:14 | "foo #{...}" | foo bar |
|
||||
| literals.rb:84:1:84:3 | :"" | |
|
||||
| literals.rb:85:1:85:6 | :hello | hello |
|
||||
| literals.rb:86:1:86:10 | :"foo bar" | foo bar |
|
||||
| literals.rb:87:1:87:10 | :"bar baz" | bar baz |
|
||||
| literals.rb:88:3:88:5 | :foo | foo |
|
||||
| literals.rb:84:1:84:3 | :"" | : |
|
||||
| literals.rb:85:1:85:6 | :hello | :hello |
|
||||
| literals.rb:86:1:86:10 | :"foo bar" | :foo bar |
|
||||
| literals.rb:87:1:87:10 | :"bar baz" | :bar baz |
|
||||
| literals.rb:88:3:88:5 | :foo | :foo |
|
||||
| literals.rb:88:8:88:12 | "bar" | bar |
|
||||
| literals.rb:89:1:89:10 | :"wibble" | wibble |
|
||||
| literals.rb:90:1:90:17 | :"wibble wobble" | wibble wobble |
|
||||
| literals.rb:91:1:91:30 | :"foo_#{...}_#{...}_#{...}" | foo_4_bar_bar |
|
||||
| literals.rb:92:1:92:30 | :"foo_#{ 2 + 2}_#{bar}_#{BAR}" | foo_#{ 2 + 2}_#{bar}_#{BAR} |
|
||||
| literals.rb:93:1:93:18 | :"foo_#{ 3 - 2 }" | foo_#{ 3 - 2 } |
|
||||
| literals.rb:89:1:89:10 | :"wibble" | :wibble |
|
||||
| literals.rb:90:1:90:17 | :"wibble wobble" | :wibble wobble |
|
||||
| literals.rb:91:1:91:30 | :"foo_#{...}_#{...}_#{...}" | :foo_4_bar_bar |
|
||||
| literals.rb:92:1:92:30 | :"foo_#{ 2 + 2}_#{bar}_#{BAR}" | :foo_#{ 2 + 2}_#{bar}_#{BAR} |
|
||||
| literals.rb:93:1:93:18 | :"foo_#{ 3 - 2 }" | :foo_#{ 3 - 2 } |
|
||||
| literals.rb:103:4:103:6 | "foo" | foo |
|
||||
| literals.rb:103:8:103:10 | "bar" | bar |
|
||||
| literals.rb:103:12:103:14 | "baz" | baz |
|
||||
@@ -277,30 +277,30 @@ stringlikeLiterals
|
||||
| literals.rb:106:18:106:23 | "#{bar}" | #{bar} |
|
||||
| literals.rb:106:25:106:30 | "#{BAR}" | #{BAR} |
|
||||
| literals.rb:106:32:106:34 | "baz" | baz |
|
||||
| literals.rb:110:4:110:6 | :"foo" | foo |
|
||||
| literals.rb:110:8:110:10 | :"bar" | bar |
|
||||
| literals.rb:110:12:110:14 | :"baz" | baz |
|
||||
| literals.rb:111:4:111:6 | :"foo" | foo |
|
||||
| literals.rb:111:8:111:10 | :"bar" | bar |
|
||||
| literals.rb:111:12:111:14 | :"baz" | baz |
|
||||
| literals.rb:112:4:112:6 | :"foo" | foo |
|
||||
| literals.rb:112:8:112:20 | :"bar#{...}" | bar6 |
|
||||
| literals.rb:112:22:112:27 | :"#{...}" | bar |
|
||||
| literals.rb:112:29:112:34 | :"#{...}" | bar |
|
||||
| literals.rb:112:36:112:38 | :"baz" | baz |
|
||||
| literals.rb:113:4:113:6 | :"foo" | foo |
|
||||
| literals.rb:113:8:113:12 | :"bar#{" | bar#{ |
|
||||
| literals.rb:113:14:113:14 | :"2" | 2 |
|
||||
| literals.rb:113:16:113:16 | :"+" | + |
|
||||
| literals.rb:113:18:113:18 | :"4" | 4 |
|
||||
| literals.rb:113:20:113:20 | :"}" | } |
|
||||
| literals.rb:113:22:113:27 | :"#{bar}" | #{bar} |
|
||||
| literals.rb:113:29:113:34 | :"#{BAR}" | #{BAR} |
|
||||
| literals.rb:113:36:113:38 | :"baz" | baz |
|
||||
| literals.rb:117:3:117:5 | :foo | foo |
|
||||
| literals.rb:117:11:117:14 | :bar | bar |
|
||||
| literals.rb:110:4:110:6 | :"foo" | :foo |
|
||||
| literals.rb:110:8:110:10 | :"bar" | :bar |
|
||||
| literals.rb:110:12:110:14 | :"baz" | :baz |
|
||||
| literals.rb:111:4:111:6 | :"foo" | :foo |
|
||||
| literals.rb:111:8:111:10 | :"bar" | :bar |
|
||||
| literals.rb:111:12:111:14 | :"baz" | :baz |
|
||||
| literals.rb:112:4:112:6 | :"foo" | :foo |
|
||||
| literals.rb:112:8:112:20 | :"bar#{...}" | :bar6 |
|
||||
| literals.rb:112:22:112:27 | :"#{...}" | :bar |
|
||||
| literals.rb:112:29:112:34 | :"#{...}" | :bar |
|
||||
| literals.rb:112:36:112:38 | :"baz" | :baz |
|
||||
| literals.rb:113:4:113:6 | :"foo" | :foo |
|
||||
| literals.rb:113:8:113:12 | :"bar#{" | :bar#{ |
|
||||
| literals.rb:113:14:113:14 | :"2" | :2 |
|
||||
| literals.rb:113:16:113:16 | :"+" | :+ |
|
||||
| literals.rb:113:18:113:18 | :"4" | :4 |
|
||||
| literals.rb:113:20:113:20 | :"}" | :} |
|
||||
| literals.rb:113:22:113:27 | :"#{bar}" | :#{bar} |
|
||||
| literals.rb:113:29:113:34 | :"#{BAR}" | :#{BAR} |
|
||||
| literals.rb:113:36:113:38 | :"baz" | :baz |
|
||||
| literals.rb:117:3:117:5 | :foo | :foo |
|
||||
| literals.rb:117:11:117:14 | :bar | :bar |
|
||||
| literals.rb:117:22:117:26 | "baz" | baz |
|
||||
| literals.rb:118:3:118:5 | :foo | foo |
|
||||
| literals.rb:118:3:118:5 | :foo | :foo |
|
||||
| literals.rb:130:1:130:7 | `ls -l` | ls -l |
|
||||
| literals.rb:131:1:131:9 | `ls -l` | ls -l |
|
||||
| literals.rb:132:1:132:32 | `du -d #{...} #{...} #{...}` | du -d 2 bar bar |
|
||||
@@ -402,39 +402,39 @@ regExpInterpolations
|
||||
| literals.rb:146:20:146:25 | #{...} | 0 | literals.rb:146:22:146:24 | bar | LocalVariableAccess |
|
||||
| literals.rb:146:26:146:31 | #{...} | 0 | literals.rb:146:28:146:30 | BAR | ConstantReadAccess |
|
||||
symbolLiterals
|
||||
| literals.rb:84:1:84:3 | :"" | |
|
||||
| literals.rb:85:1:85:6 | :hello | hello |
|
||||
| literals.rb:86:1:86:10 | :"foo bar" | foo bar |
|
||||
| literals.rb:87:1:87:10 | :"bar baz" | bar baz |
|
||||
| literals.rb:88:3:88:5 | :foo | foo |
|
||||
| literals.rb:89:1:89:10 | :"wibble" | wibble |
|
||||
| literals.rb:90:1:90:17 | :"wibble wobble" | wibble wobble |
|
||||
| literals.rb:91:1:91:30 | :"foo_#{...}_#{...}_#{...}" | foo_4_bar_bar |
|
||||
| literals.rb:92:1:92:30 | :"foo_#{ 2 + 2}_#{bar}_#{BAR}" | foo_#{ 2 + 2}_#{bar}_#{BAR} |
|
||||
| literals.rb:93:1:93:18 | :"foo_#{ 3 - 2 }" | foo_#{ 3 - 2 } |
|
||||
| literals.rb:110:4:110:6 | :"foo" | foo |
|
||||
| literals.rb:110:8:110:10 | :"bar" | bar |
|
||||
| literals.rb:110:12:110:14 | :"baz" | baz |
|
||||
| literals.rb:111:4:111:6 | :"foo" | foo |
|
||||
| literals.rb:111:8:111:10 | :"bar" | bar |
|
||||
| literals.rb:111:12:111:14 | :"baz" | baz |
|
||||
| literals.rb:112:4:112:6 | :"foo" | foo |
|
||||
| literals.rb:112:8:112:20 | :"bar#{...}" | bar6 |
|
||||
| literals.rb:112:22:112:27 | :"#{...}" | bar |
|
||||
| literals.rb:112:29:112:34 | :"#{...}" | bar |
|
||||
| literals.rb:112:36:112:38 | :"baz" | baz |
|
||||
| literals.rb:113:4:113:6 | :"foo" | foo |
|
||||
| literals.rb:113:8:113:12 | :"bar#{" | bar#{ |
|
||||
| literals.rb:113:14:113:14 | :"2" | 2 |
|
||||
| literals.rb:113:16:113:16 | :"+" | + |
|
||||
| literals.rb:113:18:113:18 | :"4" | 4 |
|
||||
| literals.rb:113:20:113:20 | :"}" | } |
|
||||
| literals.rb:113:22:113:27 | :"#{bar}" | #{bar} |
|
||||
| literals.rb:113:29:113:34 | :"#{BAR}" | #{BAR} |
|
||||
| literals.rb:113:36:113:38 | :"baz" | baz |
|
||||
| literals.rb:117:3:117:5 | :foo | foo |
|
||||
| literals.rb:117:11:117:14 | :bar | bar |
|
||||
| literals.rb:118:3:118:5 | :foo | foo |
|
||||
| literals.rb:84:1:84:3 | :"" | : |
|
||||
| literals.rb:85:1:85:6 | :hello | :hello |
|
||||
| literals.rb:86:1:86:10 | :"foo bar" | :foo bar |
|
||||
| literals.rb:87:1:87:10 | :"bar baz" | :bar baz |
|
||||
| literals.rb:88:3:88:5 | :foo | :foo |
|
||||
| literals.rb:89:1:89:10 | :"wibble" | :wibble |
|
||||
| literals.rb:90:1:90:17 | :"wibble wobble" | :wibble wobble |
|
||||
| literals.rb:91:1:91:30 | :"foo_#{...}_#{...}_#{...}" | :foo_4_bar_bar |
|
||||
| literals.rb:92:1:92:30 | :"foo_#{ 2 + 2}_#{bar}_#{BAR}" | :foo_#{ 2 + 2}_#{bar}_#{BAR} |
|
||||
| literals.rb:93:1:93:18 | :"foo_#{ 3 - 2 }" | :foo_#{ 3 - 2 } |
|
||||
| literals.rb:110:4:110:6 | :"foo" | :foo |
|
||||
| literals.rb:110:8:110:10 | :"bar" | :bar |
|
||||
| literals.rb:110:12:110:14 | :"baz" | :baz |
|
||||
| literals.rb:111:4:111:6 | :"foo" | :foo |
|
||||
| literals.rb:111:8:111:10 | :"bar" | :bar |
|
||||
| literals.rb:111:12:111:14 | :"baz" | :baz |
|
||||
| literals.rb:112:4:112:6 | :"foo" | :foo |
|
||||
| literals.rb:112:8:112:20 | :"bar#{...}" | :bar6 |
|
||||
| literals.rb:112:22:112:27 | :"#{...}" | :bar |
|
||||
| literals.rb:112:29:112:34 | :"#{...}" | :bar |
|
||||
| literals.rb:112:36:112:38 | :"baz" | :baz |
|
||||
| literals.rb:113:4:113:6 | :"foo" | :foo |
|
||||
| literals.rb:113:8:113:12 | :"bar#{" | :bar#{ |
|
||||
| literals.rb:113:14:113:14 | :"2" | :2 |
|
||||
| literals.rb:113:16:113:16 | :"+" | :+ |
|
||||
| literals.rb:113:18:113:18 | :"4" | :4 |
|
||||
| literals.rb:113:20:113:20 | :"}" | :} |
|
||||
| literals.rb:113:22:113:27 | :"#{bar}" | :#{bar} |
|
||||
| literals.rb:113:29:113:34 | :"#{BAR}" | :#{BAR} |
|
||||
| literals.rb:113:36:113:38 | :"baz" | :baz |
|
||||
| literals.rb:117:3:117:5 | :foo | :foo |
|
||||
| literals.rb:117:11:117:14 | :bar | :bar |
|
||||
| literals.rb:118:3:118:5 | :foo | :foo |
|
||||
subshellLiterals
|
||||
| literals.rb:130:1:130:7 | `ls -l` | ls -l |
|
||||
| literals.rb:131:1:131:9 | `ls -l` | ls -l |
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ruby
|
||||
|
||||
private string getValueText(MethodName m) {
|
||||
result = m.getConstantValue().getString()
|
||||
result = m.getConstantValue().getStringOrSymbol()
|
||||
or
|
||||
not exists(m.getConstantValue()) and result = "(none)"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user