@@ -24,7 +24,7 @@ private module MongoDB {
24
24
override predicate row ( string row ) {
25
25
// In Mongo version 2.x, a client and a database handle were the same concept, but in 3.x
26
26
// they were separated. To handle everything with a single model, we treat them as the same here.
27
- row = "mongodb; Db;mongodb; MongoClient;"
27
+ row = "mongodb. Db;mongodb. MongoClient;"
28
28
}
29
29
}
30
30
@@ -42,11 +42,11 @@ private module MongoDB {
42
42
/** A call to a MongoDB query method. */
43
43
private class QueryCall extends DatabaseAccess , API:: CallNode {
44
44
QueryCall ( ) {
45
- this = ModelOutput:: getATypeNode ( "mongodb" , " Collection") .getAMember ( ) .getACall ( ) and
45
+ this = ModelOutput:: getATypeNode ( "mongodb. Collection" ) .getAMember ( ) .getACall ( ) and
46
46
not this .getCalleeName ( ) = [ "toString" , "valueOf" , "getLogger" ]
47
47
or
48
48
this =
49
- ModelOutput:: getATypeNode ( "mongodb" , [ " Db", "MongoClient" ] )
49
+ ModelOutput:: getATypeNode ( [ "mongodb. Db", "mongodb. MongoClient" ] )
50
50
.getMember ( [ "watch" , "aggregate" ] )
51
51
.getACall ( )
52
52
}
@@ -63,7 +63,7 @@ private module MongoDB {
63
63
64
64
private class Insertion extends DatabaseAccess , API:: CallNode {
65
65
Insertion ( ) {
66
- this = ModelOutput:: getATypeNode ( "mongodb" , " Collection") .getAMember ( ) .getACall ( ) and
66
+ this = ModelOutput:: getATypeNode ( "mongodb. Collection" ) .getAMember ( ) .getACall ( ) and
67
67
this .getCalleeName ( ) .matches ( "insert%" )
68
68
}
69
69
@@ -105,9 +105,7 @@ private module Mongoose {
105
105
private class QueryCall extends DatabaseAccess , API:: CallNode {
106
106
QueryCall ( ) {
107
107
this =
108
- ModelOutput:: getATypeNode ( "mongoose" , "Query" )
109
- .getMember ( [ "exec" , "then" , "catch" ] )
110
- .getACall ( )
108
+ ModelOutput:: getATypeNode ( "mongoose.Query" ) .getMember ( [ "exec" , "then" , "catch" ] ) .getACall ( )
111
109
}
112
110
113
111
override DataFlow:: Node getAQueryArgument ( ) { result = this .getReceiver ( ) }
@@ -132,10 +130,10 @@ private module Mongoose {
132
130
private class QueryWithCallback extends DatabaseAccess , API:: CallNode {
133
131
QueryWithCallback ( ) {
134
132
this =
135
- ModelOutput:: getATypeNode ( "mongoose" , [ " Document", "Model" , "Query" ] )
133
+ ModelOutput:: getATypeNode ( [ "mongoose. Document", "mongoose. Model" , "mongoose. Query" ] )
136
134
.getAMember ( )
137
135
.getACall ( ) and
138
- this .getReturn ( ) = ModelOutput:: getATypeNode ( "mongoose" , " Query") and
136
+ this .getReturn ( ) = ModelOutput:: getATypeNode ( "mongoose. Query" ) and
139
137
exists ( this .getLastArgument ( ) .getABoundFunctionValue ( _) )
140
138
}
141
139
@@ -152,7 +150,7 @@ private module Mongoose {
152
150
153
151
QueryAwait ( ) {
154
152
astNode .getOperand ( ) .flow ( ) =
155
- ModelOutput:: getATypeNode ( "mongoose" , " Query") .getAValueReachableFromSource ( )
153
+ ModelOutput:: getATypeNode ( "mongoose. Query" ) .getAValueReachableFromSource ( )
156
154
}
157
155
158
156
override DataFlow:: Node getAQueryArgument ( ) { result = astNode .getOperand ( ) .flow ( ) }
@@ -162,7 +160,7 @@ private module Mongoose {
162
160
163
161
class Insertion extends DatabaseAccess , API:: CallNode {
164
162
Insertion ( ) {
165
- this = ModelOutput:: getATypeNode ( "mongoose" , " Model") .getAMember ( ) .getACall ( ) and
163
+ this = ModelOutput:: getATypeNode ( "mongoose. Model" ) .getAMember ( ) .getACall ( ) and
166
164
this .getCalleeName ( ) .matches ( "insert%" )
167
165
}
168
166
@@ -180,9 +178,9 @@ private module MarsDB {
180
178
override predicate row ( string row ) {
181
179
row =
182
180
[
183
- "mongoose; Query;marsdb; ;Member[Collection].Instance" ,
184
- "mongoose; Model;marsdb; ;Member[Collection].Instance" ,
185
- "mongoose; Query;mongoose; Query;Member[sortFunc].ReturnValue" ,
181
+ "mongoose. Query;marsdb;Member[Collection].Instance" ,
182
+ "mongoose. Model;marsdb;Member[Collection].Instance" ,
183
+ "mongoose. Query;mongoose. Query;Member[sortFunc].ReturnValue" ,
186
184
]
187
185
}
188
186
}
0 commit comments