Merge pull request #12634 from github/redsun82/swift-successuful-extractions

Swift: add a query showing successfully extracted files
This commit is contained in:
Paolo Tranquilli
2023-03-23 12:52:13 +01:00
committed by GitHub
7 changed files with 24 additions and 2 deletions

View File

@@ -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

View File

@@ -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

View 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."

View File

@@ -0,0 +1 @@
| main.swift:0:0:0:0 | main.swift | File successfully extracted. |

View File

@@ -0,0 +1 @@
diagnostics/SuccessfullyExtractedFiles.ql

View File

@@ -0,0 +1,2 @@
//codeql-extractor-expected-status: 1
#error("Uh oh")