Commit Graph

5711 Commits

Author SHA1 Message Date
Chris Smowton
1a656af96a Make truncation consistent 2022-05-10 19:51:23 +01:00
Chris Smowton
1b91a35df0 Truncate (but keep unique-ish) the names of very long file declarations 2022-05-10 19:51:23 +01:00
Tamas Vajk
b26044b327 Change extension receiver this access to be a parameter access 2022-05-10 19:51:23 +01:00
Tamas Vajk
21f6867cd4 Add test cases for delegating properties to other properties 2022-05-10 19:51:23 +01:00
Tamas Vajk
2f0ad50c08 Adjust trap file names of external file class declarations 2022-05-10 19:51:23 +01:00
Tamas Vajk
f5383bbc17 Add extension receiver type to function signature in trap file names 2022-05-10 19:51:23 +01:00
Ian Lynagh
61728e6a69 Kotlin: Tweak kotlin_plugin_versions.py 2022-05-10 19:51:23 +01:00
Ian Lynagh
0610917435 Kotlin: Workaround for CI on Windows 2022-05-10 19:51:23 +01:00
Ian Lynagh
ef5950197d Kotlin: Broaden isFake 2022-05-10 19:51:23 +01:00
Ian Lynagh
aee74dd570 Kotlin: Be more consistent in how we deal with "fake" elements 2022-05-10 19:51:23 +01:00
Ian Lynagh
8f85f5552b Kotlin: Accept test changes 2022-05-10 19:51:23 +01:00
Ian Lynagh
1ff6ada955 Kotlin: Tweak logging 2022-05-10 19:51:23 +01:00
Tamas Vajk
d6feb58bfc Fix property references to fake overrides 2022-05-10 19:51:23 +01:00
Tony Torralba
4eb1e3a47b Update ExtensionMethodAccess QLDoc 2022-05-10 19:51:23 +01:00
Tony Torralba
fcb334180d Create ExtensionMethodAccess class 2022-05-10 19:51:23 +01:00
Ian Lynagh
270beecef5 Kotlin: Write diagnostics to the write TRAP file
When a TRAP writer wrote a warning, it was going to the wrong TRAP
file.
2022-05-10 19:51:23 +01:00
Ian Lynagh
62ce28eb68 Kotlin: Populate diagnostic_for 2022-05-10 19:51:23 +01:00
Tamas Vajk
ac3c635fe3 Extract set function for field accessing property references 2022-05-10 19:51:23 +01:00
Tamas Vajk
a6f036d94e Extract property references with only backing field 2022-05-10 19:51:23 +01:00
Tamas Vajk
90ca47a46b Extract local delegated property reference 2022-05-10 19:51:23 +01:00
Ian Lynagh
47d8eb458e Kotlin: Improve top-level error handling 2022-05-10 19:51:23 +01:00
Ian Lynagh
a653054eb3 Kotlin: Make sure the context is empty when it should be 2022-05-10 19:51:23 +01:00
Ian Lynagh
3f4f0e5bec Kotlin: Accept test changes 2022-05-10 19:51:22 +01:00
Ian Lynagh
43a92f60b2 Kotlin: Give context to diagnostics
We now get e.g.

[2022-03-09 13:59:04 K] [ERROR] Diagnostic(com.github.codeql.KotlinUsesExtractor.useSimpleType(KotlinUsesExtractor.kt:505)): Type alias ignored for <root>.Test<kotlin.String>{ <root>.Alias1<kotlin.String> }
  ...while extracting a function at file:///home/ian/code/dev/ql/java/ql/test/kotlin/library-tests/type_aliases/aliases_with_type_parameters.kt:7:1:7:41
  ...while extracting a function if real at file:///home/ian/code/dev/ql/java/ql/test/kotlin/library-tests/type_aliases/aliases_with_type_parameters.kt:7:1:7:41
  ...while extracting a declaration at file:///home/ian/code/dev/ql/java/ql/test/kotlin/library-tests/type_aliases/aliases_with_type_parameters.kt:7:1:7:41
  ...while extracting a file at file:///home/ian/code/dev/ql/java/ql/test/kotlin/library-tests/type_aliases/aliases_with_type_parameters.kt:1:1:8:0
