Commit Graph

52 Commits

Author SHA1 Message Date
Chris Smowton
49c9c36daf Type-variable-in-scope consistency query: account for all enclosing elements that declare type parameters. 2022-05-19 11:55:31 +01:00
Chris Smowton
048a530aac Type parameter scoping check: distinguish type arguments from type parameters
I had forgotten that the Java QL lib regards a ParameterizedType as either an instantiation Generic<String>, or the unbound declaration Generic<T>.
2022-05-19 11:55:31 +01:00
Chris Smowton
d291e0cf10 Fix typeParametersInScope consistency query
The selection of type variables mentioned in a particular class previously didn't work as intended, so the consistency query would always pass.
2022-05-19 11:55:31 +01:00
Ian Lynagh
33e17f1665 Kotlin: Fix some alerts 2022-05-11 17:58:50 +01:00
Ian Lynagh
1151f79eca Kotlin: Apply some review feedback 2022-05-10 19:51:31 +01:00
Tamas Vajk
ad11b3e84a Add consistency query to verify we always have qualifier for calls 2022-05-10 19:51:27 +01:00
Ian Lynagh
77fec17a36 Kotlin: Autoformat QL 2022-05-10 19:51:25 +01:00
Tony Torralba
64531dd717 Fix AST representation of WhenExpr and WhenBranch 2022-05-10 19:51:22 +01:00
Chris Smowton
7fe260c1a2 Convert type-parameter-out-of-scope warning into consistency query
The warning in the extractor is inaccurate due to references to enclosing types' type parameters. A consistency query can check that the type parameter is indeed in scope exploiting broader knowledge of the enclosing types.
2022-05-10 19:51:17 +01:00
Ian Lynagh
03c1845053 Kotlin: Add a TODO comment 2022-05-10 19:51:15 +01:00
Ian Lynagh
76ca0b2776 Kotlin: Pull Kotlin type for localvars out into its own table 2022-05-10 19:51:15 +01:00
Ian Lynagh
7862229807 Kotlin: Pull Kotlin type for params out into its own table 2022-05-10 19:51:15 +01:00
Ian Lynagh
dc26abe341 Kotlin: Pull Kotlin type for methods/constrs out into their own tables 2022-05-10 19:51:15 +01:00
Ian Lynagh
ee008773dc Kotlin: Pull Kotlin type for fields out into its own table 2022-05-10 19:51:15 +01:00
Ian Lynagh
0f7f90dd4e Kotlin: Add a consistency query for Kotlin types 2022-05-10 19:51:15 +01:00
Ian Lynagh
89eae2407b Kotlin: Improve error handling
Each compilation, and each file within a cmopilation, now gets a
"result" indicating whether it had recoverable or non-recoverable
errors.
2022-05-10 19:51:15 +01:00
Chris Smowton
20d56094ee Note that unusedLocation can raise an alert for used but inaccessible locations 2022-05-10 19:51:13 +01:00
Tamas Vajk
44b731c68e Exclude extraction of fake overridden properties 2022-05-10 19:51:13 +01:00
Tamas Vajk
b6e5e1977d Extract more visibility modifiers 2022-05-10 19:51:13 +01:00
Ian Lynagh
2f435a1a95 Kotlin: file_classes consistency check now passes 2022-05-10 19:51:12 +01:00
Ian Lynagh
08bb134022 Java/Kotlin: Tweak consistency queries 2022-05-10 19:51:11 +01:00
Ian Lynagh
7c03ed99dc Java/Kotlin: Add File.is{,Java,Kotlin}SourceFile() 2022-05-10 19:51:10 +01:00
Ian Lynagh
b38f47f9ea Java/Kotlin: Tweak consistency queries 2022-05-10 19:51:10 +01:00
Ian Lynagh
c04912701a Java/Kotlin: Speed up toString.ql
It's less informative now, but manual debugging will likely be needed
to investigate failures.
2022-05-10 19:51:10 +01:00
Ian Lynagh
ab93d166b8 Java/Kotlin: Tweak consistency queries 2022-05-10 19:51:10 +01:00
Ian Lynagh
509860b7cf Kotlin: Add a file_classes consistency query 2022-05-10 19:51:09 +01:00
Tamás Vajk
04daa7f28f Revert "Kotlin: Fix extraction of dispatch and extension receivers" 2022-05-10 19:51:08 +01:00
Ian Lynagh
7ca6da1d13 Kotlin/Java: children consistency query: extension receiver is now a gap 2022-05-10 19:51:07 +01:00
Ian Lynagh
25ccf0569e Kotlin: ReturnStmt CFG isn't handled properly yet 2022-05-10 19:51:07 +01:00
Ian Lynagh
db7f5a04be Kotlin: BreakStmt CFG isn't handled properly yet 2022-05-10 19:51:07 +01:00
Ian Lynagh
fcbe4331b4 Kotlin/Java: Add a (currently rather lax) cfgDeadEnds consistency query 2022-05-10 19:51:06 +01:00
Ian Lynagh
90d7c2b3ce Java/Kotlin: Add a statementEnclosingExpr consistency test 2022-05-10 19:51:06 +01:00
Tamas Vajk
afabe652c1 Add anonymous class declaration stmt 2022-05-10 19:51:05 +01:00
Ian Lynagh
f447d40740 Kotlin: Temporary consistency query tweak to get the tests passing 2022-05-10 19:51:05 +01:00
Ian Lynagh
22c87b20cc Kotlin: Add an exception for a consistency check 2022-05-10 19:51:04 +01:00
Ian Lynagh
d63ef23bda Kotlin: Remove an out-of-date consistency exception 2022-05-10 19:51:04 +01:00
Ian Lynagh
755bf4d8b3 Java/Kotlin: Add 'children' consistency query 2022-05-10 19:51:04 +01:00
Ian Lynagh
8f1f137fa1 Java/Kotlin: Add UnaryExpr consistency query 2022-05-10 19:51:04 +01:00
Ian Lynagh
90365c9c58 Java/Kotlin: Add a consistency query for BinaryExpr 2022-05-10 19:51:04 +01:00
Ian Lynagh
9e2a3a9da8 Java/Kotlin: Add a consistency query for blocks 2022-05-10 19:51:04 +01:00
Ian Lynagh
8853489f04 Kotlin: Add a "generted by" field to the diagnostics table 2022-05-10 19:51:01 +01:00
Ian Lynagh
2d43e7b2d1 Kotlin: Speed up getAPrimaryQlClass
It now gives less useful info, but can be manually investigated if it
fails.
2022-05-10 19:51:00 +01:00
Ian Lynagh
59307285e8 Kotlin: Speed up the toString consistency query
Using Top.getAQlClass() means we have to evaluate
SummarizedCallableExternal's charpred, and hence summaryElement,
which is slow.
2022-05-10 19:51:00 +01:00
Ian Lynagh
396b5882ef Kotlin: Add a compilations consistency query 2022-05-10 18:45:56 +01:00
Ian Lynagh
dbc3f29426 Kotlin: Put diagnostics in a TRAP file
Currently we just put everything in as severe with no location.
2022-05-10 18:45:55 +01:00
Ian Lynagh
f29a45ea98 Kotlin: Add getAPrimaryQlClass.ql consistenty check 2022-05-10 18:45:54 +01:00
Ian Lynagh
4c8ff16552 Kotlin: Fixes 2022-05-10 18:45:53 +01:00
Ian Lynagh
afea1871a7 Java: Add a variables consistency query 2022-05-10 18:45:52 +01:00
Ian Lynagh
15be80631f Java: Add a consistency test for expressions
They should have exactly 1 Type.
2022-05-10 18:45:52 +01:00
Ian Lynagh
bbbd5d78a7 Java: Add toString consistency query 2022-05-10 18:45:51 +01:00