From 2b915b82e4e532b81b72da789b2f3792af5a8522 Mon Sep 17 00:00:00 2001 From: Koen Vlaswinkel Date: Thu, 1 Jun 2023 14:59:47 +0200 Subject: [PATCH] Fix neutral definition for CodeQL 2.13.3 In CodeQL 2.13.3, the definition of the neutralModel predicate has changed to include the `kind`. This updates the definition of the data extensions editor to match the new definition. One caveat is that when selecting a `kind` other than `summary`, the method will not be shown as supported. This is because a `NeutralCallable` only calls into `neutralSummaryElement`. This matches the previous behavior because setting the `kind` to `source` or `sink` only says that the method is either not a source or not a sink, but not both. Only `summary` fully models the method. See: https://github.com/github/codeql/pull/12931 See: https://github.com/github/codeql/blob/ff78ac98d27c7b9f1adffcf235c56855f8348ad0/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll#L338 See: https://github.com/github/codeql/blob/ff78ac98d27c7b9f1adffcf235c56855f8348ad0/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImplSpecific.qll#L160 --- .../ql-vscode/src/data-extensions-editor/predicates.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/ql-vscode/src/data-extensions-editor/predicates.ts b/extensions/ql-vscode/src/data-extensions-editor/predicates.ts index f521151636d..65a728173e1 100644 --- a/extensions/ql-vscode/src/data-extensions-editor/predicates.ts +++ b/extensions/ql-vscode/src/data-extensions-editor/predicates.ts @@ -116,13 +116,14 @@ export const extensiblePredicateDefinitions: Record< neutral: { extensiblePredicate: "neutralModel", // extensible predicate neutralModel( - // string package, string type, string name, string signature, string provenance + // string package, string type, string name, string signature, string kind, string provenance // ); generateMethodDefinition: (method) => [ method.externalApiUsage.packageName, method.externalApiUsage.typeName, method.externalApiUsage.methodName, method.externalApiUsage.methodParameters, + method.modeledMethod.kind, "manual", ], readModeledMethod: (row) => ({ @@ -131,8 +132,9 @@ export const extensiblePredicateDefinitions: Record< type: "neutral", input: "", output: "", - kind: "", + kind: row[4] as string, }, }), + supportedKinds: ["summary", "source", "sink"], }, };