Commit Graph

368 Commits

Author SHA1 Message Date
Nick Rolfe
9a2523e2f9 Make EndBlockTree extend StmtSequenceTree 2021-05-17 15:24:20 +01:00
Nick Rolfe
6d395230d4 Make BraceBlockTree extend StmtSequenceTree 2021-05-17 14:54:11 +01:00
Nick Rolfe
a46f45440a Create NamespaceTree to reduce duplication 2021-05-13 17:52:20 +01:00
Nick Rolfe
5e6dddad3e Replace count(getReceiver()) with 1 2021-05-13 16:59:05 +01:00
Nick Rolfe
004147984b Simplify CFG classes for StmtSequences 2021-05-11 18:27:11 +01:00
Nick Rolfe
94ceb3f237 Remove unused class 2021-05-07 17:20:51 +01:00
Nick Rolfe
9def7c2dfe Make CFG for TEnsure post-order 2021-05-07 17:15:10 +01:00
Nick Rolfe
7f6805c82f Make CFG for TDo post-order 2021-05-07 17:00:30 +01:00
Nick Rolfe
46c9f858c4 Make CFG for TElse post-order 2021-05-07 16:47:19 +01:00
Nick Rolfe
2569bf257f Make CFG for TThen post-order 2021-05-07 15:40:50 +01:00
Nick Rolfe
4e80b548c1 Make BeginBlock CFG post-order 2021-05-06 16:45:27 +01:00
Nick Rolfe
2c7f1e0c11 Remove unused class 2021-05-06 16:28:36 +01:00
Nick Rolfe
9185a93312 Make SingletonClassDeclarationTree post-order 2021-05-06 16:20:50 +01:00
Nick Rolfe
fd3d50f340 Make ModuleDeclarationTree post-order 2021-05-06 15:54:11 +01:00
Nick Rolfe
d623f47ba0 Make ClassDeclarationTree post-order 2021-05-06 15:36:25 +01:00
Nick Rolfe
a0084b7732 Simplify CFG tree classes for calls 2021-05-05 17:18:44 +01:00
Nick Rolfe
569063ca73 Make YieldCallTree post-order 2021-05-05 17:14:32 +01:00
Nick Rolfe
fdccd5da7e Add AstNode::isSynthesized() 2021-04-30 11:58:54 +01:00
Nick Rolfe
e87bf57bc5 Avoid recursion in IPA construction 2021-04-29 18:04:15 +01:00
Nick Rolfe
bd6fe41388 Merge IPA branches for implicit self 2021-04-29 15:38:58 +01:00
Nick Rolfe
59c83b7b8f Add clarifying comment 2021-04-29 14:00:27 +01:00
Nick Rolfe
9540125771 Remove fromGeneratedInclSynth predicate 2021-04-29 13:58:16 +01:00
Nick Rolfe
f3852f9b56 Create synthetic self nodes for calls without explicit receivers 2021-04-28 16:43:40 +01:00
Arthur Baars
549e5ab9d6 Revert "Rename Method -> MethodDeclaration"
This reverts commit d361ef37af.
2021-04-21 10:50:47 +02:00
Arthur Baars
1245674df8 Add missing @id properties 2021-04-21 10:50:47 +02:00
Arthur Baars
122315db3f Remove 'Method' class 2021-04-20 13:41:11 +02:00
Arthur Baars
bf4f91e038 Address comments 2021-04-16 16:37:42 +02:00
Arthur Baars
bf556a2b53 Implement method lookup 2021-04-15 11:32:43 +02:00
Arthur Baars
5837af0936 Add MethodBase::getMethod 2021-04-15 11:32:43 +02:00
Arthur Baars
d361ef37af Rename Method -> MethodDeclaration 2021-04-15 11:32:43 +02:00
Arthur Baars
24bb11b20a Improve module/class resolution 2021-04-14 17:14:38 +02:00
Arthur Baars
9afda342bc Address comments 2021-04-14 09:57:49 +02:00
Arthur Baars
754bfdd136 Ignore include/prepend statements in blocks
Include and prepend statements are rarely used in block in normal code and when
used in normal code they tend to be in blocks that are passed to methods like
`module_eval` which is a builtin method that evaluates a block in the context
of some other module (typically created with Module.new). We currently don't attempt
to track such "dynamically" constructed modules, and ignoring such modules
 and the `module_eval` calls on them seems fine for now.

Another, much more frequent use of include/prepend statements in blocks is in Rspec.describe and
Rspec.context method calls in tests. Rspec also evaluates those blocks in the context of some
special Rspec class. Precisely tracking such calls during the initial construction of the module/class
hierarchy would be really hard and there would be little benefit because the interesting modules and classes of
an application are not defined in test files.
2021-04-14 09:53:19 +02:00
Arthur Baars
cdfabbc95d Make Cached module private 2021-04-09 16:47:02 +02:00
Arthur Baars
a247544fc5 Add comments 2021-04-09 16:35:23 +02:00
Arthur Baars
7bc5be93ff Module: make main predicates cached 2021-04-09 13:29:27 +02:00
Arthur Baars
2db999d0da Improve module resolution 2021-04-09 09:51:24 +02:00
Arthur Baars
ceb2eb21d8 Address comments 2021-04-08 15:11:57 +02:00
Arthur Baars
84f6e902ea AST: move some scope related methods to AstNode 2021-04-07 17:16:10 +02:00
Arthur Baars
063b085078 Address comments 2021-04-07 15:57:13 +02:00
Arthur Baars
50b8b6b257 Also resolve constants with respect to the ancestors
of the enclosing module.
2021-04-06 15:47:13 +02:00
Arthur Baars
f12e6ea8ea Avoid 'Object::' prefixes 2021-03-30 16:14:21 +02:00
Arthur Baars
201c1e4b81 Basic module resolution 2021-03-30 15:40:03 +02:00
Arthur Baars
ea9afcd4e1 AST: make some classes instance of Scope 2021-03-30 15:40:03 +02:00
Arthur Baars
eebbc7e505 AST: rename Class/Module to ClassDefinition/ModuleDefinition 2021-03-30 15:40:01 +02:00
Tom Hvitved
aad5d133d0 Merge pull request #161 from github/hvitved/cfg-remove-is-hidden
CFG: Remove `isHidden()` predicate
2021-03-25 15:08:17 +01:00
Tom Hvitved
0bb5007103 Reintroduce hidden then/else/do in AST; include all in CFG 2021-03-25 14:22:35 +01:00
Tom Hvitved
58ecd771d3 AST: Exclude empty then/else/do statements 2021-03-25 09:53:55 +01:00
Tom Hvitved
ca7c0584c7 CFG: Remove isHidden() predicate 2021-03-24 17:22:05 +01:00
Tom Hvitved
6c00e66272 Update ql/src/codeql_ruby/dataflow/internal/DataFlowPrivate.qll
Co-authored-by: Nick Rolfe <nickrolfe@github.com>
2021-03-24 15:02:30 +01:00