Merge branch 'main' into robertbrignull/data-modeled-method-signature
pick2db42e3ePull out createDataExtensionYamls into yaml.ts pick52f7cac0Move saveModeledMethods to a separate file pickba27230eMove loadModeledMethods to a separate file pickc512a11eSplit out listModelFiles from loadModeledMethods pick752cf8abAdd some tests of listModelFiles
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { DecodedBqrsChunk } from "../common/bqrs-cli-types";
|
||||
import { Call, ExternalApiUsage } from "./external-api-usage";
|
||||
import {
|
||||
Call,
|
||||
CallClassification,
|
||||
ExternalApiUsage,
|
||||
} from "./external-api-usage";
|
||||
import { ModeledMethodType } from "./modeled-method";
|
||||
|
||||
export function decodeBqrsToExternalApiUsages(
|
||||
chunk: DecodedBqrsChunk,
|
||||
@@ -11,6 +16,8 @@ export function decodeBqrsToExternalApiUsages(
|
||||
const signature = tuple[1] as string;
|
||||
const supported = (tuple[2] as string) === "true";
|
||||
const library = tuple[4] as string;
|
||||
const type = tuple[6] as ModeledMethodType;
|
||||
const classification = tuple[8] as CallClassification;
|
||||
|
||||
const [packageWithType, methodDeclaration] = signature.split("#");
|
||||
|
||||
@@ -39,12 +46,16 @@ export function decodeBqrsToExternalApiUsages(
|
||||
methodName,
|
||||
methodParameters,
|
||||
supported,
|
||||
supportedType: type,
|
||||
usages: [],
|
||||
});
|
||||
}
|
||||
|
||||
const method = methodsByApiName.get(signature)!;
|
||||
method.usages.push(usage);
|
||||
method.usages.push({
|
||||
...usage,
|
||||
classification,
|
||||
});
|
||||
});
|
||||
|
||||
return Array.from(methodsByApiName.values());
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
import { ResolvableLocationValue } from "../common/bqrs-cli-types";
|
||||
import { ModeledMethodType } from "./modeled-method";
|
||||
|
||||
export type Call = {
|
||||
label: string;
|
||||
url: ResolvableLocationValue;
|
||||
};
|
||||
|
||||
export enum CallClassification {
|
||||
Unknown = "unknown",
|
||||
Source = "source",
|
||||
Test = "test",
|
||||
Generated = "generated",
|
||||
}
|
||||
|
||||
export type Usage = Call & {
|
||||
classification: CallClassification;
|
||||
};
|
||||
|
||||
export interface MethodSignature {
|
||||
/**
|
||||
* A unique signature that can be used to identify this external API usage.
|
||||
@@ -33,5 +45,6 @@ export interface ExternalApiUsage extends MethodSignature {
|
||||
* If so, there is no need for the user to model it themselves.
|
||||
*/
|
||||
supported: boolean;
|
||||
usages: Call[];
|
||||
supportedType: ModeledMethodType;
|
||||
usages: Usage[];
|
||||
}
|
||||
|
||||
@@ -22,12 +22,16 @@ class ExternalApi extends CallableMethod {
|
||||
|
||||
private Call aUsage(ExternalApi api) { result.getTarget().getUnboundDeclaration() = api }
|
||||
|
||||
from ExternalApi api, string apiName, boolean supported, Call usage
|
||||
from
|
||||
ExternalApi api, string apiName, boolean supported, Call usage, string type, string classification
|
||||
where
|
||||
apiName = api.getApiName() and
|
||||
supported = isSupported(api) and
|
||||
usage = aUsage(api)
|
||||
select usage, apiName, supported.toString(), "supported", api.getFile().getBaseName(), "library"
|
||||
usage = aUsage(api) and
|
||||
type = supportedType(api) and
|
||||
classification = methodClassification(usage)
|
||||
select usage, apiName, supported.toString(), "supported", api.getFile().getBaseName(), "library",
|
||||
type, "type", classification, "classification"
|
||||
`,
|
||||
frameworkModeQuery: `/**
|
||||
* @name Public methods
|
||||
@@ -46,12 +50,13 @@ class PublicMethod extends CallableMethod {
|
||||
PublicMethod() { this.fromSource() and not this.getFile() instanceof TestFile }
|
||||
}
|
||||
|
||||
from PublicMethod publicMethod, string apiName, boolean supported
|
||||
from PublicMethod publicMethod, string apiName, boolean supported, string type
|
||||
where
|
||||
apiName = publicMethod.getApiName() and
|
||||
supported = isSupported(publicMethod)
|
||||
supported = isSupported(publicMethod) and
|
||||
type = supportedType(publicMethod)
|
||||
select publicMethod, apiName, supported.toString(), "supported",
|
||||
publicMethod.getFile().getBaseName(), "library"
|
||||
publicMethod.getFile().getBaseName(), "library", type, "type", "unknown", "classification"
|
||||
`,
|
||||
dependencies: {
|
||||
"AutomodelVsCode.qll": `/** Provides classes and predicates related to handling APIs for the VS Code extension. */
|
||||
@@ -66,6 +71,7 @@ private import semmle.code.csharp.dataflow.internal.DataFlowPrivate
|
||||
private import semmle.code.csharp.dataflow.internal.DataFlowDispatch as DataFlowDispatch
|
||||
private import semmle.code.csharp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
|
||||
private import semmle.code.csharp.dataflow.internal.TaintTrackingPrivate
|
||||
private import semmle.code.csharp.frameworks.Test
|
||||
private import semmle.code.csharp.security.dataflow.flowsources.Remote
|
||||
|
||||
pragma[nomagic]
|
||||
@@ -180,6 +186,25 @@ boolean isSupported(CallableMethod callableMethod) {
|
||||
result = false
|
||||
}
|
||||
|
||||
string supportedType(CallableMethod method) {
|
||||
method.isSink() and result = "sink"
|
||||
or
|
||||
method.isSource() and result = "source"
|
||||
or
|
||||
method.hasSummary() and result = "summary"
|
||||
or
|
||||
method.isNeutral() and result = "neutral"
|
||||
or
|
||||
not method.isSupported() and result = "none"
|
||||
}
|
||||
|
||||
string methodClassification(Call method) {
|
||||
method.getFile() instanceof TestFile and result = "test"
|
||||
or
|
||||
not method.getFile() instanceof TestFile and
|
||||
result = "source"
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the nested name of the declaration.
|
||||
*
|
||||
|
||||
@@ -16,17 +16,19 @@ class ExternalApi extends CallableMethod {
|
||||
ExternalApi() { not this.fromSource() }
|
||||
}
|
||||
|
||||
private Call aUsage(ExternalApi api) {
|
||||
result.getCallee().getSourceDeclaration() = api and
|
||||
not result.getFile() instanceof GeneratedFile
|
||||
}
|
||||
private Call aUsage(ExternalApi api) { result.getCallee().getSourceDeclaration() = api }
|
||||
|
||||
from ExternalApi externalApi, string apiName, boolean supported, Call usage
|
||||
from
|
||||
ExternalApi externalApi, string apiName, boolean supported, Call usage, string type,
|
||||
string classification
|
||||
where
|
||||
apiName = externalApi.getApiName() and
|
||||
supported = isSupported(externalApi) and
|
||||
usage = aUsage(externalApi)
|
||||
select usage, apiName, supported.toString(), "supported", externalApi.jarContainer(), "library"
|
||||
usage = aUsage(externalApi) and
|
||||
type = supportedType(externalApi) and
|
||||
classification = methodClassification(usage)
|
||||
select usage, apiName, supported.toString(), "supported", externalApi.jarContainer(), "library",
|
||||
type, "type", classification, "classification"
|
||||
`,
|
||||
frameworkModeQuery: `/**
|
||||
* @name Public methods
|
||||
@@ -41,12 +43,14 @@ import AutomodelVsCode
|
||||
|
||||
class PublicMethodFromSource extends CallableMethod, ModelApi { }
|
||||
|
||||
from PublicMethodFromSource publicMethod, string apiName, boolean supported
|
||||
from PublicMethodFromSource publicMethod, string apiName, boolean supported, string type
|
||||
where
|
||||
apiName = publicMethod.getApiName() and
|
||||
supported = isSupported(publicMethod)
|
||||
supported = isSupported(publicMethod) and
|
||||
type = supportedType(publicMethod)
|
||||
select publicMethod, apiName, supported.toString(), "supported",
|
||||
publicMethod.getCompilationUnit().getParentContainer().getBaseName(), "library"
|
||||
publicMethod.getCompilationUnit().getParentContainer().getBaseName(), "library", type, "type",
|
||||
"unknown", "classification"
|
||||
`,
|
||||
dependencies: {
|
||||
"AutomodelVsCode.qll": `/** Provides classes and predicates related to handling APIs for the VS Code extension. */
|
||||
@@ -147,6 +151,28 @@ boolean isSupported(CallableMethod method) {
|
||||
not method.isSupported() and result = false
|
||||
}
|
||||
|
||||
string supportedType(CallableMethod method) {
|
||||
method.isSink() and result = "sink"
|
||||
or
|
||||
method.isSource() and result = "source"
|
||||
or
|
||||
method.hasSummary() and result = "summary"
|
||||
or
|
||||
method.isNeutral() and result = "neutral"
|
||||
or
|
||||
not method.isSupported() and result = "none"
|
||||
}
|
||||
|
||||
string methodClassification(Call method) {
|
||||
isInTestFile(method.getLocation().getFile()) and result = "test"
|
||||
or
|
||||
method.getFile() instanceof GeneratedFile and result = "generated"
|
||||
or
|
||||
not isInTestFile(method.getLocation().getFile()) and
|
||||
not method.getFile() instanceof GeneratedFile and
|
||||
result = "source"
|
||||
}
|
||||
|
||||
// The below is a copy of https://github.com/github/codeql/blob/249f9f863db1e94e3c46ca85b49fb0ec32f8ca92/java/ql/lib/semmle/code/java/dataflow/internal/ModelExclusions.qll
|
||||
// to avoid the use of internal modules.
|
||||
/** Holds if the given package \`p\` is a test package. */
|
||||
|
||||
@@ -9,6 +9,10 @@ export type Query = {
|
||||
* - "supported": a string literal. This is required to make the query a valid problem query.
|
||||
* - libraryName: the name of the library that contains the external API. This is a string and usually the basename of a file.
|
||||
* - "library": a string literal. This is required to make the query a valid problem query.
|
||||
* - type: the modeled kind of the method, either "sink", "source", "summary", or "neutral"
|
||||
* - "type": a string literal. This is required to make the query a valid problem query.
|
||||
* - classification: the classification of the use of the method, either "source", "test", "generated", or "unknown"
|
||||
* - "classification: a string literal. This is required to make the query a valid problem query.
|
||||
*/
|
||||
applicationModeQuery: string;
|
||||
/**
|
||||
@@ -22,6 +26,10 @@ export type Query = {
|
||||
* - "supported": a string literal. This is required to make the query a valid problem query.
|
||||
* - libraryName: an arbitrary string. This is required to make it match the structure of the application query.
|
||||
* - "library": a string literal. This is required to make the query a valid problem query.
|
||||
* - type: the modeled kind of the method, either "sink", "source", "summary", or "neutral"
|
||||
* - "type": a string literal. This is required to make the query a valid problem query.
|
||||
* - "unknown": a string literal. This is required to make it match the structure of the application query.
|
||||
* - "classification: a string literal. This is required to make the query a valid problem query.
|
||||
*/
|
||||
frameworkModeQuery: string;
|
||||
dependencies?: {
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
|
||||
import { Mode } from "../../data-extensions-editor/shared/mode";
|
||||
import { DataExtensionsEditor as DataExtensionsEditorComponent } from "../../view/data-extensions-editor/DataExtensionsEditor";
|
||||
import { CallClassification } from "../../data-extensions-editor/external-api-usage";
|
||||
|
||||
export default {
|
||||
title: "Data Extensions Editor/Data Extensions Editor",
|
||||
@@ -39,6 +40,7 @@ DataExtensionsEditor.args = {
|
||||
methodName: "createQuery",
|
||||
methodParameters: "(String)",
|
||||
supported: true,
|
||||
supportedType: "summary",
|
||||
usages: Array(10).fill({
|
||||
label: "createQuery(...)",
|
||||
url: {
|
||||
@@ -48,6 +50,7 @@ DataExtensionsEditor.args = {
|
||||
endLine: 15,
|
||||
endColumn: 56,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -58,6 +61,7 @@ DataExtensionsEditor.args = {
|
||||
methodName: "executeScalar",
|
||||
methodParameters: "(Class)",
|
||||
supported: true,
|
||||
supportedType: "neutral",
|
||||
usages: Array(2).fill({
|
||||
label: "executeScalar(...)",
|
||||
url: {
|
||||
@@ -67,6 +71,7 @@ DataExtensionsEditor.args = {
|
||||
endLine: 15,
|
||||
endColumn: 85,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -77,6 +82,7 @@ DataExtensionsEditor.args = {
|
||||
methodName: "open",
|
||||
methodParameters: "()",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: Array(28).fill({
|
||||
label: "open(...)",
|
||||
url: {
|
||||
@@ -86,6 +92,7 @@ DataExtensionsEditor.args = {
|
||||
endLine: 14,
|
||||
endColumn: 35,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -96,6 +103,7 @@ DataExtensionsEditor.args = {
|
||||
methodName: "println",
|
||||
methodParameters: "(String)",
|
||||
supported: true,
|
||||
supportedType: "summary",
|
||||
usages: [
|
||||
{
|
||||
label: "println(...)",
|
||||
@@ -106,6 +114,18 @@ DataExtensionsEditor.args = {
|
||||
endLine: 29,
|
||||
endColumn: 49,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
{
|
||||
label: "println(...)",
|
||||
url: {
|
||||
uri: "file:/home/runner/work/sql2o-example/sql2o-example/src/test/java/org/example/HelloControllerTest.java",
|
||||
startLine: 29,
|
||||
startColumn: 9,
|
||||
endLine: 29,
|
||||
endColumn: 49,
|
||||
},
|
||||
classification: CallClassification.Test,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -118,6 +138,7 @@ DataExtensionsEditor.args = {
|
||||
methodName: "run",
|
||||
methodParameters: "(Class,String[])",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: Array(7).fill({
|
||||
label: "run(...)",
|
||||
url: {
|
||||
@@ -127,6 +148,7 @@ DataExtensionsEditor.args = {
|
||||
endLine: 9,
|
||||
endColumn: 66,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -137,6 +159,7 @@ DataExtensionsEditor.args = {
|
||||
methodName: "Sql2o",
|
||||
methodParameters: "(String,String,String)",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: Array(106).fill({
|
||||
label: "new Sql2o(...)",
|
||||
url: {
|
||||
@@ -145,6 +168,7 @@ DataExtensionsEditor.args = {
|
||||
startColumn: 33,
|
||||
endLine: 10,
|
||||
endColumn: 88,
|
||||
classification: CallClassification.Test,
|
||||
},
|
||||
}),
|
||||
},
|
||||
@@ -156,16 +180,31 @@ DataExtensionsEditor.args = {
|
||||
methodName: "Sql2o",
|
||||
methodParameters: "(String)",
|
||||
supported: false,
|
||||
usages: Array(4).fill({
|
||||
label: "new Sql2o(...)",
|
||||
url: {
|
||||
uri: "file:/home/runner/work/sql2o-example/sql2o-example/src/main/java/org/example/HelloController.java",
|
||||
startLine: 23,
|
||||
startColumn: 23,
|
||||
endLine: 23,
|
||||
endColumn: 36,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
...Array(4).fill({
|
||||
label: "new Sql2o(...)",
|
||||
url: {
|
||||
uri: "file:/home/runner/work/sql2o-example/sql2o-example/src/main/java/org/example/HelloController.java",
|
||||
startLine: 23,
|
||||
startColumn: 23,
|
||||
endLine: 23,
|
||||
endColumn: 36,
|
||||
},
|
||||
classification: CallClassification.Test,
|
||||
}),
|
||||
{
|
||||
label: "new Sql2o(...)",
|
||||
url: {
|
||||
uri: "file:/home/runner/work/sql2o-example/sql2o-example/build/generated/java/org/example/HelloControllerGenerated.java",
|
||||
startLine: 23,
|
||||
startColumn: 23,
|
||||
endLine: 23,
|
||||
endColumn: 36,
|
||||
},
|
||||
classification: CallClassification.Generated,
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
],
|
||||
initialModeledMethods: {
|
||||
|
||||
@@ -3,6 +3,7 @@ import * as React from "react";
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
|
||||
import { MethodRow as MethodRowComponent } from "../../view/data-extensions-editor/MethodRow";
|
||||
import { CallClassification } from "../../data-extensions-editor/external-api-usage";
|
||||
|
||||
export default {
|
||||
title: "Data Extensions Editor/Method Row",
|
||||
@@ -23,6 +24,7 @@ MethodRow.args = {
|
||||
methodName: "open",
|
||||
methodParameters: "()",
|
||||
supported: true,
|
||||
supportedType: "summary",
|
||||
usages: [
|
||||
{
|
||||
label: "open(...)",
|
||||
@@ -33,6 +35,7 @@ MethodRow.args = {
|
||||
endLine: 14,
|
||||
endColumn: 35,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
{
|
||||
label: "open(...)",
|
||||
@@ -43,6 +46,7 @@ MethodRow.args = {
|
||||
endLine: 25,
|
||||
endColumn: 35,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
import * as React from "react";
|
||||
import { useMemo } from "react";
|
||||
import {
|
||||
CallClassification,
|
||||
ExternalApiUsage,
|
||||
} from "../../data-extensions-editor/external-api-usage";
|
||||
import { VSCodeTag } from "@vscode/webview-ui-toolkit/react";
|
||||
import styled from "styled-components";
|
||||
|
||||
const ClassificationsContainer = styled.div`
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
gap: 0.5rem;
|
||||
`;
|
||||
|
||||
const ClassificationTag = styled(VSCodeTag)`
|
||||
font-size: 0.75em;
|
||||
`;
|
||||
|
||||
type Props = {
|
||||
externalApiUsage: ExternalApiUsage;
|
||||
};
|
||||
|
||||
export const MethodClassifications = ({ externalApiUsage }: Props) => {
|
||||
const allUsageClassifications = useMemo(
|
||||
() =>
|
||||
new Set(
|
||||
externalApiUsage.usages.map((usage) => {
|
||||
return usage.classification;
|
||||
}),
|
||||
),
|
||||
[externalApiUsage.usages],
|
||||
);
|
||||
|
||||
const inSource = allUsageClassifications.has(CallClassification.Source);
|
||||
const inTest = allUsageClassifications.has(CallClassification.Test);
|
||||
const inGenerated = allUsageClassifications.has(CallClassification.Generated);
|
||||
|
||||
const tooltip = useMemo(() => {
|
||||
if (inTest && inGenerated) {
|
||||
return "This method is only used from test and generated code";
|
||||
}
|
||||
if (inTest) {
|
||||
return "This method is only used from test code";
|
||||
}
|
||||
if (inGenerated) {
|
||||
return "This method is only used from generated code";
|
||||
}
|
||||
return "";
|
||||
}, [inTest, inGenerated]);
|
||||
|
||||
if (inSource) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<ClassificationsContainer title={tooltip}>
|
||||
{inTest && <ClassificationTag>Test</ClassificationTag>}
|
||||
{inGenerated && <ClassificationTag>Generated</ClassificationTag>}
|
||||
</ClassificationsContainer>
|
||||
);
|
||||
};
|
||||
@@ -19,6 +19,7 @@ import { KindInput } from "./KindInput";
|
||||
import { extensiblePredicateDefinitions } from "../../data-extensions-editor/predicates";
|
||||
import { Mode } from "../../data-extensions-editor/shared/mode";
|
||||
import { Dropdown } from "../common/Dropdown";
|
||||
import { MethodClassifications } from "./MethodClassifications";
|
||||
|
||||
const ApiOrMethodCell = styled(VSCodeDataGridCell)`
|
||||
display: flex;
|
||||
@@ -39,7 +40,7 @@ const ViewLink = styled(VSCodeLink)`
|
||||
white-space: nowrap;
|
||||
`;
|
||||
|
||||
const modelTypeOptions = [
|
||||
const modelTypeOptions: Array<{ value: ModeledMethodType; label: string }> = [
|
||||
{ value: "none", label: "Unmodeled" },
|
||||
{ value: "source", label: "Source" },
|
||||
{ value: "sink", label: "Sink" },
|
||||
@@ -202,6 +203,7 @@ function ModelableMethodRow(props: Props) {
|
||||
</UsagesButton>
|
||||
)}
|
||||
<ViewLink onClick={jumpToUsage}>View</ViewLink>
|
||||
<MethodClassifications externalApiUsage={externalApiUsage} />
|
||||
</ApiOrMethodCell>
|
||||
<VSCodeDataGridCell gridColumn={2}>
|
||||
<Dropdown
|
||||
@@ -238,10 +240,7 @@ function ModelableMethodRow(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
function UnmodelableMethodRow(props: {
|
||||
externalApiUsage: ExternalApiUsage;
|
||||
mode: Mode;
|
||||
}) {
|
||||
function UnmodelableMethodRow(props: Props) {
|
||||
const { externalApiUsage, mode } = props;
|
||||
|
||||
const jumpToUsage = useCallback(
|
||||
@@ -260,9 +259,10 @@ function UnmodelableMethodRow(props: {
|
||||
</UsagesButton>
|
||||
)}
|
||||
<ViewLink onClick={jumpToUsage}>View</ViewLink>
|
||||
<MethodClassifications externalApiUsage={externalApiUsage} />
|
||||
</ApiOrMethodCell>
|
||||
<VSCodeDataGridCell gridColumn="span 4">
|
||||
Method already modeled by CodeQL or a different extension pack
|
||||
Method modeled by CodeQL or a different extension pack
|
||||
</VSCodeDataGridCell>
|
||||
</VSCodeDataGridRow>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
[
|
||||
"v2.14.0",
|
||||
"v2.13.5",
|
||||
"v2.12.7",
|
||||
"v2.11.6",
|
||||
|
||||
@@ -3,7 +3,10 @@ import {
|
||||
createAutoModelRequest,
|
||||
parsePredictedClassifications,
|
||||
} from "../../../src/data-extensions-editor/auto-model";
|
||||
import { ExternalApiUsage } from "../../../src/data-extensions-editor/external-api-usage";
|
||||
import {
|
||||
CallClassification,
|
||||
ExternalApiUsage,
|
||||
} from "../../../src/data-extensions-editor/external-api-usage";
|
||||
import { ModeledMethod } from "../../../src/data-extensions-editor/modeled-method";
|
||||
import {
|
||||
ClassificationType,
|
||||
@@ -22,6 +25,7 @@ describe("createAutoModelRequest", () => {
|
||||
methodName: "run",
|
||||
methodParameters: "(Class,String[])",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
{
|
||||
label: "run(...)",
|
||||
@@ -32,6 +36,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 9,
|
||||
endColumn: 66,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -43,6 +48,7 @@ describe("createAutoModelRequest", () => {
|
||||
methodName: "createQuery",
|
||||
methodParameters: "(String)",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
{
|
||||
label: "createQuery(...)",
|
||||
@@ -53,6 +59,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 15,
|
||||
endColumn: 56,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
{
|
||||
label: "createQuery(...)",
|
||||
@@ -63,6 +70,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 26,
|
||||
endColumn: 39,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -74,6 +82,7 @@ describe("createAutoModelRequest", () => {
|
||||
methodName: "executeScalar",
|
||||
methodParameters: "(Class)",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
{
|
||||
label: "executeScalar(...)",
|
||||
@@ -84,6 +93,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 15,
|
||||
endColumn: 85,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
{
|
||||
label: "executeScalar(...)",
|
||||
@@ -94,6 +104,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 26,
|
||||
endColumn: 68,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -105,6 +116,7 @@ describe("createAutoModelRequest", () => {
|
||||
methodName: "open",
|
||||
methodParameters: "()",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
{
|
||||
label: "open(...)",
|
||||
@@ -115,6 +127,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 14,
|
||||
endColumn: 35,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
{
|
||||
label: "open(...)",
|
||||
@@ -125,6 +138,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 25,
|
||||
endColumn: 35,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -136,6 +150,7 @@ describe("createAutoModelRequest", () => {
|
||||
methodName: "println",
|
||||
methodParameters: "(String)",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
{
|
||||
label: "println(...)",
|
||||
@@ -146,6 +161,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 29,
|
||||
endColumn: 49,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -157,6 +173,7 @@ describe("createAutoModelRequest", () => {
|
||||
methodName: "Sql2o",
|
||||
methodParameters: "(String,String,String)",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
{
|
||||
label: "new Sql2o(...)",
|
||||
@@ -167,6 +184,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 10,
|
||||
endColumn: 88,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -178,6 +196,7 @@ describe("createAutoModelRequest", () => {
|
||||
methodName: "Sql2o",
|
||||
methodParameters: "(String)",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
{
|
||||
label: "new Sql2o(...)",
|
||||
@@ -188,6 +207,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 23,
|
||||
endColumn: 36,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -199,6 +219,7 @@ describe("createAutoModelRequest", () => {
|
||||
methodName: "test",
|
||||
methodParameters: "()",
|
||||
supported: true,
|
||||
supportedType: "neutral",
|
||||
usages: [
|
||||
{
|
||||
label: "abc.test(...)",
|
||||
@@ -209,6 +230,7 @@ describe("createAutoModelRequest", () => {
|
||||
endLine: 23,
|
||||
endColumn: 36,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
createFilenameForLibrary,
|
||||
loadDataExtensionYaml,
|
||||
} from "../../../src/data-extensions-editor/yaml";
|
||||
import { CallClassification } from "../../../src/data-extensions-editor/external-api-usage";
|
||||
|
||||
describe("createDataExtensionYaml", () => {
|
||||
it("creates the correct YAML file", () => {
|
||||
@@ -87,6 +88,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
methodName: "createQuery",
|
||||
methodParameters: "(String)",
|
||||
supported: true,
|
||||
supportedType: "sink",
|
||||
usages: [
|
||||
{
|
||||
label: "createQuery(...)",
|
||||
@@ -97,6 +99,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
endLine: 15,
|
||||
endColumn: 56,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
{
|
||||
label: "createQuery(...)",
|
||||
@@ -107,6 +110,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
endLine: 26,
|
||||
endColumn: 39,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -118,6 +122,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
methodName: "executeScalar",
|
||||
methodParameters: "(Class)",
|
||||
supported: true,
|
||||
supportedType: "neutral",
|
||||
usages: [
|
||||
{
|
||||
label: "executeScalar(...)",
|
||||
@@ -128,6 +133,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
endLine: 15,
|
||||
endColumn: 85,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
{
|
||||
label: "executeScalar(...)",
|
||||
@@ -138,6 +144,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
endLine: 26,
|
||||
endColumn: 68,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -149,6 +156,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
methodName: "Sql2o",
|
||||
methodParameters: "(String,String,String)",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
{
|
||||
label: "new Sql2o(...)",
|
||||
@@ -159,6 +167,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
endLine: 10,
|
||||
endColumn: 88,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -171,6 +180,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
methodName: "run",
|
||||
methodParameters: "(Class,String[])",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
{
|
||||
label: "run(...)",
|
||||
@@ -181,6 +191,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
endLine: 9,
|
||||
endColumn: 66,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -192,6 +203,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
methodName: "println",
|
||||
methodParameters: "(String)",
|
||||
supported: true,
|
||||
supportedType: "summary",
|
||||
usages: [
|
||||
{
|
||||
label: "println(...)",
|
||||
@@ -202,6 +214,7 @@ describe("createDataExtensionYamlsForApplicationMode", () => {
|
||||
endLine: 29,
|
||||
endColumn: 49,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -311,6 +324,7 @@ describe("createDataExtensionYamlsForFrameworkMode", () => {
|
||||
methodName: "createQuery",
|
||||
methodParameters: "(String)",
|
||||
supported: true,
|
||||
supportedType: "sink",
|
||||
usages: [
|
||||
{
|
||||
label: "createQuery(...)",
|
||||
@@ -321,6 +335,7 @@ describe("createDataExtensionYamlsForFrameworkMode", () => {
|
||||
endLine: 15,
|
||||
endColumn: 56,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
{
|
||||
label: "createQuery(...)",
|
||||
@@ -331,6 +346,7 @@ describe("createDataExtensionYamlsForFrameworkMode", () => {
|
||||
endLine: 26,
|
||||
endColumn: 39,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -342,6 +358,7 @@ describe("createDataExtensionYamlsForFrameworkMode", () => {
|
||||
methodName: "executeScalar",
|
||||
methodParameters: "(Class)",
|
||||
supported: true,
|
||||
supportedType: "neutral",
|
||||
usages: [
|
||||
{
|
||||
label: "executeScalar(...)",
|
||||
@@ -352,6 +369,7 @@ describe("createDataExtensionYamlsForFrameworkMode", () => {
|
||||
endLine: 15,
|
||||
endColumn: 85,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
{
|
||||
label: "executeScalar(...)",
|
||||
@@ -362,6 +380,7 @@ describe("createDataExtensionYamlsForFrameworkMode", () => {
|
||||
endLine: 26,
|
||||
endColumn: 68,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -373,6 +392,7 @@ describe("createDataExtensionYamlsForFrameworkMode", () => {
|
||||
methodName: "Sql2o",
|
||||
methodParameters: "(String,String,String)",
|
||||
supported: false,
|
||||
supportedType: "none",
|
||||
usages: [
|
||||
{
|
||||
label: "new Sql2o(...)",
|
||||
@@ -383,6 +403,7 @@ describe("createDataExtensionYamlsForFrameworkMode", () => {
|
||||
endLine: 10,
|
||||
endColumn: 88,
|
||||
},
|
||||
classification: CallClassification.Source,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user