@@ -210,9 +210,9 @@ private module Mongoose {
210210 }
211211
212212 /**
213- * A common interface for various Mongoose calls .
213+ * A common interface for various Mongoose function invocations .
214214 */
215- private class CommonInterface extends DataFlow:: InvokeNode {
215+ private class InvokeNode extends DataFlow:: InvokeNode {
216216 /**
217217 * Holds if this call returns an object of type `Query`.
218218 */
@@ -235,8 +235,8 @@ private module Mongoose {
235235 * Provides classes modeling the Mongoose Model class
236236 */
237237 module Model {
238- private class ModelAsCommonInterface extends CommonInterface , DataFlow:: MethodCallNode {
239- ModelAsCommonInterface ( ) { this = ref ( ) .getAMethodCall ( ) }
238+ private class ModelInvokeNode extends InvokeNode , DataFlow:: MethodCallNode {
239+ ModelInvokeNode ( ) { this = ref ( ) .getAMethodCall ( ) }
240240
241241 override predicate returnsQuery ( ) { MethodSignatures:: returnsQuery ( getMethodName ( ) ) }
242242
@@ -334,8 +334,8 @@ private module Mongoose {
334334 * Provides classes modeling the Mongoose Query class
335335 */
336336 module Query {
337- private class QueryAsCommonInterface extends CommonInterface , DataFlow:: MethodCallNode {
338- QueryAsCommonInterface ( ) { this = ref ( ) .getAMethodCall ( ) }
337+ private class QueryInvokeNode extends InvokeNode , DataFlow:: MethodCallNode {
338+ QueryInvokeNode ( ) { this = ref ( ) .getAMethodCall ( ) }
339339
340340 override predicate returnsQuery ( ) { MethodSignatures:: returnsQuery ( getMethodName ( ) ) }
341341
@@ -351,8 +351,8 @@ private module Mongoose {
351351 }
352352 }
353353
354- private class NewQueryAsCommonInterface extends CommonInterface {
355- NewQueryAsCommonInterface ( ) {
354+ private class NewQueryInvokeNode extends InvokeNode {
355+ NewQueryInvokeNode ( ) {
356356 this = getAMongooseInstance ( ) .getAPropertyRead ( "Query" ) .getAnInstantiation ( )
357357 }
358358
@@ -368,7 +368,7 @@ private module Mongoose {
368368 */
369369 private DataFlow:: SourceNode ref ( DataFlow:: TypeTracker t ) {
370370 (
371- result .( CommonInterface ) .returnsQuery ( ) or
371+ result .( InvokeNode ) .returnsQuery ( ) or
372372 result .hasUnderlyingType ( "mongoose" , "Query" )
373373 ) and
374374 t .start ( )
@@ -525,8 +525,8 @@ private module Mongoose {
525525 * Provides classes modeling the Mongoose Document class
526526 */
527527 module Document {
528- private class DocumentAsCommonInterface extends CommonInterface , DataFlow:: MethodCallNode {
529- DocumentAsCommonInterface ( ) { this = ref ( ) .getAMethodCall ( ) }
528+ private class DocumentInvokeNode extends InvokeNode , DataFlow:: MethodCallNode {
529+ DocumentInvokeNode ( ) { this = ref ( ) .getAMethodCall ( ) }
530530
531531 override predicate returnsQuery ( ) { MethodSignatures:: returnsQuery ( getMethodName ( ) ) }
532532
@@ -548,7 +548,7 @@ private module Mongoose {
548548 class RetrievedDocument extends DataFlow:: SourceNode {
549549 RetrievedDocument ( ) {
550550 exists ( boolean asArray , DataFlow:: ParameterNode param |
551- exists ( CommonInterface call |
551+ exists ( InvokeNode call |
552552 call .returnsDocumentQuery ( asArray ) and
553553 param = call .getCallback ( call .getNumArgument ( ) - 1 ) .getParameter ( 1 )
554554 )
@@ -677,25 +677,25 @@ private module Mongoose {
677677 * An expression that is interpreted as a (part of a) MongoDB query.
678678 */
679679 class MongoDBQueryPart extends NoSQL:: Query {
680- MongoDBQueryPart ( ) { any ( CommonInterface call ) .interpretsArgumentAsQuery ( this .flow ( ) ) }
680+ MongoDBQueryPart ( ) { any ( InvokeNode call ) .interpretsArgumentAsQuery ( this .flow ( ) ) }
681681 }
682682
683683 /**
684684 * An evaluation of a MongoDB query.
685685 */
686686 class ShorthandQueryEvaluation extends DatabaseAccess {
687- CommonInterface common ;
687+ InvokeNode invk ;
688688
689689 ShorthandQueryEvaluation ( ) {
690- this = common and
690+ this = invk and
691691 // shorthand for execution: provide a callback
692- common .returnsQuery ( ) and
693- exists ( common .getCallback ( common .getNumArgument ( ) - 1 ) )
692+ invk .returnsQuery ( ) and
693+ exists ( invk .getCallback ( invk .getNumArgument ( ) - 1 ) )
694694 }
695695
696696 override DataFlow:: Node getAQueryArgument ( ) {
697697 // NB: the complete information is not easily accessible for deeply chained calls
698- common .interpretsArgumentAsQuery ( result )
698+ invk .interpretsArgumentAsQuery ( result )
699699 }
700700 }
701701
0 commit comments