1- import {
2- ModeledMethod ,
3- ModeledMethodType ,
4- ModeledMethodWithSignature ,
5- Provenance ,
6- } from "./modeled-method" ;
1+ import { ModeledMethod , ModeledMethodType , Provenance } from "./modeled-method" ;
72
83export type ExtensiblePredicateDefinition = {
94 extensiblePredicate : string ;
105 generateMethodDefinition : ( method : ModeledMethod ) => Tuple [ ] ;
11- readModeledMethod : ( row : Tuple [ ] ) => ModeledMethodWithSignature ;
6+ readModeledMethod : ( row : Tuple [ ] ) => ModeledMethod ;
127
138 supportedKinds ?: string [ ] ;
149} ;
@@ -40,24 +35,18 @@ export const extensiblePredicateDefinitions: Record<
4035 method . kind ,
4136 method . provenance ,
4237 ] ,
43- readModeledMethod : ( row ) => {
44- const signature = readRowToMethod ( row ) ;
45- return {
46- signature,
47- modeledMethod : {
48- type : "source" ,
49- input : "" ,
50- output : row [ 6 ] as string ,
51- kind : row [ 7 ] as string ,
52- provenance : row [ 8 ] as Provenance ,
53- signature,
54- packageName : row [ 0 ] as string ,
55- typeName : row [ 1 ] as string ,
56- methodName : row [ 3 ] as string ,
57- methodParameters : row [ 4 ] as string ,
58- } ,
59- } ;
60- } ,
38+ readModeledMethod : ( row ) => ( {
39+ type : "source" ,
40+ input : "" ,
41+ output : row [ 6 ] as string ,
42+ kind : row [ 7 ] as string ,
43+ provenance : row [ 8 ] as Provenance ,
44+ signature : readRowToMethod ( row ) ,
45+ packageName : row [ 0 ] as string ,
46+ typeName : row [ 1 ] as string ,
47+ methodName : row [ 3 ] as string ,
48+ methodParameters : row [ 4 ] as string ,
49+ } ) ,
6150 supportedKinds : [ "remote" ] ,
6251 } ,
6352 sink : {
@@ -77,24 +66,18 @@ export const extensiblePredicateDefinitions: Record<
7766 method . kind ,
7867 method . provenance ,
7968 ] ,
80- readModeledMethod : ( row ) => {
81- const signature = readRowToMethod ( row ) ;
82- return {
83- signature,
84- modeledMethod : {
85- type : "sink" ,
86- input : row [ 6 ] as string ,
87- output : "" ,
88- kind : row [ 7 ] as string ,
89- provenance : row [ 8 ] as Provenance ,
90- signature,
91- packageName : row [ 0 ] as string ,
92- typeName : row [ 1 ] as string ,
93- methodName : row [ 3 ] as string ,
94- methodParameters : row [ 4 ] as string ,
95- } ,
96- } ;
97- } ,
69+ readModeledMethod : ( row ) => ( {
70+ type : "sink" ,
71+ input : row [ 6 ] as string ,
72+ output : "" ,
73+ kind : row [ 7 ] as string ,
74+ provenance : row [ 8 ] as Provenance ,
75+ signature : readRowToMethod ( row ) ,
76+ packageName : row [ 0 ] as string ,
77+ typeName : row [ 1 ] as string ,
78+ methodName : row [ 3 ] as string ,
79+ methodParameters : row [ 4 ] as string ,
80+ } ) ,
9881 supportedKinds : [ "sql" , "xss" , "logging" ] ,
9982 } ,
10083 summary : {
@@ -115,24 +98,18 @@ export const extensiblePredicateDefinitions: Record<
11598 method . kind ,
11699 method . provenance ,
117100 ] ,
118- readModeledMethod : ( row ) => {
119- const signature = readRowToMethod ( row ) ;
120- return {
121- signature,
122- modeledMethod : {
123- type : "summary" ,
124- input : row [ 6 ] as string ,
125- output : row [ 7 ] as string ,
126- kind : row [ 8 ] as string ,
127- provenance : row [ 9 ] as Provenance ,
128- signature,
129- packageName : row [ 0 ] as string ,
130- typeName : row [ 1 ] as string ,
131- methodName : row [ 3 ] as string ,
132- methodParameters : row [ 4 ] as string ,
133- } ,
134- } ;
135- } ,
101+ readModeledMethod : ( row ) => ( {
102+ type : "summary" ,
103+ input : row [ 6 ] as string ,
104+ output : row [ 7 ] as string ,
105+ kind : row [ 8 ] as string ,
106+ provenance : row [ 9 ] as Provenance ,
107+ signature : readRowToMethod ( row ) ,
108+ packageName : row [ 0 ] as string ,
109+ typeName : row [ 1 ] as string ,
110+ methodName : row [ 3 ] as string ,
111+ methodParameters : row [ 4 ] as string ,
112+ } ) ,
136113 supportedKinds : [ "taint" , "value" ] ,
137114 } ,
138115 neutral : {
@@ -148,24 +125,18 @@ export const extensiblePredicateDefinitions: Record<
148125 method . kind ,
149126 method . provenance ,
150127 ] ,
151- readModeledMethod : ( row ) => {
152- const signature = `${ row [ 0 ] } .${ row [ 1 ] } #${ row [ 2 ] } ${ row [ 3 ] } ` ;
153- return {
154- signature,
155- modeledMethod : {
156- type : "neutral" ,
157- input : "" ,
158- output : "" ,
159- kind : row [ 4 ] as string ,
160- provenance : row [ 5 ] as Provenance ,
161- signature,
162- packageName : row [ 0 ] as string ,
163- typeName : row [ 1 ] as string ,
164- methodName : row [ 2 ] as string ,
165- methodParameters : row [ 3 ] as string ,
166- } ,
167- } ;
168- } ,
128+ readModeledMethod : ( row ) => ( {
129+ type : "neutral" ,
130+ input : "" ,
131+ output : "" ,
132+ kind : row [ 4 ] as string ,
133+ provenance : row [ 5 ] as Provenance ,
134+ signature : `${ row [ 0 ] } .${ row [ 1 ] } #${ row [ 2 ] } ${ row [ 3 ] } ` ,
135+ packageName : row [ 0 ] as string ,
136+ typeName : row [ 1 ] as string ,
137+ methodName : row [ 2 ] as string ,
138+ methodParameters : row [ 3 ] as string ,
139+ } ) ,
169140 supportedKinds : [ "summary" , "source" , "sink" ] ,
170141 } ,
171142} ;
0 commit comments