2022-05-10 19:51:22 +01:00
Tamas Vajk
a7e6ec9d02 Add test case for delegated properties initialized through provideDelegate operator 2022-05-10 19:51:22 +01:00
Tamas Vajk
a3992950b1 Add delegated property call tests 2022-05-10 19:51:22 +01:00
Tamas Vajk
126d780f34 Add delegated property declaration test 2022-05-10 19:51:22 +01:00
Tony Torralba
a6326b69dc Update java/ql/lib/config/semmlecode.dbscheme
Apply suggestion by @igfoo

Co-authored-by: Ian Lynagh <igfoo@github.com>
2022-05-10 19:51:22 +01:00
Tony Torralba
64531dd717 Fix AST representation of WhenExpr and WhenBranch 2022-05-10 19:51:22 +01:00
Tony Torralba
4b22e1a378 Extract WhenBranch as Stmt 2022-05-10 19:51:22 +01:00
Tony Torralba
10ab11cdf7 Handle WhenBranch CFG properly 2022-05-10 19:51:22 +01:00
Tony Torralba
5ea3228768 Fix test expectations 2022-05-10 19:51:22 +01:00
Tony Torralba
9735423c79 Fix WhenExpr flow 2022-05-10 19:51:22 +01:00
Tony Torralba
5979981199 Add test for missing WhenExpr flow 2022-05-10 19:51:22 +01:00
Tamas Vajk
d4701d72d9 Add DelegatedProperty QL class and use it in tests 2022-05-10 19:51:22 +01:00
Tamas Vajk
0ba2daf31a Adjust extraction to reuse KtProperty* relations 2022-05-10 19:51:22 +01:00
Tamas Vajk
78b4c9403d Add lazy local delegated property test case 2022-05-10 19:51:22 +01:00
Tamas Vajk
f8343b8cc7 Extract local delegated properties 2022-05-10 19:51:22 +01:00
Chris Smowton
48b99cf55c Don't try to attribute comments to the implicit this parameter. 2022-05-10 19:51:22 +01:00
Chris Smowton
6abb2529f5 Extract a clinit method for Kotlin files 2022-05-10 19:51:22 +01:00
Tamas Vajk
2d0bb43efe Do not extract local function containers as anonymous classes 2022-05-10 19:51:22 +01:00
Tamas Vajk
9597932112 Add test that calls a local function multiple times 2022-05-10 19:51:22 +01:00
Ian Lynagh
ea74803053 Kotlin: Add a comment 2022-05-10 19:51:22 +01:00
Ian Lynagh
44375fe1ae Kotlin: Add LoggerBase to the list of logging classes 2022-05-10 19:51:22 +01:00
Ian Lynagh
79c2ce7f1c Kotlin: Add tags to log messages (WARN, INFO, etc)
Makes it easier to see what's going on
2022-05-10 19:51:21 +01:00
Ian Lynagh
84c7b2310a Kotlin: Catch all Throwables
We want to try to continue even if we hit a stack overflow or an
assertion error.
2022-05-10 19:51:21 +01:00
Chris Smowton
8f929e2498 Avoid recursion through extractFunctionLaterIfExternalFileMember -> useType -> useDeclarationParent 2022-05-10 19:51:21 +01:00
Chris Smowton
1835022c84 Extract external file declarations to individual trap files 2022-05-10 19:51:21 +01:00
Ian Lynagh
2551bb58da Kotlin: Add a test of recursive instantiations
This used to cause a stack overflow
2022-05-10 19:51:21 +01:00
Ian Lynagh
0d79dfc412 Kotlin: Add a test of recursive instantiations
This used to cause a stack overflow
2022-05-10 19:51:21 +01:00