Merge pull request #5385 from github/igfoo/failed_extractions

C++: Add FailedExtractions.ql
This commit is contained in:
Cornelius Riemenschneider
2021-03-12 11:14:06 +01:00
committed by GitHub
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
codescanning
* Added cpp/diagnostics/failed-extractions. This query gives information about which extractions did not run to completion.

View 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