Commit Graph

705 Commits

Author SHA1 Message Date
Alex Ford
48add9ffbc remove internal import in rb/overly-permissive-file 2021-05-10 11:00:59 +01:00
Alex Ford
2c8a4f833f make rb/overly-permissive-file a proper path-problem 2021-04-29 19:11:39 +01:00
Alex Ford
4375452866 more IntegerLiteral.getValue improvements 2021-04-29 17:08:33 +01:00
Alex Ford
05adfec03d account for more patterns in IntegerLiteral.getValue 2021-04-29 17:02:54 +01:00
Alex Ford
35d5bae10e run formatter 2021-04-29 16:16:09 +01:00
Alex Ford
efa323c304 rb/overly-permissive-file use QL bitwise operators 2021-04-29 16:08:42 +01:00
Alex Ford
46a14b2826 move parseInt logic into getValue method predicate on IntegerLiteral 2021-04-29 15:54:22 +01:00
Alex Ford
1c89bbe188 fix select format of rb/overly-permissive-file 2021-04-29 15:44:54 +01:00
Alex Ford
2c0fc7d193 parse integer permission args as ints instead of using regex matches 2021-04-29 15:34:10 +01:00
Alex Ford
0a6dc6f150 update WeakFilePermissions.expected 2021-04-28 16:31:07 +01:00
Alex Ford
7a72d8ec2f add qhelp for rb/overly-permissive-file 2021-04-28 15:51:08 +01:00
Alex Ford
e3d393b7c1 use full dataflow for permission args in rb/overly-permissive-file 2021-04-28 15:40:58 +01:00
Alex Ford
e5862a942f WIP rb/overly-permissive-file query 2021-04-27 21:22:17 +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
240f0abf27 drop @tags from metrics queries 2021-04-21 13:00:48 +01:00
Alex Ford
15289dba34 simplify File.getNumberOfLines 2021-04-21 12:59:25 +01:00
Alex Ford
cc5bbfce0b Get -> Gets 2021-04-21 12:57:55 +01:00
Alex Ford
5a191692df Update ql/src/queries/metrics/FLinesOfComments.ql
Co-authored-by: Arthur Baars <aibaars@github.com>
2021-04-21 12:57:12 +01:00
Alex Ford
4e119cc085 consider empty files (no ruby tokens) to have 0 lines 2021-04-21 11:29:55 +01:00
Alex Ford
a8597025aa fixed logic for line counting 2021-04-21 11:29:09 +01:00
Alex Ford
bcc1be05de use explicit this prefixes in FileSystem.qll 2021-04-21 10:51:28 +01:00
Alex Ford
85ecacd858 make helper predicates private 2021-04-21 10:50:00 +01:00
Alex Ford
9d117d10b8 drop MetricFile class 2021-04-21 10:45:42 +01: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
Alex Ford
fcd46025fe update metadata for FLines* queries 2021-04-21 10:28:20 +01:00
Arthur Baars
abb37e212a Merge pull request #165 from github/aibaars/methods
Implement method lookup
2021-04-21 11:24:20 +02: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
Alex Ford
f0d1498c8c Revert "WIP: populate numlines table"
This reverts commit 62bf58b289.
2021-04-20 17:36:16 +01:00
Alex Ford
37cce23c26 add FLines.ql, FLinesOfComments.ql 2021-04-20 17:36:16 +01:00
Alex Ford
d6c7846089 put logic for determining line counts into MetricFile 2021-04-20 17:36:16 +01:00
Arthur Baars
122315db3f Remove 'Method' class 2021-04-20 13:41:11 +02:00
Alex Ford
28e46c8915 add FLinesOfCode.ql metric query 2021-04-20 10:12:52 +01:00
Alex Ford
7bfc61789d line count MetricFile predicates 2021-04-19 18:08:01 +01:00
Alex Ford
62bf58b289 WIP: populate numlines table 2021-04-19 18:06:35 +01:00
Arthur Baars
bf4f91e038 Address comments 2021-04-16 16:37:42 +02:00
Arthur Baars
07726fd979 Add some module and method tests 2021-04-16 11:07:57 +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
3590a2c2ac Merge pull request #164 from github/aibaars/fix-modules
Improve module/class resolution
2021-04-15 11:32:28 +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
3b73d41cc4 Merge pull request #163 from github/aibaars/modules-2
Ignore include/prepend statements in blocks
2021-04-14 17:09:34 +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
280fe73063 Add test case with 'module_eval' call with block containing 'prepend' statement 2021-04-14 09:53:19 +02:00
Arthur Baars
caef2c36c7 Merge pull request #162 from github/aibaars/modules
Basic implementation of module resolution
2021-04-09 20:50:54 +02:00