mirror of
https://github.com/github/codeql.git
synced 2026-02-05 09:41:10 +01:00
Merge pull request #12634 from github/redsun82/swift-successuful-extractions
Swift: add a query showing successfully extracted files
This commit is contained in:
@@ -37,7 +37,8 @@ module RemoteUserInputOverflow = TaintTracking::Make<RemoteUserInputOverflowConf
|
||||
module RemoteUserInputUnderflow = TaintTracking::Make<RemoteUserInputUnderflowConfig>;
|
||||
|
||||
module Flow =
|
||||
DataFlow::MergePathGraph<RemoteUserInputOverflow::PathNode, RemoteUserInputUnderflow::PathNode, RemoteUserInputOverflow::PathGraph, RemoteUserInputUnderflow::PathGraph>;
|
||||
DataFlow::MergePathGraph<RemoteUserInputOverflow::PathNode, RemoteUserInputUnderflow::PathNode,
|
||||
RemoteUserInputOverflow::PathGraph, RemoteUserInputUnderflow::PathGraph>;
|
||||
|
||||
import Flow::PathGraph
|
||||
|
||||
|
||||
@@ -261,7 +261,9 @@ module InsecureMethodPathGraph implements DataFlow::PathGraphSig<MethodAccessIns
|
||||
}
|
||||
|
||||
module Flow =
|
||||
DataFlow::MergePathGraph<TempDirSystemGetPropertyToCreate::PathNode, MethodAccessInsecureFileCreation, TempDirSystemGetPropertyToCreate::PathGraph, InsecureMethodPathGraph>;
|
||||
DataFlow::MergePathGraph<TempDirSystemGetPropertyToCreate::PathNode,
|
||||
MethodAccessInsecureFileCreation, TempDirSystemGetPropertyToCreate::PathGraph,
|
||||
InsecureMethodPathGraph>;
|
||||
|
||||
import Flow::PathGraph
|
||||
|
||||
|
||||
15
swift/ql/src/diagnostics/SuccessfullyExtractedFiles.ql
Normal file
15
swift/ql/src/diagnostics/SuccessfullyExtractedFiles.ql
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @name Successfully extracted files
|
||||
* @description Lists all files in the source code directory that were extracted without encountering a problem in the file.
|
||||
* @kind diagnostic
|
||||
* @id swift/diagnostics/successfully-extracted-files
|
||||
* @tags successfully-extracted-files
|
||||
*/
|
||||
|
||||
import swift
|
||||
|
||||
from File f
|
||||
where
|
||||
not exists(CompilerError e | e.getFile() = f) and
|
||||
f.getBaseName().regexpMatch(".*\\.swift\\z")
|
||||
select f, "File successfully extracted."
|
||||
@@ -0,0 +1 @@
|
||||
| main.swift:0:0:0:0 | main.swift | File successfully extracted. |
|
||||
@@ -0,0 +1 @@
|
||||
diagnostics/SuccessfullyExtractedFiles.ql
|
||||
2
swift/ql/test/query-tests/Diagnostics/error.swift
Normal file
2
swift/ql/test/query-tests/Diagnostics/error.swift
Normal file
@@ -0,0 +1,2 @@
|
||||
//codeql-extractor-expected-status: 1
|
||||
#error("Uh oh")
|
||||
0
swift/ql/test/query-tests/Diagnostics/main.swift
Normal file
0
swift/ql/test/query-tests/Diagnostics/main.swift
Normal file
Reference in New Issue
Block a user