|
| 1 | +/** |
| 2 | + * @name Consistency predicate that should be empty |
| 3 | + * @description This query should have no results on the CodeQL repos. |
| 4 | + * It's marked as a warning query to make the results visible. |
| 5 | + * @kind problem |
| 6 | + * @problem.severity warning |
| 7 | + * @precision very-high |
| 8 | + * @id ql/diagnostics/empty-consitencies |
| 9 | + */ |
| 10 | + |
| 11 | +import ql |
| 12 | +import codeql_ql.ast.internal.Predicate::PredConsistency as PredConsistency |
| 13 | +import codeql_ql.ast.internal.Type::TyConsistency as TypeConsistency |
| 14 | +import codeql_ql.ast.internal.Builtins::BuildinsConsistency as BuildinsConsistency |
| 15 | +import codeql_ql.ast.internal.Module::ModConsistency as ModConsistency |
| 16 | +import codeql_ql.ast.internal.Variable::VarConsistency as VarConsistency |
| 17 | + |
| 18 | +from AstNode node, string msg |
| 19 | +where |
| 20 | + PredConsistency::noResolveCall(node) and msg = "PredConsistency::noResolveCall" |
| 21 | + or |
| 22 | + TypeConsistency::noResolve(node) and msg = "TypeConsistency::noResolve" |
| 23 | + or |
| 24 | + TypeConsistency::exprNoType(node) and msg = "TypeConsistency::exprNoType" |
| 25 | + or |
| 26 | + TypeConsistency::varDefNoType(node) and msg = "TypeConsistency::varDefNoType" |
| 27 | + or |
| 28 | + //or // has 1 result, but the CodeQL compiler also can't figure out that one. I suppoed the file is never imported. |
| 29 | + //TypeConsistency::noResolve(node) and msg = "TypeConsistency::noResolve" |
| 30 | + //or // has 1 result, but the CodeQL compiler also can't figure out that one. Same file as above. |
| 31 | + //ModConsistency::noResolve(node) and msg = "ModConsistency::noResolve" |
| 32 | + ModConsistency::noResolveModuleExpr(node) and msg = "ModConsistency::noResolveModuleExpr" |
| 33 | + or |
| 34 | + VarConsistency::noFieldDef(node) and msg = "VarConsistency::noFieldDef" |
| 35 | + or |
| 36 | + VarConsistency::noVarDef(node) and msg = "VarConsistency::noVarDef" |
| 37 | +select node, msg |
0 commit comments