Commit Graph

36554 Commits

Author SHA1 Message Date
Alex Ford
20b851a6e0 improve ErbExecutionDirective definition 2021-08-31 17:49:15 +01:00
Alex Ford
df9e0dfcb2 make strictlyBefore a member predicate on Location 2021-08-31 16:24:38 +01:00
Alex Ford
d84731bcc7 Add a library for working with the ERB AST 2021-08-31 16:24:38 +01:00
Harry Maclean
502ad3f9bd Merge pull request #247 from github/hmac-jump-to-def
Jump-to-definition
2021-08-31 16:00:43 +01:00
Harry Maclean
3490e328e1 codeql_ruby -> codeql.ruby 2021-08-31 15:43:02 +01:00
Harry Maclean
d3f683e573 Minor refactor of constantQualifiedName 2021-08-31 15:42:06 +01:00
Harry Maclean
34f02ee622 Fix constantQualifiedName
Exclude partial results

Co-authored-by: Alex Ford <alexrford@users.noreply.github.com>
2021-08-31 15:42:06 +01:00
Harry Maclean
91d56cd802 Use dataflow to find method call targets
This includes both local and non-local methods, and is also simpler than
the previous definition.
2021-08-31 15:42:06 +01:00
Harry Maclean
cd3192e8f1 Fix ordering for definitionOf
Actually select the lexicographically least location, not the greatest.
2021-08-31 15:42:06 +01:00
Harry Maclean
8901eba978 Include constants in jump-to-def query
The previous version of this query inadvertently excluded constants
which weren't classes or modules. This version includes them, by
introducing a laxer version of `resolveScopeExpr` that doesn't require
the result to be a `TResolved`.
2021-08-31 15:42:06 +01:00
Harry Maclean
155b385981 Simplify LocalVariable constraint in jump-to-def 2021-08-31 15:42:06 +01:00
Harry Maclean
e72f1399cb Include class variables in jump-to-def query 2021-08-31 15:42:06 +01:00
Harry Maclean
e84ebe2b94 Include instance variables in jump-to-def query
By convention, instance variables are considered to be "defined" in the
`#initialize` method of their containing class. If an instance variable
is written to in `#initialize` and then read elsewhere in the program,
we will point from the read to the write. If it is not written to in
`#initialize` then we won't provide any jump-to-definition information
for it.
2021-08-31 15:42:06 +01:00
Harry Maclean
a16cd8967b Ignore synthesised reads for jump-to-definition
We synthesise variables for things like tuple patterns. For example,
this Ruby code:

    a, b = ...

becomes:

    __synth__0 = ...
    a = __synth__0[0]
    b = __synth__0[1]

The `__synth__` variables should be ignored when calculating
jump-to-definition information, since they don't appear in the original
source code.
2021-08-31 15:42:05 +01:00
Harry Maclean
a814010665 Small refactor to constantQualifiedName 2021-08-31 15:42:05 +01:00
Harry Maclean
95e2b8a4a4 Simplify jump-to-def query
The expected output format is a tuple (a, b, k) where `a` and `b` are any
`AstNode` subclass and `k` is a string indicating the kind of
definition (e.g. variable, method, ...).

