Skip to content

Commit 2b915b8

Browse files
committed
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: github/codeql#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
1 parent 2f61cfe commit 2b915b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

extensions/ql-vscode/src/data-extensions-editor/predicates.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,14 @@ export const extensiblePredicateDefinitions: Record<
116116
neutral: {
117117
extensiblePredicate: "neutralModel",
118118
// extensible predicate neutralModel(
119-
// string package, string type, string name, string signature, string provenance
119+
// string package, string type, string name, string signature, string kind, string provenance
120120
// );
121121
generateMethodDefinition: (method) => [
122122
method.externalApiUsage.packageName,
123123
method.externalApiUsage.typeName,
124124
method.externalApiUsage.methodName,
125125
method.externalApiUsage.methodParameters,
126+
method.modeledMethod.kind,
126127
"manual",
127128
],
128129
readModeledMethod: (row) => ({
@@ -131,8 +132,9 @@ export const extensiblePredicateDefinitions: Record<
131132
type: "neutral",
132133
input: "",
133134
output: "",
134-
kind: "",
135+
kind: row[4] as string,
135136
},
136137
}),
138+
supportedKinds: ["summary", "source", "sink"],
137139
},
138140
};

0 commit comments

Comments
 (0)