Alex Ford
49d9bb798c
revamp the diagnostics tests
2021-05-11 19:53:00 +01:00
Alex Ford
d1d8cff915
tests for some more diagnostics queries
2021-05-11 19:14:22 +01:00
Alex Ford
de497dd1ba
tests for NumberOfFiles* summary queries
2021-05-11 19:14:22 +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
f3852f9b56
Create synthetic self nodes for calls without explicit receivers
2021-04-28 16:43:40 +01:00
Arthur Baars
bc6aec7a99
Merge pull request #167 from github/alexrford/numlines
...
Implement FLines metrics queries
2021-04-21 14:42:18 +02:00
Alex Ford
c6b6a83501
extend FLines* tests
2021-04-21 10:42:53 +01:00
Alex Ford
a1c91e28da
move FLines* tests to a common directory
2021-04-21 10:34:58 +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
Alex Ford
50a0f282bf
add basic tests for FLines queries
2021-04-20 17:36:16 +01:00
Arthur Baars
122315db3f
Remove 'Method' class
2021-04-20 13:41:11 +02:00
Arthur Baars
07726fd979
Add some module and method tests
2021-04-16 11:07:57 +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
12ee957331
Add test cases
2021-04-14 17:12:39 +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
280fe73063
Add test case with 'module_eval' call with block containing 'prepend' statement
2021-04-14 09:53:19 +02:00
Arthur Baars
2db999d0da
Improve module resolution
2021-04-09 09:51:24 +02:00
Arthur Baars
039e8b36a5
Add some include/prepend tests
2021-04-07 17:27:33 +02:00
Arthur Baars
063b085078
Address comments
2021-04-07 15:57:13 +02:00
Arthur Baars
f12e6ea8ea
Avoid 'Object::' prefixes
2021-03-30 16:14:21 +02:00
Arthur Baars
b2c7185664
Add tests
2021-03-30 15:49:41 +02:00
Arthur Baars
eebbc7e505
AST: rename Class/Module to ClassDefinition/ModuleDefinition
2021-03-30 15:40:01 +02: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
Nick Rolfe
c6958f64e4
Make CFG for AssignExpr visit left operand before right
2021-03-19 14:25:38 +00:00
Tom Hvitved
e175513293
Remove duplicate tuple patterns
2021-03-19 10:52:29 +01:00
Nick Rolfe
6bcc433af3
Uncomment empty class and module in CFG test
2021-03-18 19:02:32 +00:00
Nick Rolfe
9493997e9d
Make space in CFG test for two new lines in the middle
...
Commented out to make it easier to ignore the noise from line number
changes.
2021-03-18 19:01:11 +00:00
Nick Rolfe
4ce7faf868
Fix erroneous flow from 'raise' call to StmtSequence
2021-03-18 13:01:27 +00:00
Tom Hvitved
3bb2c529a5
CFG: Revert change to mandatory parameters
2021-03-18 10:43:10 +01:00
Nick Rolfe
32e2b257bf
Port CFG implementation to public AST interface
2021-03-17 20:28:47 +00:00
Nick Rolfe
26c251f080
Order CFG nodes by column as well
2021-03-17 19:07:52 +00:00
Tom Hvitved
7eaf02a0bf
Make external AstNode an IPA type
2021-03-16 12:50:20 +01:00
Arthur Baars
c672169621
Merge pull request #155 from github/aibaars/order-ast-test
...
AST: order edges by target node
2021-03-15 10:43:34 +01:00
Arthur Baars
d54db292f7
Move semmle.order property to printAst.qll
2021-03-15 10:33:10 +01:00
Arthur Baars
3e5ff1d042
AST: order edges by target node
...
When printing a tree CodeQL iterates over the nodes and
for each node prints the successor edges as children. If the
the successor edges are ordered by target node then the children
printe in the right order in the expected output.
2021-03-12 16:52:34 +01:00
Arthur Baars
cde496cc4c
Merge pull request #152 from github/aibaars/fix-vars
...
Fix VariableRead/WriteAcess for instance and class variables
2021-03-11 17:05:56 +01:00
Calum Grant
bf873c8ad1
Merge pull request #147 from github/calumgrant/use-detect
...
Ruby: New query UseDetect
2021-03-10 14:39:37 +00:00
Arthur Baars
f28071ceb6
Fix VariableRead/WriteAcess for instance and class variables
2021-03-09 13:55:55 +01:00
Arthur Baars
600d9c66ae
Remove VariableScope
2021-03-09 11:56:17 +01:00
Arthur Baars
86a89ab1fe
Remove VariableScope IPA type
2021-03-09 11:48:18 +01:00
Calum Grant
855d190800
Ruby: Test local data flow
2021-03-09 10:25:24 +00:00
Calum Grant
5b4bf584a1
Ruby: Update qltest output for new select format
2021-03-09 10:20:23 +00:00
Calum Grant
ca497479c2
Ruby: Finish the test for UseDetect
2021-03-04 15:44:05 +00:00
Calum Grant
522bcff79d
Ruby: Initial test case
2021-03-04 15:38:09 +00:00
Arthur Baars
39181ec871
AST: printAST: show all primary classes and method names
2021-02-25 15:25:49 +01:00
Arthur Baars
e2b2a450ac
AST: add printAST test case
2021-02-25 15:25:49 +01:00