By ensuring that every value in `DefLoc` is a subclass of `Expr` (itself
a subclass of `AstNode`) we can simplify the query by removing all the
use of `getLocation()`.
2021-08-31 15:42:05 +01:00
Harry Maclean
19e135fb6f Remove redundant imports 2021-08-31 15:42:05 +01:00
Harry Maclean
2fbbabda2d First draft of a jump-to-definition query
TODO: flesh out this message
2021-08-31 15:42:05 +01:00
Nick Rolfe
d1171e08b1 Merge pull request #272 from github/fix_upgrade
Fix typo in db upgrade script
2021-08-31 15:34:55 +01:00
Chris Smowton
7977d9c253 Fix minor mistakes in old Guava models
Also add tests for the affected functions
2021-08-31 15:26:09 +01:00
Nick Rolfe
ad66f03f90 Fix typo in db upgrade script 2021-08-31 15:23:16 +01:00
Chris Smowton
b38a23daee Fix test cases featuring primitive arrays
Previously we couldn't print the name of types like `byte[]` for example.
2021-08-31 15:12:47 +01:00
Tamas Vajk
b267d26ff8 C#: Fix completely broken type argument extraction in NoMetadataHandleType 2021-08-31 14:34:27 +02:00
Tamas Vajk
d6ae19c87d C#: Handle non-critical exception in CIL local variable extraction 2021-08-31 14:29:53 +02:00
Tamas Vajk
0ba334bb22 C#: Temporarily extract modified pointers as unmodified during CIL extraction 2021-08-31 14:26:36 +02:00
Erik Krogh Kristensen
28dce6e95a fix non-monotonic recursion in js/missing-rate-limiting 2021-08-31 14:23:23 +02:00
Erik Krogh Kristensen
83252e5ba2 change note 2021-08-31 14:23:23 +02:00
Erik Krogh Kristensen
cecb6c7bdd add model for live-server 2021-08-31 14:23:23 +02:00
Erik Krogh Kristensen
b509627113 add tests for connect 2021-08-31 14:23:23 +02:00
Erik Krogh Kristensen
3d6ab81ab8 refactor the tests for connect 2021-08-31 14:23:23 +02:00
Erik Krogh Kristensen
c6399dbdf4 simplify the connect model by reusing NodeJSLib::RouteHandler 2021-08-31 14:23:23 +02:00
Tom Hvitved
eeb68a88b6 Add make target to run tests locally 2021-08-31 14:22:26 +02:00
Tom Hvitved
4677a0832f Adopt shared CFG library 2021-08-31 13:42:41 +02:00
Tom Hvitved
50158b82c8 Sync shared files 2021-08-31 13:42:25 +02:00
Tom Hvitved
b9745c8e27 Bump codeql submodule 2021-08-31 13:38:52 +02:00
Chris Smowton
f94d8c341d Abbreviate multi-column min 2021-08-31 11:57:49 +01:00
Chris Smowton
510f5abb9a Add missing qldoc 2021-08-31 11:56:03 +01:00
Chris Smowton
5dddc48e60 autoformat 2021-08-31 11:53:13 +01:00
Arthur Baars
60aca018a8 Merge pull request #254 from github/hvitved/drop-files-folders-columns
Drop redundant columns from `files` and `folders` relations
2021-08-31 12:30:05 +02:00
Tom Hvitved
c70407ae8c Update DB stats 2021-08-31 12:19:35 +02:00
Tom Hvitved
652d2a7a72 DB upgrade script 2021-08-31 12:19:35 +02:00
Tom Hvitved
7f03b87142 Drop redundant columns from files and folders relations 2021-08-31 12:16:26 +02:00
Arthur Baars
32253aa868 Merge pull request #266 from github/dbartol/refactor-packs
Refactor Ruby into library and query packs
2021-08-31 12:14:00 +02:00
Tom Hvitved
c8a5397085 Merge pull request #6513 from hvitved/csharp/cfg/shared
C#: Make CFG library shared
esbena/dca-test-build/run/R-1186042660
2021-08-31 11:55:43 +02:00
Asger Feldthaus
27f10123c7 JS: Autoformat 2021-08-31 11:19:11 +02:00
Asger Feldthaus
8833ff7854 JS: Use Vue model in Vuex model 2021-08-31 11:19:10 +02:00
Asger Feldthaus
ebf17e10d6 JS: Fixup in getComponentRef() 2021-08-31 11:19:09 +02:00
Asger Feldthaus
607f2d66b8 JS: Rename getASelfRef to getAnInstanceRef 2021-08-31 11:19:08 +02:00
Asger Feldthaus
999f22f548 JS: Fix getOwnOptionsObject 2021-08-31 11:19:08 +02:00
Asger Feldthaus
9f02ae29ec JS: Autoformat 2021-08-31 11:19:07 +02:00