diff --git a/cpp/ql/lib/semmle/code/cpp/Function.qll b/cpp/ql/lib/semmle/code/cpp/Function.qll index 0648c6260ce5..7cfa779338f7 100644 --- a/cpp/ql/lib/semmle/code/cpp/Function.qll +++ b/cpp/ql/lib/semmle/code/cpp/Function.qll @@ -500,6 +500,17 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function { * Gets the nearest enclosing AccessHolder. */ override AccessHolder getEnclosingAccessHolder() { result = this.getDeclaringType() } + + /** + * Holds if this function has extraction errors that create an `ErrorExpr`. + */ + predicate hasErrors() { + exists(ErrorExpr e | + e.getEnclosingFunction() = this and + // Exclude the first allocator call argument because it is always extracted as `ErrorExpr`. + not exists(NewOrNewArrayExpr new | e = new.getAllocatorCall().getArgument(0)) + ) + } } pragma[noinline] diff --git a/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql b/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql index 1d02474bfbb7..5ae8468d0fc4 100644 --- a/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql +++ b/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql @@ -57,5 +57,5 @@ where not declarationHasSideEffects(v) and not exists(AsmStmt s | f = s.getEnclosingFunction()) and not v.getAnAttribute().getName() = "unused" and - not any(ErrorExpr e).getEnclosingFunction() = f // unextracted expr may use `v` + not f.hasErrors() // Unextracted expressions may use `v` select v, "Variable " + v.getName() + " is not used." diff --git a/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql b/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql index 16679d67fd2e..02678beaf124 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql @@ -29,7 +29,7 @@ class ReturnStackAllocatedMemoryConfig extends MustFlowConfiguration { override predicate isSource(Instruction source) { exists(Function func | // Rule out FPs caused by extraction errors. - not any(ErrorExpr e).getEnclosingFunction() = func and + not func.hasErrors() and not intentionallyReturnsStackPointer(func) and func = source.getEnclosingFunction() | diff --git a/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql b/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql index 35bee25c9f5f..763a142f1b90 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql @@ -65,6 +65,7 @@ predicate isSinkImpl(Instruction sink, VariableAccess va) { exists(LoadInstruction load | va = load.getUnconvertedResultExpression() and not va = commonException() and + not va.getTarget().(LocalVariable).getFunction().hasErrors() and sink = load.getSourceValue() ) } diff --git a/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql b/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql index 678cb95a7214..0df59b5f01db 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql @@ -24,7 +24,7 @@ predicate instructionHasVariable(VariableAddressInstruction vai, StackVariable v // Pointer-to-member types aren't properly handled in the dbscheme. not vai.getResultType() instanceof PointerToMemberType and // Rule out FPs caused by extraction errors. - not any(ErrorExpr e).getEnclosingFunction() = f + not f.hasErrors() } /** diff --git a/cpp/ql/src/change-notes/2024-10-02-uninitialized-local.md b/cpp/ql/src/change-notes/2024-10-02-uninitialized-local.md new file mode 100644 index 000000000000..e34a942f38a6 --- /dev/null +++ b/cpp/ql/src/change-notes/2024-10-02-uninitialized-local.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Fixed false positives in the `cpp/uninitialized-local` ("Potentially uninitialized local variable") query if there are extraction errors in the function. diff --git a/cpp/ql/src/jsf/4.13 Functions/AV Rule 114.ql b/cpp/ql/src/jsf/4.13 Functions/AV Rule 114.ql index ac5db25ea6b5..9027c064ac67 100644 --- a/cpp/ql/src/jsf/4.13 Functions/AV Rule 114.ql +++ b/cpp/ql/src/jsf/4.13 Functions/AV Rule 114.ql @@ -49,7 +49,7 @@ predicate functionsMissingReturnStmt(Function f, ControlFlowNode blame) { predicate functionImperfectlyExtracted(Function f) { exists(CompilerError e | f.getBlock().getLocation().subsumes(e.getLocation())) or - exists(ErrorExpr ee | ee.getEnclosingFunction() = f) + f.hasErrors() or count(f.getType()) > 1 or diff --git a/cpp/ql/test/library-tests/files/Files.expected b/cpp/ql/test/library-tests/files/Files.expected index 68187793433b..13f3a6b2da17 100644 --- a/cpp/ql/test/library-tests/files/Files.expected +++ b/cpp/ql/test/library-tests/files/Files.expected @@ -1,4 +1,4 @@ -| c.c | library-tests/files/c.c | CFile, MetricFile | C | | | -| files1.cpp | library-tests/files/files1.cpp | CppFile, MetricFile | C++ | swap | t | -| files1.h | library-tests/files/files1.h | HeaderFile, MetricFile | | swap | | -| files2.cpp | library-tests/files/files2.cpp | CppFile, MetricFile | C++ | g | x, y | +| c.c | c.c | CFile, MetricFile | C | | | +| files1.cpp | files1.cpp | CppFile, MetricFile | C++ | swap | t | +| files1.h | files1.h | HeaderFile, MetricFile | | swap | | +| files2.cpp | files2.cpp | CppFile, MetricFile | C++ | g | x, y | diff --git a/cpp/ql/test/query-tests/Diagnostics/Info.expected b/cpp/ql/test/query-tests/Diagnostics/Info.expected index 55e3310fd19b..a32541303609 100644 --- a/cpp/ql/test/query-tests/Diagnostics/Info.expected +++ b/cpp/ql/test/query-tests/Diagnostics/Info.expected @@ -1,6 +1,6 @@ -| containserror.cpp:0:0:0:0 | containserror.cpp | query-tests/Diagnostics/containserror.cpp | fromSource, normalTermination | -| containswarning.cpp:0:0:0:0 | containswarning.cpp | query-tests/Diagnostics/containswarning.cpp | fromSource, normalTermination | -| doesnotcompile.cpp:0:0:0:0 | doesnotcompile.cpp | query-tests/Diagnostics/doesnotcompile.cpp | ExtractionProblem (severity 1), fromSource, normalTermination | +| containserror.cpp:0:0:0:0 | containserror.cpp | containserror.cpp | fromSource, normalTermination | +| containswarning.cpp:0:0:0:0 | containswarning.cpp | containswarning.cpp | fromSource, normalTermination | +| doesnotcompile.cpp:0:0:0:0 | doesnotcompile.cpp | doesnotcompile.cpp | ExtractionProblem (severity 1), fromSource, normalTermination | | file://:0:0:0:0 | | | | -| header.h:0:0:0:0 | header.h | query-tests/Diagnostics/header.h | fromSource | -| successful.cpp:0:0:0:0 | successful.cpp | query-tests/Diagnostics/successful.cpp | fromSource, normalTermination | +| header.h:0:0:0:0 | header.h | header.h | fromSource | +| successful.cpp:0:0:0:0 | successful.cpp | successful.cpp | fromSource, normalTermination | diff --git a/cpp/ql/test/query-tests/Documentation/DocumentApi/DocumentApi.expected b/cpp/ql/test/query-tests/Documentation/DocumentApi/DocumentApi.expected index b19d88acdc28..62d47bc8db0b 100644 --- a/cpp/ql/test/query-tests/Documentation/DocumentApi/DocumentApi.expected +++ b/cpp/ql/test/query-tests/Documentation/DocumentApi/DocumentApi.expected @@ -1,16 +1,16 @@ -| comment_prototypes.c:29:6:29:11 | proto6 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:9:5:9:10 | call to proto6 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:29:6:29:11 | proto6 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:9:5:9:10 | call to proto6 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| comment_prototypes.c:34:6:34:11 | proto7 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:10:5:10:10 | call to proto7 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:34:6:34:11 | proto7 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:10:5:10:10 | call to proto7 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| comment_prototypes.c:45:6:45:11 | proto9 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:12:5:12:10 | call to proto9 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:45:6:45:11 | proto9 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:12:5:12:10 | call to proto9 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| comment_prototypes.c:50:6:50:12 | proto10 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:13:5:13:11 | call to proto10 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:50:6:50:12 | proto10 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:13:5:13:11 | call to proto10 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| comment_prototypes.c:55:6:55:12 | proto11 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:14:5:14:11 | call to proto11 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:55:6:55:12 | proto11 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:14:5:14:11 | call to proto11 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| comment_prototypes.c:66:6:66:12 | proto13 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:16:5:16:11 | call to proto13 | query-tests/Documentation/DocumentApi/comment_prototypes_caller1.c | -| comment_prototypes.c:66:6:66:12 | proto13 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:16:5:16:11 | call to proto13 | query-tests/Documentation/DocumentApi/comment_prototypes_caller2.c | -| definition.c:2:6:2:7 | f1 | Functions called from other files should be documented (called from $@). | user1.c:9:5:9:6 | call to f1 | query-tests/Documentation/DocumentApi/user1.c | -| definition.c:2:6:2:7 | f1 | Functions called from other files should be documented (called from $@). | user2.c:7:5:7:6 | call to f1 | query-tests/Documentation/DocumentApi/user2.c | -| definition.c:32:6:32:7 | f6 | Functions called from other files should be documented (called from $@). | user1.c:14:5:14:6 | call to f6 | query-tests/Documentation/DocumentApi/user1.c | -| definition.c:32:6:32:7 | f6 | Functions called from other files should be documented (called from $@). | user2.c:10:5:10:6 | call to f6 | query-tests/Documentation/DocumentApi/user2.c | +| comment_prototypes.c:29:6:29:11 | proto6 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:9:5:9:10 | call to proto6 | comment_prototypes_caller1.c | +| comment_prototypes.c:29:6:29:11 | proto6 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:9:5:9:10 | call to proto6 | comment_prototypes_caller2.c | +| comment_prototypes.c:34:6:34:11 | proto7 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:10:5:10:10 | call to proto7 | comment_prototypes_caller1.c | +| comment_prototypes.c:34:6:34:11 | proto7 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:10:5:10:10 | call to proto7 | comment_prototypes_caller2.c | +| comment_prototypes.c:45:6:45:11 | proto9 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:12:5:12:10 | call to proto9 | comment_prototypes_caller1.c | +| comment_prototypes.c:45:6:45:11 | proto9 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:12:5:12:10 | call to proto9 | comment_prototypes_caller2.c | +| comment_prototypes.c:50:6:50:12 | proto10 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:13:5:13:11 | call to proto10 | comment_prototypes_caller1.c | +| comment_prototypes.c:50:6:50:12 | proto10 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:13:5:13:11 | call to proto10 | comment_prototypes_caller2.c | +| comment_prototypes.c:55:6:55:12 | proto11 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:14:5:14:11 | call to proto11 | comment_prototypes_caller1.c | +| comment_prototypes.c:55:6:55:12 | proto11 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:14:5:14:11 | call to proto11 | comment_prototypes_caller2.c | +| comment_prototypes.c:66:6:66:12 | proto13 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller1.c:16:5:16:11 | call to proto13 | comment_prototypes_caller1.c | +| comment_prototypes.c:66:6:66:12 | proto13 | Functions called from other files should be documented (called from $@). | comment_prototypes_caller2.c:16:5:16:11 | call to proto13 | comment_prototypes_caller2.c | +| definition.c:2:6:2:7 | f1 | Functions called from other files should be documented (called from $@). | user1.c:9:5:9:6 | call to f1 | user1.c | +| definition.c:2:6:2:7 | f1 | Functions called from other files should be documented (called from $@). | user2.c:7:5:7:6 | call to f1 | user2.c | +| definition.c:32:6:32:7 | f6 | Functions called from other files should be documented (called from $@). | user1.c:14:5:14:6 | call to f6 | user1.c | +| definition.c:32:6:32:7 | f6 | Functions called from other files should be documented (called from $@). | user2.c:10:5:10:6 | call to f6 | user2.c | diff --git a/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependencies.expected b/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependencies.expected index a42506f8be11..795f6dba431a 100644 --- a/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependencies.expected +++ b/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependencies.expected @@ -1,4 +1,4 @@ -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibC<\|>unknown | 5 | -| /query-tests/Metrics/Dependencies/include.h<\|>LibD<\|>unknown | 1 | -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibA<\|>unknown | 1 | -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibB<\|>unknown | 1 | +| /main.cpp<\|>LibC<\|>unknown | 5 | +| /include.h<\|>LibD<\|>unknown | 1 | +| /main.cpp<\|>LibA<\|>unknown | 1 | +| /main.cpp<\|>LibB<\|>unknown | 1 | diff --git a/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependenciesSourceLinks.expected b/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependenciesSourceLinks.expected index f5399bf6ac31..b00deb76d7d8 100644 --- a/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependenciesSourceLinks.expected +++ b/cpp/ql/test/query-tests/Metrics/Dependencies/ExternalDependenciesSourceLinks.expected @@ -1,4 +1,4 @@ -| /query-tests/Metrics/Dependencies/include.h<\|>LibD<\|>unknown | include.h:0:0:0:0 | include.h | -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibA<\|>unknown | main.cpp:0:0:0:0 | main.cpp | -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibB<\|>unknown | main.cpp:0:0:0:0 | main.cpp | -| /query-tests/Metrics/Dependencies/main.cpp<\|>LibC<\|>unknown | main.cpp:0:0:0:0 | main.cpp | +| /include.h<\|>LibD<\|>unknown | include.h:0:0:0:0 | include.h | +| /main.cpp<\|>LibA<\|>unknown | main.cpp:0:0:0:0 | main.cpp | +| /main.cpp<\|>LibB<\|>unknown | main.cpp:0:0:0:0 | main.cpp | +| /main.cpp<\|>LibC<\|>unknown | main.cpp:0:0:0:0 | main.cpp | diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected index a8b3c7782e7c..6773f5aef942 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected @@ -1,5 +1,6 @@ edges nodes +| errors.cpp:13:7:13:7 | definition of x | semmle.label | definition of x | | test.cpp:11:6:11:8 | definition of foo | semmle.label | definition of foo | | test.cpp:111:6:111:8 | definition of foo | semmle.label | definition of foo | | test.cpp:226:7:226:7 | definition of x | semmle.label | definition of x | @@ -14,6 +15,7 @@ nodes | test.cpp:472:6:472:6 | definition of x | semmle.label | definition of x | | test.cpp:479:6:479:6 | definition of x | semmle.label | definition of x | #select +| errors.cpp:14:18:14:18 | x | errors.cpp:13:7:13:7 | definition of x | errors.cpp:13:7:13:7 | definition of x | The variable $@ may not be initialized at this access. | errors.cpp:13:7:13:7 | x | x | | test.cpp:12:6:12:8 | foo | test.cpp:11:6:11:8 | definition of foo | test.cpp:11:6:11:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:11:6:11:8 | foo | foo | | test.cpp:113:6:113:8 | foo | test.cpp:111:6:111:8 | definition of foo | test.cpp:111:6:111:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:111:6:111:8 | foo | foo | | test.cpp:227:3:227:3 | x | test.cpp:226:7:226:7 | definition of x | test.cpp:226:7:226:7 | definition of x | The variable $@ may not be initialized at this access. | test.cpp:226:7:226:7 | x | x | diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/errors.cpp b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/errors.cpp new file mode 100644 index 000000000000..07bb61f943ed --- /dev/null +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/errors.cpp @@ -0,0 +1,15 @@ +// semmle-extractor-options: --expect_errors + +int f1() { + int x; + initialize(&x); // error expression - initialize() is not defined + return x; // GOOD - assume x is initialized +} + +void * operator new(unsigned long, bool); +void operator delete(void*, bool); + +int f2() { + int x; + new(true) int (x); // BAD, ignore implicit error expression +} diff --git a/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll index 8181c9bcb74a..ebb481d2525e 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll @@ -42,7 +42,7 @@ private module LogForgingConfig implements DataFlow::ConfigSig { */ module LogForging = TaintTracking::Global; -/** A source of remote user input. */ +/** A source supported by the current threat model. */ private class ThreatModelSource extends Source instanceof ActiveThreatModelSource { } private class HtmlSanitizer extends Sanitizer { diff --git a/go/ql/integration-tests/test-extraction/src/go.mod b/go/ql/integration-tests/test-extraction/src/go.mod index c4a9f55df6c1..dae010718cf0 100644 --- a/go/ql/integration-tests/test-extraction/src/go.mod +++ b/go/ql/integration-tests/test-extraction/src/go.mod @@ -1,3 +1,3 @@ -go 1.14 +go 1.18 module testsample diff --git a/go/ql/integration-tests/test-extraction/src/pkg1/def.go b/go/ql/integration-tests/test-extraction/src/pkg1/def.go new file mode 100644 index 000000000000..e768e81b89d4 --- /dev/null +++ b/go/ql/integration-tests/test-extraction/src/pkg1/def.go @@ -0,0 +1,7 @@ +package pkg1 + +type Generic[T any] struct { + element T +} + +func TestMe() {} diff --git a/go/ql/integration-tests/test-extraction/src/pkg1/def_blackbox_test.go b/go/ql/integration-tests/test-extraction/src/pkg1/def_blackbox_test.go new file mode 100644 index 000000000000..09c9474567a6 --- /dev/null +++ b/go/ql/integration-tests/test-extraction/src/pkg1/def_blackbox_test.go @@ -0,0 +1,9 @@ +package pkg1_test + +import ( + "testsample/pkg1" +) + +func UsePkg1() { + pkg1.TestMe() +} diff --git a/go/ql/integration-tests/test-extraction/src/pkg1/def_test.go b/go/ql/integration-tests/test-extraction/src/pkg1/def_test.go new file mode 100644 index 000000000000..f321ab577c90 --- /dev/null +++ b/go/ql/integration-tests/test-extraction/src/pkg1/def_test.go @@ -0,0 +1,5 @@ +package pkg1 + +func UsePkg1() { + TestMe() +} diff --git a/go/ql/integration-tests/test-extraction/src/pkg2/use.go b/go/ql/integration-tests/test-extraction/src/pkg2/use.go new file mode 100644 index 000000000000..8caabc3847e7 --- /dev/null +++ b/go/ql/integration-tests/test-extraction/src/pkg2/use.go @@ -0,0 +1,12 @@ +package pkg2 + +import ( + "testsample/pkg1" +) + +// This tests the case of cross-package generic type references +// in the presence of test extraction. We need to make sure we +// extract packages, including test variants, in the right order +// such that we've seen pkg1.Generic before we try to use it here. + +type Specialised = pkg1.Generic[string] diff --git a/go/ql/integration-tests/test-extraction/test.expected b/go/ql/integration-tests/test-extraction/test.expected index 9e1585fc5ef8..77983c448071 100644 --- a/go/ql/integration-tests/test-extraction/test.expected +++ b/go/ql/integration-tests/test-extraction/test.expected @@ -1,8 +1,14 @@ #select +| src/pkg1/def.go:0:0:0:0 | src/pkg1/def.go | +| src/pkg1/def_blackbox_test.go:0:0:0:0 | src/pkg1/def_blackbox_test.go | +| src/pkg1/def_test.go:0:0:0:0 | src/pkg1/def_test.go | +| src/pkg2/use.go:0:0:0:0 | src/pkg2/use.go | | src/testme.go:0:0:0:0 | src/testme.go | | src/testme_blackbox_test.go:0:0:0:0 | src/testme_blackbox_test.go | | src/testme_test.go:0:0:0:0 | src/testme_test.go | calls +| src/pkg1/def_blackbox_test.go:8:2:8:14 | call to TestMe | src/pkg1/def.go:7:1:7:16 | function declaration | +| src/pkg1/def_test.go:4:2:4:9 | call to TestMe | src/pkg1/def.go:7:1:7:16 | function declaration | | src/testme_blackbox_test.go:10:18:10:44 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration | | src/testme_test.go:9:18:9:33 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration | | src/testme_test.go:14:19:14:35 | call to privateFunction | src/testme.go:5:1:5:39 | function declaration | diff --git a/go/ql/integration-tests/test-extraction/test.py b/go/ql/integration-tests/test-extraction/test.py index 6419ae83f38c..e25b46801146 100644 --- a/go/ql/integration-tests/test-extraction/test.py +++ b/go/ql/integration-tests/test-extraction/test.py @@ -1,7 +1,7 @@ import os def test_traced(codeql, go): - codeql.database.create(source_root="src", command="go test -c") + codeql.database.create(source_root="src", command="go test -c ./...") def test_autobuild(codeql, go): codeql.database.create(source_root="src", extractor_option = ["extract_tests=true"]) diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll b/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll index d7f0b0e2e6cb..ee430b62d577 100644 --- a/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll +++ b/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll @@ -6,7 +6,7 @@ private import semmle.code.java.dataflow.DataFlow /** An Android Layout XML file. */ class AndroidLayoutXmlFile extends XmlFile { - AndroidLayoutXmlFile() { this.getRelativePath().matches("%/res/layout/%.xml") } + AndroidLayoutXmlFile() { this.getRelativePath().regexpMatch("(.*/)?res/layout/.*\\.xml") } } /** A component declared in an Android layout file. */ diff --git a/java/ql/src/Metrics/Summaries/GeneratedVsManualCoverageQuery.qll b/java/ql/src/Metrics/Summaries/GeneratedVsManualCoverageQuery.qll index 9a2a0201e803..8309126c06de 100644 --- a/java/ql/src/Metrics/Summaries/GeneratedVsManualCoverageQuery.qll +++ b/java/ql/src/Metrics/Summaries/GeneratedVsManualCoverageQuery.qll @@ -17,12 +17,12 @@ private int getNumMadModeledApis(string package, string provenance, string apiSu ( // "auto-only" not sc.hasManualModel() and - sc.hasProvenance("df-generated") and + sc.hasGeneratedModel() and provenance = "generated" or sc.hasManualModel() and ( - if sc.hasProvenance("df-generated") + if sc.hasGeneratedModel() then // "both" provenance = "both" diff --git a/java/ql/test-kotlin1/library-tests/classes/local_anonymous.ql b/java/ql/test-kotlin1/library-tests/classes/local_anonymous.ql index af8e63e50d8d..479c6111d42e 100644 --- a/java/ql/test-kotlin1/library-tests/classes/local_anonymous.ql +++ b/java/ql/test-kotlin1/library-tests/classes/local_anonymous.ql @@ -1,8 +1,6 @@ import java -private predicate filterFile(Top t) { - t.getFile().getRelativePath().matches("%/local_anonymous.kt") -} +private predicate filterFile(Top t) { t.getFile().getRelativePath().matches("%local_anonymous.kt") } private string isAnonymousType(Type t) { if t instanceof AnonymousClass then result = "anonymous" else result = "not anonymous" diff --git a/java/ql/test-kotlin2/library-tests/classes/local_anonymous.ql b/java/ql/test-kotlin2/library-tests/classes/local_anonymous.ql index af8e63e50d8d..479c6111d42e 100644 --- a/java/ql/test-kotlin2/library-tests/classes/local_anonymous.ql +++ b/java/ql/test-kotlin2/library-tests/classes/local_anonymous.ql @@ -1,8 +1,6 @@ import java -private predicate filterFile(Top t) { - t.getFile().getRelativePath().matches("%/local_anonymous.kt") -} +private predicate filterFile(Top t) { t.getFile().getRelativePath().matches("%local_anonymous.kt") } private string isAnonymousType(Type t) { if t instanceof AnonymousClass then result = "anonymous" else result = "not anonymous" diff --git a/java/ql/test/library-tests/MemberRefExpr/parameters.expected b/java/ql/test/library-tests/MemberRefExpr/parameters.expected new file mode 100644 index 000000000000..2981f022fef6 --- /dev/null +++ b/java/ql/test/library-tests/MemberRefExpr/parameters.expected @@ -0,0 +1,10 @@ +| Test.java:3:22:3:24 | o | +| Test.java:7:22:7:26 | i | +| Test.java:45:22:45:26 | s | +| Test.java:49:29:49:42 | this | +| Test.java:50:29:50:42 | this | +| Test.java:51:29:51:39 | this | +| Test.java:52:40:52:64 | this | +| Test.java:70:13:70:22 | length | +| Test.java:71:13:71:26 | length | +| Test.java:75:31:75:47 | this | diff --git a/java/ql/test/library-tests/MemberRefExpr/parameters.ql b/java/ql/test/library-tests/MemberRefExpr/parameters.ql new file mode 100644 index 000000000000..d4b8690b4850 --- /dev/null +++ b/java/ql/test/library-tests/MemberRefExpr/parameters.ql @@ -0,0 +1,5 @@ +import java + +from Parameter p +where p.fromSource() +select p diff --git a/javascript/ql/test/library-tests/Files/relativePaths.expected b/javascript/ql/test/library-tests/Files/relativePaths.expected index d70416666954..16c365fdbb13 100644 --- a/javascript/ql/test/library-tests/Files/relativePaths.expected +++ b/javascript/ql/test/library-tests/Files/relativePaths.expected @@ -1,2 +1,2 @@ -| a.js:0:0:0:0 | a.js | library-tests/Files/a.js | -| b/c.js:0:0:0:0 | b/c.js | library-tests/Files/b/c.js | +| a.js:0:0:0:0 | a.js | a.js | +| b/c.js:0:0:0:0 | b/c.js | b/c.js | diff --git a/javascript/ql/test/library-tests/Modules/tests.expected b/javascript/ql/test/library-tests/Modules/tests.expected index cec0b96049e8..bf0efddba553 100644 --- a/javascript/ql/test/library-tests/Modules/tests.expected +++ b/javascript/ql/test/library-tests/Modules/tests.expected @@ -115,16 +115,16 @@ test_ReExportDeclarations | m/c.js:5:1:5:30 | export ... '../b'; | m/c.js:5:24:5:29 | '../b' | | reExportNamespace.js:1:1:1:26 | export ... "./a"; | reExportNamespace.js:1:21:1:25 | "./a" | test_getAnImportedModule -| library-tests/Modules/b.js | library-tests/Modules/a.js | -| library-tests/Modules/d.js | library-tests/Modules/a.js | -| library-tests/Modules/d.js | library-tests/Modules/b.js | -| library-tests/Modules/es2015_require.js | library-tests/Modules/d.js | -| library-tests/Modules/f.ts | library-tests/Modules/e.js | -| library-tests/Modules/g.ts | library-tests/Modules/f.ts | -| library-tests/Modules/import-indirect-path.js | library-tests/Modules/a.js | -| library-tests/Modules/import-ts-with-js-extension.ts | library-tests/Modules/f.ts | -| library-tests/Modules/m/c.js | library-tests/Modules/b.js | -| library-tests/Modules/reExportNamespaceClient.js | library-tests/Modules/reExportNamespace.js | +| b.js | a.js | +| d.js | a.js | +| d.js | b.js | +| es2015_require.js | d.js | +| f.ts | e.js | +| g.ts | f.ts | +| import-indirect-path.js | a.js | +| import-ts-with-js-extension.ts | f.ts | +| m/c.js | b.js | +| reExportNamespaceClient.js | reExportNamespace.js | test_getExportedName | arbitrarySpecifier.ts:5:10:5:30 | Foo_new ... o::new" | Foo::new | | arbitrarySpecifier.ts:6:13:6:28 | * as "Foo_types" | Foo_types | diff --git a/javascript/ql/test/library-tests/NodeJS/tests.expected b/javascript/ql/test/library-tests/NodeJS/tests.expected index 2f5d09245ec8..b97c6a345e8f 100644 --- a/javascript/ql/test/library-tests/NodeJS/tests.expected +++ b/javascript/ql/test/library-tests/NodeJS/tests.expected @@ -94,12 +94,12 @@ requireImport | a.js:3:6:3:23 | require('./sub/c') | ./sub/c | sub/c.js:1:1:4:0 | | | a.js:4:6:4:29 | require ... /d.js') | ./sub/../d.js | d.js:1:1:7:15 | | | a.js:7:1:7:18 | require('./sub/c') | ./sub/c | sub/c.js:1:1:4:0 | | -| a.js:10:1:10:18 | require(__dirname) | /library-tests/NodeJS | index.js:1:1:3:0 | | -| a.js:11:1:11:25 | require ... + '/e') | /library-tests/NodeJS/e | e.js:1:1:6:0 | | +| a.js:10:1:10:18 | require(__dirname) | | index.js:1:1:3:0 | | +| a.js:11:1:11:25 | require ... + '/e') | /e | e.js:1:1:6:0 | | | a.js:12:1:12:28 | require ... + 'c') | ./sub/c | sub/c.js:1:1:4:0 | | | b.js:1:1:1:18 | require('./sub/c') | ./sub/c | sub/c.js:1:1:4:0 | | | d.js:7:1:7:14 | require('foo') | foo | sub/f.js:1:1:4:17 | | -| index.js:2:1:2:41 | require ... b.js")) | /library-tests/NodeJS/index.js/../b.js | b.js:1:1:8:0 | | +| index.js:2:1:2:41 | require ... b.js")) | /index.js/../b.js | b.js:1:1:8:0 | | | mjs-files/require-from-js.js:1:12:1:36 | require ... on-me') | ./depend-on-me | mjs-files/depend-on-me.mjs:1:1:7:1 | | | mjs-files/require-from-js.js:2:12:2:39 | require ... me.js') | ./depend-on-me.js | mjs-files/depend-on-me.js:1:1:8:0 | | | mjs-files/require-from-js.js:3:12:3:40 | require ... e.mjs') | ./depend-on-me.mjs | mjs-files/depend-on-me.mjs:1:1:7:1 | | diff --git a/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected b/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected index 711e94cfdaa1..2bb7faf59eb9 100644 --- a/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected +++ b/javascript/ql/test/library-tests/TypeScript/EmbeddedInScript/Test.expected @@ -8,27 +8,27 @@ exprType | htmlfile.html:5:26:5:28 | foo | () => void | | htmlfile.html:5:26:5:30 | foo() | void | | htmlfile.html:5:26:5:42 | foo() as number[] | number[] | -| other.ts:1:8:1:16 | Component | typeof default in library-tests/TypeScript/EmbeddedInScript/test.vue | +| other.ts:1:8:1:16 | Component | typeof default in test.vue | | other.ts:1:23:1:34 | "./test.vue" | any | -| other.ts:2:8:2:19 | ComponentTsx | typeof default in library-tests/TypeScript/EmbeddedInScript/test_tsx.vue | +| other.ts:2:8:2:19 | ComponentTsx | typeof default in test_tsx.vue | | other.ts:2:26:2:41 | "./test_tsx.vue" | any | | other.ts:4:1:4:15 | new Component() | MyComponent | -| other.ts:4:5:4:13 | Component | typeof default in library-tests/TypeScript/EmbeddedInScript/test.vue | +| other.ts:4:5:4:13 | Component | typeof default in test.vue | | other.ts:5:1:5:18 | new ComponentTsx() | MyComponentTsx | -| other.ts:5:5:5:16 | ComponentTsx | typeof default in library-tests/TypeScript/EmbeddedInScript/test_tsx.vue | +| other.ts:5:5:5:16 | ComponentTsx | typeof default in test_tsx.vue | | other.ts:7:17:7:19 | foo | () => void | -| test.vue:2:15:2:19 | other | typeof library-tests/TypeScript/EmbeddedInScript/other.ts | +| test.vue:2:15:2:19 | other | typeof other.ts | | test.vue:2:26:2:34 | "./other" | any | | test.vue:3:24:3:34 | MyComponent | MyComponent | | test.vue:4:7:4:7 | x | number | -| test_tsx.vue:2:15:2:19 | other | typeof library-tests/TypeScript/EmbeddedInScript/other.ts | +| test_tsx.vue:2:15:2:19 | other | typeof other.ts | | test_tsx.vue:2:26:2:34 | "./other" | any | | test_tsx.vue:3:24:3:37 | MyComponentTsx | MyComponentTsx | | test_tsx.vue:4:7:4:7 | x | number | symbols -| other.ts:1:1:8:0 | | library-tests/TypeScript/EmbeddedInScript/other.ts | -| test.vue:2:3:6:0 | | library-tests/TypeScript/EmbeddedInScript/test.vue | -| test_tsx.vue:2:3:6:0 | | library-tests/TypeScript/EmbeddedInScript/test_tsx.vue | +| other.ts:1:1:8:0 | | other.ts | +| test.vue:2:3:6:0 | | test.vue | +| test_tsx.vue:2:3:6:0 | | test_tsx.vue | importTarget | htmlfile.html:4:13:4:42 | import ... other"; | other.ts:1:1:8:0 | | | other.ts:1:1:1:35 | import ... t.vue"; | test.vue:2:3:6:0 | | diff --git a/javascript/ql/test/library-tests/TypeScript/HasQualifiedNameFallback/Test.expected b/javascript/ql/test/library-tests/TypeScript/HasQualifiedNameFallback/Test.expected index 5da73c5cfe45..5ee97e2dfb59 100644 --- a/javascript/ql/test/library-tests/TypeScript/HasQualifiedNameFallback/Test.expected +++ b/javascript/ql/test/library-tests/TypeScript/HasQualifiedNameFallback/Test.expected @@ -1,12 +1,12 @@ hasQualifiedNameModule | default-import | default | tst.ts:11:9:11:21 | DefaultImport | | import-assign | Foo | tst.ts:10:9:10:15 | asn.Foo | -| library-tests/TypeScript/HasQualifiedNameFallback/tst.ts | ExportedClass | relative.ts:4:8:4:20 | ExportedClass | | named-import | Name1 | tst.ts:7:9:7:13 | Name1 | | named-import | Name1 | tst.ts:13:9:13:13 | Name1 | | named-import | Name1 | tst.ts:13:9:13:21 | Name1 | | named-import | Name2 | tst.ts:8:9:8:13 | Name2 | | namespace-import | Foo | tst.ts:9:9:9:21 | namespace.Foo | +| tst.ts | ExportedClass | relative.ts:4:8:4:20 | ExportedClass | hasQualifiedNameGlobal | UnresolvedName | tst.ts:12:9:12:22 | UnresolvedName | paramExample diff --git a/javascript/ql/test/library-tests/TypeScript/PathMapping/Imports.expected b/javascript/ql/test/library-tests/TypeScript/PathMapping/Imports.expected index c608ea2c7b61..886391b14552 100644 --- a/javascript/ql/test/library-tests/TypeScript/PathMapping/Imports.expected +++ b/javascript/ql/test/library-tests/TypeScript/PathMapping/Imports.expected @@ -1,11 +1,11 @@ symbols -| src/lib/foo.ts:1:1:4:0 | | library-tests/TypeScript/PathMapping/src/lib/foo.ts | -| src/lib/foo.ts:1:8:3:1 | functio ... 123;\\n} | foo in library-tests/TypeScript/PathMapping/src/lib/foo.ts | -| test/test_foo.ts:1:1:1:28 | import ... @/foo"; | library-tests/TypeScript/PathMapping/src/lib/foo.ts | -| test/test_foo.ts:1:1:7:0 | | library-tests/TypeScript/PathMapping/test/test_foo.ts | -| test/test_foo.ts:2:17:2:32 | require("@/foo") | library-tests/TypeScript/PathMapping/src/lib/foo.ts | -| test/test_foo.ts:4:1:4:5 | foo() | foo in library-tests/TypeScript/PathMapping/src/lib/foo.ts | -| test/test_foo.ts:6:1:6:12 | foolib.foo() | foo in library-tests/TypeScript/PathMapping/src/lib/foo.ts | +| src/lib/foo.ts:1:1:4:0 | | src/lib/foo.ts | +| src/lib/foo.ts:1:8:3:1 | functio ... 123;\\n} | foo in src/lib/foo.ts | +| test/test_foo.ts:1:1:1:28 | import ... @/foo"; | src/lib/foo.ts | +| test/test_foo.ts:1:1:7:0 | | test/test_foo.ts | +| test/test_foo.ts:2:17:2:32 | require("@/foo") | src/lib/foo.ts | +| test/test_foo.ts:4:1:4:5 | foo() | foo in src/lib/foo.ts | +| test/test_foo.ts:6:1:6:12 | foolib.foo() | foo in src/lib/foo.ts | #select | test/test_foo.ts:1:1:1:28 | import ... @/foo"; | src/lib/foo.ts:1:1:4:0 | | | test/test_foo.ts:2:17:2:32 | require("@/foo") | src/lib/foo.ts:1:1:4:0 | | diff --git a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/Namespaces.expected b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/Namespaces.expected index 214b23594e7f..0494011bc70a 100644 --- a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/Namespaces.expected +++ b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/Namespaces.expected @@ -1,33 +1,33 @@ -| A in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| A in library-tests/TypeScript/QualifiedNameResolution/export-qualified.ts | -| A in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| A.B in library-tests/TypeScript/QualifiedNameResolution/export-qualified.ts | -| A.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| A.E in library-tests/TypeScript/QualifiedNameResolution/enums.ts | +| A in enums.ts | +| A in export-qualified.ts | +| A in namespaces.ts | +| A.B in export-qualified.ts | +| A.C in namespaces.ts | +| A.E in enums.ts | | B in namespaces.ts:3 | | B in namespaces.ts:10 | | B.Bx in namespaces.ts:3 | | B.Bx in namespaces.ts:10 | -| D in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | -| D in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| D in library-tests/TypeScript/QualifiedNameResolution/otherlib.ts | -| D.F in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| D in export-specifiers.ts | +| D in namespaces.ts | +| D in otherlib.ts | +| D.F in namespaces.ts | | E in namespaces.ts:17 | | E in namespaces.ts:22 | | Foo in global scope | -| G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| G.J in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| G in namespaces.ts | +| G.J in namespaces.ts | | Glob in global scope | | H in namespaces.ts:27 | | H.I in namespaces.ts:27 | -| N in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | +| N in export-specifiers.ts | | X in global scope | -| X in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| X.Y in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| X.Y.Z in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| X in namespaces.ts | +| X.Y in namespaces.ts | +| X.Y.Z in namespaces.ts | | Y in global scope | -| library-tests/TypeScript/QualifiedNameResolution/export-class.ts | -| library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| library-tests/TypeScript/QualifiedNameResolution/otherlib.ts | -| library-tests/TypeScript/QualifiedNameResolution/reexport-all.ts | -| library-tests/TypeScript/QualifiedNameResolution/reexport-named.ts | +| export-class.ts | +| namespaces.ts | +| otherlib.ts | +| reexport-all.ts | +| reexport-named.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveNamespace.expected b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveNamespace.expected index 20df7b95bd9a..7ec8faec19ff 100644 --- a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveNamespace.expected +++ b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveNamespace.expected @@ -1,31 +1,31 @@ | ambient.ts:5:16:5:18 | Foo | Foo in global scope | -| enums.ts:9:8:9:8 | A | A in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| enums.ts:9:8:9:10 | A.E | A.E in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| enums.ts:10:8:10:8 | A | A in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| export-qualified-client.ts:3:8:3:9 | AB | A.B in library-tests/TypeScript/QualifiedNameResolution/export-qualified.ts | -| export-specifiers-client.ts:4:8:4:8 | N | N in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | -| export-specifiers-client.ts:5:8:5:8 | D | D in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | +| enums.ts:9:8:9:8 | A | A in enums.ts | +| enums.ts:9:8:9:10 | A.E | A.E in enums.ts | +| enums.ts:10:8:10:8 | A | A in enums.ts | +| export-qualified-client.ts:3:8:3:9 | AB | A.B in export-qualified.ts | +| export-specifiers-client.ts:4:8:4:8 | N | N in export-specifiers.ts | +| export-specifiers-client.ts:5:8:5:8 | D | D in export-specifiers.ts | | global.ts:5:9:5:12 | Glob | Glob in global scope | | import-in-namespace.ts:9:13:9:13 | A | X in global scope | -| namespaces-client.ts:4:9:4:10 | ns | library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:4:9:4:12 | ns.G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:5:9:5:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:6:9:6:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:6:9:6:11 | G.J | G.J in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:4:9:4:10 | ns | library-tests/TypeScript/QualifiedNameResolution/reexport-all.ts | -| reexport-all-client.ts:4:9:4:12 | ns.G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:5:9:5:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:6:9:6:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:6:9:6:11 | G.J | G.J in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:8:8:8:8 | D | D in library-tests/TypeScript/QualifiedNameResolution/otherlib.ts | -| reexport-all-client.ts:9:8:9:9 | ns | library-tests/TypeScript/QualifiedNameResolution/reexport-all.ts | -| reexport-all-client.ts:9:8:9:11 | ns.D | D in library-tests/TypeScript/QualifiedNameResolution/otherlib.ts | -| reexport-all-client.ts:11:8:11:9 | ns | library-tests/TypeScript/QualifiedNameResolution/reexport-all.ts | -| reexport-named-client.ts:4:9:4:10 | ns | library-tests/TypeScript/QualifiedNameResolution/reexport-named.ts | -| reexport-named-client.ts:4:9:4:12 | ns.G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:5:9:5:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:6:9:6:9 | G | G in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:6:9:6:11 | G.J | G.J in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:8:8:8:8 | X | D in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:9:8:9:9 | ns | library-tests/TypeScript/QualifiedNameResolution/reexport-named.ts | -| reexport-named-client.ts:9:8:9:11 | ns.X | D in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| namespaces-client.ts:4:9:4:10 | ns | namespaces.ts | +| namespaces-client.ts:4:9:4:12 | ns.G | G in namespaces.ts | +| namespaces-client.ts:5:9:5:9 | G | G in namespaces.ts | +| namespaces-client.ts:6:9:6:9 | G | G in namespaces.ts | +| namespaces-client.ts:6:9:6:11 | G.J | G.J in namespaces.ts | +| reexport-all-client.ts:4:9:4:10 | ns | reexport-all.ts | +| reexport-all-client.ts:4:9:4:12 | ns.G | G in namespaces.ts | +| reexport-all-client.ts:5:9:5:9 | G | G in namespaces.ts | +| reexport-all-client.ts:6:9:6:9 | G | G in namespaces.ts | +| reexport-all-client.ts:6:9:6:11 | G.J | G.J in namespaces.ts | +| reexport-all-client.ts:8:8:8:8 | D | D in otherlib.ts | +| reexport-all-client.ts:9:8:9:9 | ns | reexport-all.ts | +| reexport-all-client.ts:9:8:9:11 | ns.D | D in otherlib.ts | +| reexport-all-client.ts:11:8:11:9 | ns | reexport-all.ts | +| reexport-named-client.ts:4:9:4:10 | ns | reexport-named.ts | +| reexport-named-client.ts:4:9:4:12 | ns.G | G in namespaces.ts | +| reexport-named-client.ts:5:9:5:9 | G | G in namespaces.ts | +| reexport-named-client.ts:6:9:6:9 | G | G in namespaces.ts | +| reexport-named-client.ts:6:9:6:11 | G.J | G.J in namespaces.ts | +| reexport-named-client.ts:8:8:8:8 | X | D in namespaces.ts | +| reexport-named-client.ts:9:8:9:9 | ns | reexport-named.ts | +| reexport-named-client.ts:9:8:9:11 | ns.X | D in namespaces.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveTypeName.expected b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveTypeName.expected index 008b2cbbbeb0..1629bdac5b15 100644 --- a/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveTypeName.expected +++ b/javascript/ql/test/library-tests/TypeScript/QualifiedNameResolution/ResolveTypeName.expected @@ -1,27 +1,27 @@ | ambient.ts:5:16:5:20 | Foo.C | Foo.C in global scope | -| enums.ts:9:8:9:12 | A.E.x | A.E.x in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| enums.ts:10:8:10:10 | A.E | A.E in library-tests/TypeScript/QualifiedNameResolution/enums.ts | -| export-class-client-renamed.ts:3:8:3:8 | X | Banana in library-tests/TypeScript/QualifiedNameResolution/export-class.ts | -| export-class-client.ts:3:8:3:13 | Banana | Banana in library-tests/TypeScript/QualifiedNameResolution/export-class.ts | -| export-qualified-client.ts:3:8:3:11 | AB.C | A.B.C in library-tests/TypeScript/QualifiedNameResolution/export-qualified.ts | -| export-specifiers-client.ts:4:8:4:10 | N.C | N.C in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | -| export-specifiers-client.ts:5:8:5:10 | D.C | D.C in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | -| export-specifiers-client.ts:6:8:6:8 | C | C in library-tests/TypeScript/QualifiedNameResolution/export-specifiers.ts | +| enums.ts:9:8:9:12 | A.E.x | A.E.x in enums.ts | +| enums.ts:10:8:10:10 | A.E | A.E in enums.ts | +| export-class-client-renamed.ts:3:8:3:8 | X | Banana in export-class.ts | +| export-class-client.ts:3:8:3:13 | Banana | Banana in export-class.ts | +| export-qualified-client.ts:3:8:3:11 | AB.C | A.B.C in export-qualified.ts | +| export-specifiers-client.ts:4:8:4:10 | N.C | N.C in export-specifiers.ts | +| export-specifiers-client.ts:5:8:5:10 | D.C | D.C in export-specifiers.ts | +| export-specifiers-client.ts:6:8:6:8 | C | C in export-specifiers.ts | | global.ts:5:9:5:14 | Glob.C | Glob.C in global scope | | import-in-namespace.ts:9:13:9:15 | A.C | X.C in global scope | | import-in-namespace.ts:10:13:10:13 | D | X.C in global scope | -| namespaces-client.ts:4:9:4:14 | ns.G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:5:9:5:11 | G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| namespaces-client.ts:6:9:6:13 | G.J.C | G.J.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:4:9:4:14 | ns.G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:5:9:5:11 | G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-all-client.ts:6:9:6:13 | G.J.C | G.J.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| namespaces-client.ts:4:9:4:14 | ns.G.C | G.C in namespaces.ts | +| namespaces-client.ts:5:9:5:11 | G.C | G.C in namespaces.ts | +| namespaces-client.ts:6:9:6:13 | G.J.C | G.J.C in namespaces.ts | +| reexport-all-client.ts:4:9:4:14 | ns.G.C | G.C in namespaces.ts | +| reexport-all-client.ts:5:9:5:11 | G.C | G.C in namespaces.ts | +| reexport-all-client.ts:6:9:6:13 | G.J.C | G.J.C in namespaces.ts | | reexport-all-client.ts:8:8:8:10 | D.F | D.F in unknown scope | | reexport-all-client.ts:9:8:9:13 | ns.D.F | ns.D.F in unknown scope | -| reexport-all-client.ts:11:8:11:16 | ns.Banana | Banana in library-tests/TypeScript/QualifiedNameResolution/export-class.ts | -| reexport-named-client.ts:4:9:4:14 | ns.G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:5:9:5:11 | G.C | G.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | -| reexport-named-client.ts:6:9:6:13 | G.J.C | G.J.C in library-tests/TypeScript/QualifiedNameResolution/namespaces.ts | +| reexport-all-client.ts:11:8:11:16 | ns.Banana | Banana in export-class.ts | +| reexport-named-client.ts:4:9:4:14 | ns.G.C | G.C in namespaces.ts | +| reexport-named-client.ts:5:9:5:11 | G.C | G.C in namespaces.ts | +| reexport-named-client.ts:6:9:6:13 | G.J.C | G.J.C in namespaces.ts | | reexport-named-client.ts:8:8:8:10 | X.F | X.F in unknown scope | | reexport-named-client.ts:9:8:9:13 | ns.X.F | ns.X.F in unknown scope | -| reexport-named-client.ts:11:9:11:9 | Y | Banana in library-tests/TypeScript/QualifiedNameResolution/export-class.ts | +| reexport-named-client.ts:11:9:11:9 | Y | Banana in export-class.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/RegressionTests/EmptyName/test.expected b/javascript/ql/test/library-tests/TypeScript/RegressionTests/EmptyName/test.expected index 47317a00a867..85cb86df42a2 100644 --- a/javascript/ql/test/library-tests/TypeScript/RegressionTests/EmptyName/test.expected +++ b/javascript/ql/test/library-tests/TypeScript/RegressionTests/EmptyName/test.expected @@ -1,4 +1,4 @@ | MK in unknown scope | -| Mapped in library-tests/TypeScript/RegressionTests/EmptyName/test.ts | -| fn in library-tests/TypeScript/RegressionTests/EmptyName/test.ts | -| library-tests/TypeScript/RegressionTests/EmptyName/test.ts | +| Mapped in test.ts | +| fn in test.ts | +| test.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/RegressionTests/ExportEqualsExpr/test.expected b/javascript/ql/test/library-tests/TypeScript/RegressionTests/ExportEqualsExpr/test.expected index 3736c602bc32..24fc12058753 100644 --- a/javascript/ql/test/library-tests/TypeScript/RegressionTests/ExportEqualsExpr/test.expected +++ b/javascript/ql/test/library-tests/TypeScript/RegressionTests/ExportEqualsExpr/test.expected @@ -1,7 +1,7 @@ | "bar" in global scope | | C in module 'bar' | | Foo in global scope | -| Foo in library-tests/TypeScript/RegressionTests/ExportEqualsExpr/tst.ts | -| library-tests/TypeScript/RegressionTests/ExportEqualsExpr/tst.ts | +| Foo in tst.ts | | module 'bar' | | module 'foo' | +| tst.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/RegressionTests/SemicolonInName/test.expected b/javascript/ql/test/library-tests/TypeScript/RegressionTests/SemicolonInName/test.expected index 074e6d0c2777..603eaba0d279 100644 --- a/javascript/ql/test/library-tests/TypeScript/RegressionTests/SemicolonInName/test.expected +++ b/javascript/ql/test/library-tests/TypeScript/RegressionTests/SemicolonInName/test.expected @@ -1,2 +1,2 @@ | Bar.Foo in global scope | Bar in global scope | -| fn in library-tests/TypeScript/RegressionTests/SemicolonInName/test.ts | library-tests/TypeScript/RegressionTests/SemicolonInName/test.ts | +| fn in test.ts | test.ts | diff --git a/javascript/ql/test/library-tests/TypeScript/SyntaxErrors/SyntaxErrors.expected b/javascript/ql/test/library-tests/TypeScript/SyntaxErrors/SyntaxErrors.expected index 58e88ed6fe11..cca870438e91 100644 --- a/javascript/ql/test/library-tests/TypeScript/SyntaxErrors/SyntaxErrors.expected +++ b/javascript/ql/test/library-tests/TypeScript/SyntaxErrors/SyntaxErrors.expected @@ -1 +1 @@ -| library-tests/TypeScript/SyntaxErrors/jsdocTypes.ts | This file contains a parse error | +| jsdocTypes.ts | This file contains a parse error | diff --git a/javascript/ql/test/library-tests/TypeScript/Types/tests.expected b/javascript/ql/test/library-tests/TypeScript/Types/tests.expected index 1cf1ca607ae3..b786fae3713e 100644 --- a/javascript/ql/test/library-tests/TypeScript/Types/tests.expected +++ b/javascript/ql/test/library-tests/TypeScript/Types/tests.expected @@ -1,7 +1,7 @@ booleans | boolean | getExprType -| boolean-type.ts:1:13:1:17 | dummy | typeof library-tests/TypeScript/Types/dummy.ts | +| boolean-type.ts:1:13:1:17 | dummy | typeof dummy.ts | | boolean-type.ts:1:24:1:32 | "./dummy" | any | | boolean-type.ts:3:5:3:9 | true1 | true | | boolean-type.ts:4:5:4:9 | true2 | true | @@ -24,7 +24,7 @@ getExprType | middle-rest.ts:3:8:3:11 | true | true | | middle-rest.ts:3:14:3:20 | "hello" | "hello" | | middle-rest.ts:3:23:3:25 | 123 | 123 | -| tst.ts:1:13:1:17 | dummy | typeof library-tests/TypeScript/Types/dummy.ts | +| tst.ts:1:13:1:17 | dummy | typeof dummy.ts | | tst.ts:1:24:1:32 | "./dummy" | any | | tst.ts:3:5:3:10 | numVar | number | | tst.ts:5:5:5:8 | num1 | number | @@ -127,7 +127,7 @@ getExprType | tst.ts:69:24:69:45 | {yetAno ... : true} | MyUnion2 | | tst.ts:69:25:69:38 | yetAnotherType | true | | tst.ts:69:41:69:44 | true | true | -| tst.ts:71:8:71:11 | TS43 | typeof TS43 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:71:8:71:11 | TS43 | typeof TS43 in tst.ts | | tst.ts:74:5:74:22 | get size(): number | number | | tst.ts:74:9:74:12 | size | number | | tst.ts:75:5:75:47 | set siz ... olean); | number | @@ -175,7 +175,7 @@ getExprType | tst.ts:126:7:126:22 | this.#someMethod | () => number | | tst.ts:126:7:126:24 | this.#someMethod() | number | | tst.ts:127:14:127:28 | this.#someValue | number | -| tst.ts:132:8:132:11 | TS44 | typeof TS44 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:132:8:132:11 | TS44 | typeof TS44 in tst.ts | | tst.ts:133:12:133:14 | foo | (arg: unknown) => void | | tst.ts:133:16:133:18 | arg | unknown | | tst.ts:134:11:134:21 | argIsString | boolean | @@ -260,7 +260,7 @@ getExprType | tst.ts:189:11:189:15 | count | number | | tst.ts:189:19:189:21 | Foo | typeof Foo in tst.ts:132 | | tst.ts:189:19:189:28 | Foo.#count | number | -| tst.ts:195:8:195:11 | TS45 | typeof TS45 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:195:8:195:11 | TS45 | typeof TS45 in tst.ts | | tst.ts:207:5:207:8 | body | string | | tst.ts:212:7:212:13 | message | string | | tst.ts:215:19:215:25 | handler | (r: Success \| Error) => void | @@ -301,7 +301,7 @@ getExprType | tst.ts:238:11:238:14 | Foo3 | { foo: string; } | | tst.ts:238:11:238:18 | Foo3.foo | string | | tst.ts:238:16:238:18 | foo | string | -| tst.ts:240:8:240:11 | TS46 | typeof TS46 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:240:8:240:11 | TS46 | typeof TS46 in tst.ts | | tst.ts:241:9:241:12 | Base | Base | | tst.ts:243:9:243:15 | Derived | Derived | | tst.ts:243:25:243:28 | Base | Base | @@ -481,27 +481,27 @@ getExprType | tst.ts:362:9:362:11 | log | (...data: any[]) => void | | tst.ts:362:13:362:24 | tstModuleCJS | () => "a" \| "b" | | tst.ts:362:13:362:26 | tstModuleCJS() | "a" \| "b" | -| tst.ts:368:13:368:13 | A | typeof library-tests/TypeScript/Types/tstSuffixA.ts | +| tst.ts:368:13:368:13 | A | typeof tstSuffixA.ts | | tst.ts:368:20:368:33 | './tstSuffixA' | any | | tst.ts:370:1:370:7 | console | Console | | tst.ts:370:1:370:11 | console.log | (...data: any[]) => void | | tst.ts:370:1:370:29 | console ... File()) | void | | tst.ts:370:9:370:11 | log | (...data: any[]) => void | -| tst.ts:370:13:370:13 | A | typeof library-tests/TypeScript/Types/tstSuffixA.ts | +| tst.ts:370:13:370:13 | A | typeof tstSuffixA.ts | | tst.ts:370:13:370:26 | A.resolvedFile | () => "tstSuffixA.ts" | | tst.ts:370:13:370:28 | A.resolvedFile() | "tstSuffixA.ts" | | tst.ts:370:15:370:26 | resolvedFile | () => "tstSuffixA.ts" | -| tst.ts:372:13:372:13 | B | typeof library-tests/TypeScript/Types/tstSuffixB.ios.ts | +| tst.ts:372:13:372:13 | B | typeof tstSuffixB.ios.ts | | tst.ts:372:20:372:33 | './tstSuffixB' | any | | tst.ts:374:1:374:7 | console | Console | | tst.ts:374:1:374:11 | console.log | (...data: any[]) => void | | tst.ts:374:1:374:29 | console ... File()) | void | | tst.ts:374:9:374:11 | log | (...data: any[]) => void | -| tst.ts:374:13:374:13 | B | typeof library-tests/TypeScript/Types/tstSuffixB.ios.ts | +| tst.ts:374:13:374:13 | B | typeof tstSuffixB.ios.ts | | tst.ts:374:13:374:26 | B.resolvedFile | () => "tstSuffixB.ios.ts" | | tst.ts:374:13:374:28 | B.resolvedFile() | "tstSuffixB.ios.ts" | | tst.ts:374:15:374:26 | resolvedFile | () => "tstSuffixB.ios.ts" | -| tst.ts:379:8:379:11 | TS48 | typeof TS48 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:379:8:379:11 | TS48 | typeof TS48 in tst.ts | | tst.ts:383:22:383:35 | chooseRandomly | (x: T, y: T) => T | | tst.ts:383:40:383:40 | x | T | | tst.ts:383:46:383:46 | y | T | @@ -518,7 +518,7 @@ getExprType | tst.ts:385:56:385:56 | 0 | 0 | | tst.ts:385:59:385:63 | false | false | | tst.ts:385:66:385:71 | "bye!" | "bye!" | -| tst.ts:390:8:390:11 | TS49 | typeof TS49 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:390:8:390:11 | TS49 | typeof TS49 in tst.ts | | tst.ts:395:9:395:15 | palette | { red: [number, number, number]; green: string;... | | tst.ts:395:19:399:3 | {\\n r ... 5],\\n } | Record | | tst.ts:395:19:399:42 | {\\n r ... \| RGB> | { red: [number, number, number]; green: string;... | @@ -559,7 +559,7 @@ getExprType | tst.ts:423:7:423:22 | this.name = name | string | | tst.ts:423:12:423:15 | name | string | | tst.ts:423:19:423:22 | name | string | -| tst.ts:430:8:430:11 | TS50 | typeof TS50 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:430:8:430:11 | TS50 | typeof TS50 in tst.ts | | tst.ts:432:33:432:36 | args | Args | | tst.ts:433:68:433:71 | args | Args | | tst.ts:435:15:435:24 | methodName | string | @@ -632,7 +632,7 @@ getExprType | tst.ts:467:15:467:17 | foo | readonly ["a", "b", "c"] | | tst.ts:467:15:467:20 | foo[1] | "b" | | tst.ts:467:19:467:19 | 1 | 1 | -| tst.ts:472:8:472:11 | TS52 | typeof TS52 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:472:8:472:11 | TS52 | typeof TS52 in tst.ts | | tst.ts:473:11:473:19 | SomeClass | SomeClass | | tst.ts:474:10:474:36 | ((_targ ... => {}) | (_target: undefined, _context: ClassFieldDecora... | | tst.ts:474:11:474:35 | (_targe ... ) => {} | (_target: undefined, _context: ClassFieldDecora... | @@ -657,7 +657,7 @@ getExprType | tst.ts:483:17:483:58 | ["hello ... string> | [first: string, string] | | tst.ts:483:18:483:24 | "hello" | "hello" | | tst.ts:483:27:483:33 | "world" | "world" | -| tst.ts:486:8:486:11 | TS54 | typeof TS54 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:486:8:486:11 | TS54 | typeof TS54 in tst.ts | | tst.ts:487:48:487:53 | colors | C[] | | tst.ts:488:12:488:17 | colors | C[] | | tst.ts:488:12:488:20 | colors[0] | C | @@ -691,7 +691,7 @@ getExprType | tst.ts:494:24:494:24 | 0 | 0 | | tst.ts:494:28:494:33 | "even" | "even" | | tst.ts:494:36:494:40 | "odd" | "odd" | -| tst.ts:498:8:498:11 | TS55 | typeof TS55 in library-tests/TypeScript/Types/tst.ts | +| tst.ts:498:8:498:11 | TS55 | typeof TS55 in tst.ts | | tst.ts:499:9:499:15 | strings | string[] | | tst.ts:499:19:499:32 | (["foo", 123]) | (string \| number)[] | | tst.ts:499:19:500:11 | (["foo" ... .filter | { (predicate: (value... | @@ -779,18 +779,18 @@ getExprType | type_alias.ts:26:19:26:20 | id | string | | type_alias.ts:26:23:26:36 | "second-child" | "second-child" | | type_alias.ts:26:41:26:62 | "I'm th ... child" | "I'm the second child" | -| type_definition_objects.ts:1:13:1:17 | dummy | typeof library-tests/TypeScript/Types/dummy.ts | +| type_definition_objects.ts:1:13:1:17 | dummy | typeof dummy.ts | | type_definition_objects.ts:1:24:1:32 | "./dummy" | any | | type_definition_objects.ts:3:14:3:14 | C | C | -| type_definition_objects.ts:4:5:4:12 | classObj | typeof C in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definition_objects.ts:4:16:4:16 | C | typeof C in library-tests/TypeScript/Types/type_definition_objects.ts | +| type_definition_objects.ts:4:5:4:12 | classObj | typeof C in type_definition_objects.ts | +| type_definition_objects.ts:4:16:4:16 | C | typeof C in type_definition_objects.ts | | type_definition_objects.ts:6:13:6:13 | E | E | -| type_definition_objects.ts:7:5:7:11 | enumObj | typeof E in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definition_objects.ts:7:15:7:15 | E | typeof E in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definition_objects.ts:9:18:9:18 | N | typeof N in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definition_objects.ts:10:5:10:16 | namespaceObj | typeof N in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definition_objects.ts:10:20:10:20 | N | typeof N in library-tests/TypeScript/Types/type_definition_objects.ts | -| type_definitions.ts:1:13:1:17 | dummy | typeof library-tests/TypeScript/Types/dummy.ts | +| type_definition_objects.ts:7:5:7:11 | enumObj | typeof E in type_definition_objects.ts | +| type_definition_objects.ts:7:15:7:15 | E | typeof E in type_definition_objects.ts | +| type_definition_objects.ts:9:18:9:18 | N | typeof N in type_definition_objects.ts | +| type_definition_objects.ts:10:5:10:16 | namespaceObj | typeof N in type_definition_objects.ts | +| type_definition_objects.ts:10:20:10:20 | N | typeof N in type_definition_objects.ts | +| type_definitions.ts:1:13:1:17 | dummy | typeof dummy.ts | | type_definitions.ts:1:24:1:32 | "./dummy" | any | | type_definitions.ts:4:3:4:3 | x | S | | type_definitions.ts:6:5:6:5 | i | I | diff --git a/javascript/ql/test/query-tests/Metrics/ExternalDependencies/ExternalDependencies.expected b/javascript/ql/test/query-tests/Metrics/ExternalDependencies/ExternalDependencies.expected index d690d12e11b1..39b6d8ffcad8 100644 --- a/javascript/ql/test/query-tests/Metrics/ExternalDependencies/ExternalDependencies.expected +++ b/javascript/ql/test/query-tests/Metrics/ExternalDependencies/ExternalDependencies.expected @@ -1,9 +1,9 @@ -| /query-tests/Metrics/ExternalDependencies/src/tst.html<\|>jquery<\|>23.0.0 | 4 | -| /query-tests/Metrics/ExternalDependencies/src/a.js<\|>lib3<\|>unknown | 3 | -| /query-tests/Metrics/ExternalDependencies/src/tst.html<\|>jquery<\|>42.0.0 | 3 | -| /query-tests/Metrics/ExternalDependencies/src/a.js<\|>lib1<\|>1.0.2 | 2 | -| /query-tests/Metrics/ExternalDependencies/src/b.js<\|>lib3<\|>unknown | 2 | -| /query-tests/Metrics/ExternalDependencies/src/a.js<\|>lib2<\|>1.0.0 | 1 | -| /query-tests/Metrics/ExternalDependencies/src/b.js<\|>lib2<\|>1.0.0 | 1 | -| /query-tests/Metrics/ExternalDependencies/src/sub/c.js<\|>lib1<\|>1.0.2 | 1 | -| /query-tests/Metrics/ExternalDependencies/src/sub/subsub/d.js<\|>lib1<\|>1.0.3 | 1 | +| /src/tst.html<\|>jquery<\|>23.0.0 | 4 | +| /src/a.js<\|>lib3<\|>unknown | 3 | +| /src/tst.html<\|>jquery<\|>42.0.0 | 3 | +| /src/a.js<\|>lib1<\|>1.0.2 | 2 | +| /src/b.js<\|>lib3<\|>unknown | 2 | +| /src/a.js<\|>lib2<\|>1.0.0 | 1 | +| /src/b.js<\|>lib2<\|>1.0.0 | 1 | +| /src/sub/c.js<\|>lib1<\|>1.0.2 | 1 | +| /src/sub/subsub/d.js<\|>lib1<\|>1.0.3 | 1 | diff --git a/javascript/ql/test/query-tests/NodeJS/CyclicImport/CyclicImport.expected b/javascript/ql/test/query-tests/NodeJS/CyclicImport/CyclicImport.expected index c19bb2303441..2fb5f863389e 100644 --- a/javascript/ql/test/query-tests/NodeJS/CyclicImport/CyclicImport.expected +++ b/javascript/ql/test/query-tests/NodeJS/CyclicImport/CyclicImport.expected @@ -1,7 +1,7 @@ | a.js:4:9:4:25 | require('./b.js') | Module a imports module b, which in turn $@ it. | b.js:4:9:4:25 | require('./a.js') | imports | | b.js:4:9:4:25 | require('./a.js') | Module b imports module a, which in turn $@ it. | a.js:4:9:4:25 | require('./b.js') | imports | | selfimport.js:1:1:1:23 | require ... mport') | Module selfimport directly imports itself. | selfimport.js:1:1:1:24 | | | -| test1/a.js:1:1:1:27 | require ... ner/a') | Module .../test1/a.js imports module .../inner/a.js, which in turn $@ it. | test2/inner/a.js:1:1:1:24 | require ... st1/a') | imports | +| test1/a.js:1:1:1:27 | require ... ner/a') | Module /test1/a.js imports module .../inner/a.js, which in turn $@ it. | test2/inner/a.js:1:1:1:24 | require ... st1/a') | imports | | test1/a.js:2:1:2:14 | require('./b') | Module a imports module b, which in turn $@ it. | test1/b.js:1:1:1:27 | require ... ner/a') | indirectly imports | | test1/b.js:1:1:1:27 | require ... ner/a') | Module b imports module a, which in turn $@ it. | test2/inner/a.js:1:1:1:24 | require ... st1/a') | indirectly imports | -| test2/inner/a.js:1:1:1:24 | require ... st1/a') | Module .../inner/a.js imports module .../test1/a.js, which in turn $@ it. | test1/a.js:1:1:1:27 | require ... ner/a') | imports | +| test2/inner/a.js:1:1:1:24 | require ... st1/a') | Module .../inner/a.js imports module /test1/a.js, which in turn $@ it. | test1/a.js:1:1:1:27 | require ... ner/a') | imports | diff --git a/javascript/ql/test/query-tests/Security/CWE-200/PrivateFileExposure.expected b/javascript/ql/test/query-tests/Security/CWE-200/PrivateFileExposure.expected index 3cf199ce3714..39a5a884af13 100644 --- a/javascript/ql/test/query-tests/Security/CWE-200/PrivateFileExposure.expected +++ b/javascript/ql/test/query-tests/Security/CWE-200/PrivateFileExposure.expected @@ -1,6 +1,6 @@ -| lib/tst.js:7:1:7:45 | app.use ... rname)) | Serves the folder query-tests/Security/CWE-200/lib, which can contain private information. | -| lib/tst.js:9:1:9:43 | app.use ... otDir)) | Serves the folder query-tests/Security/CWE-200/lib, which can contain private information. | -| lib/tst.js:11:1:11:52 | app.use ... + '/')) | Serves the folder query-tests/Security/CWE-200/lib, which can contain private information. | +| lib/tst.js:7:1:7:45 | app.use ... rname)) | Serves the folder lib, which can contain private information. | +| lib/tst.js:9:1:9:43 | app.use ... otDir)) | Serves the folder lib, which can contain private information. | +| lib/tst.js:11:1:11:52 | app.use ... + '/')) | Serves the folder lib, which can contain private information. | | private-file-exposure.js:8:1:8:49 | app.use ... ular')) | Serves the folder "./node_modules/angular", which can contain private information. | | private-file-exposure.js:9:1:9:59 | app.use ... ular')) | Serves the folder "node_modules/angular", which can contain private information. | | private-file-exposure.js:10:1:10:67 | app.use ... mate')) | Serves the folder "node_modules/angular-animate", which can contain private information. | @@ -20,4 +20,4 @@ | private-file-exposure.js:43:1:43:46 | app.use ... )("/")) | Serves the root folder, which can contain private information. | | private-file-exposure.js:51:5:51:88 | app.use ... les'))) | Serves the folder "../node_modules", which can contain private information. | | private-file-exposure.js:70:5:70:71 | serveHa ... ular"}) | Serves the folder "./node_modules/angular", which can contain private information. | -| subfolder/private-file-exposure-2.js:6:1:6:34 | app.use ... rname)) | Serves the folder query-tests/Security/CWE-200/subfolder, which can contain private information. | +| subfolder/private-file-exposure-2.js:6:1:6:34 | app.use ... rname)) | Serves the folder subfolder, which can contain private information. | diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/tests.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/tests.expected index d9f7f8005021..bd22abd7c823 100644 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/tests.expected +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/tests.expected @@ -1,7 +1,5 @@ test_query1 -| | 0 | -| tutorials | 0 | -| tutorials/Introducing the JavaScript libraries | 2 | +| | 2 | test_query3 | tst.js:27:1:27:4 |