mirror of
https://github.com/github/codeql.git
synced 2026-04-23 15:55:18 +02:00
Merge pull request #5385 from github/igfoo/failed_extractions
C++: Add FailedExtractions.ql
This commit is contained in:
2
cpp/change-notes/2021-03-11-failed-extractions.md
Normal file
2
cpp/change-notes/2021-03-11-failed-extractions.md
Normal file
@@ -0,0 +1,2 @@
|
||||
codescanning
|
||||
* Added cpp/diagnostics/failed-extractions. This query gives information about which extractions did not run to completion.
|
||||
22
cpp/ql/src/Diagnostics/FailedExtractions.ql
Normal file
22
cpp/ql/src/Diagnostics/FailedExtractions.ql
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @name Failed extractions
|
||||
* @description Gives the command-line of compilations for which extraction did not run to completion.
|
||||
* @kind diagnostic
|
||||
* @id cpp/diagnostics/failed-extractions
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
class AnonymousCompilation extends Compilation {
|
||||
override string toString() { result = "<compilation>" }
|
||||
}
|
||||
|
||||
string describe(Compilation c) {
|
||||
if c.getArgument(1) = "--mimic"
|
||||
then result = "compiler invocation " + concat(int i | i > 1 | c.getArgument(i), " " order by i)
|
||||
else result = "extractor invocation " + concat(int i | | c.getArgument(i), " " order by i)
|
||||
}
|
||||
|
||||
from Compilation c
|
||||
where not c.normalTermination()
|
||||
select c, "Extraction failed for " + describe(c), 2
|
||||
Reference in New Issue
Block a user