Owen Mansel-Chan
97bbdca8a3
Extend negativeLengthCheck query to unsigned integers
...
Like return values from len and cap, unsigned integers are never negative
2020-08-11 10:48:03 +01:00
Chris Smowton
5b34c05916
UnreachableStatement: tolerate more harmless unreachable return statements
...
The Golang compiler isn't particularly good at spotting paths that don't need a return statement due to a dominating noreturn statement (e.g. os.Exit(1)), so dead return statements are common. We already tried to tolerate some instances of this pattern; this additionally allows 'true' and 'false' literals, and anything of type 'error'.
The carte-blanche for error values aims to accommodate the pattern "abort(); return whateverErrorWouldOtherwiseBeAppropriate();", which is probably preferable to "return nil", a misleading no-error indication.
2020-07-06 17:02:26 +01:00
Sauyon Lee
66f733d798
Use allow or allowlist instead of whitelist
2020-06-12 09:16:41 -07:00
Owen Mansel-Chan
23a7db5d4d
Minor textual corrections
2020-05-18 17:05:49 +01:00
Owen Mansel-Chan
fbee7fe983
Add new query for redundant calls to recover
2020-05-18 16:13:46 +01:00
Max Schaefer
ddf2bdb44b
Autoformat all QL.
2020-04-08 07:32:43 +01:00
Max Schaefer
60fe6f4390
Add missing Qldoc for modules.
2020-03-20 17:36:08 +00:00
Max Schaefer
dc6a8917a4
Add missing QLDoc for public elements.
2020-02-20 13:59:12 +00:00
Sauyon Lee
1b7186347d
Merge pull request #25 from max-schaefer/library-overview
...
Add library overview
2020-02-19 01:39:14 -08:00
Max Schaefer
5571f1eac7
Rename Comparison to ComparisonExpr.
2020-02-07 16:24:42 +00:00
Max Schaefer
46a8f8c8ed
Remove Function.getACallExpr.
2020-02-07 11:05:44 +00:00
Max Schaefer
3c1a68ee8f
Fix hash-consing of literals.
...
We shouldn't rely on the literal value given in the `literals` table, but use the exact value (where available) instead.
2020-01-27 12:05:48 +00:00
Max Schaefer
fe56c207a3
Make ImpossibleInterfaceNilCheck more robust.
...
It no longer flags alerts that may be simply caused by missing type information.
2020-01-21 10:04:57 +00:00
Sauyon Lee
aa9489ea28
Merge pull request #218 from max/field-refs
...
Fix handling of references to fields and methods
2020-01-16 14:26:55 -08:00
Max Schaefer
efc72fa01a
Remove Entity.getAUse() and replace uses with getAReference().
...
The former had result type `Ident`, so it wouldn't pick up references to methods and fields. Apart from that, it is subsumed by the latter anyway.
2020-01-14 07:15:43 +00:00
Max Schaefer
384d21b0e9
Switch RedundantExpr query back to using AST instead of global value numbers.
...
Most current alerts (https://lgtm.com/rules/1510380685982/alerts/ ), while technically correct, are likely intentional and harmless. This change keeps only the interesting ones: https://lgtm.com/query/2999122885894714237
2020-01-10 14:46:54 +00:00
Shati Patel
e4346a17de
Merge pull request #195 from max/impossible-interface-nil-check
...
Add new query ImpossibleInterfaceNilCheck
2019-11-27 11:15:05 +00:00
Max Schaefer
ba54cde86e
Add two references.
2019-11-27 10:47:42 +00:00
Max Schaefer
e5a12e9738
Add new query ImpossibleInterfaceNilCheck.
2019-11-26 20:28:53 +00:00
Max Schaefer
ee723d8a4f
Fix DeadStoreOfField false positive.
...
We should look into properly desugaring embedded types in the IR, but for now this workaround should suffice.
2019-11-25 20:21:16 +00:00
Max Schaefer
d14eb855fc
Go analysis support for CodeQL.
2019-11-08 12:16:26 +00:00