Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 8cc76ed

Browse files
author
Max Schaefer
committed
Rephrase a comment and split up some very long lines.
1 parent d7b82b2 commit 8cc76ed

1 file changed

Lines changed: 29 additions & 15 deletions

File tree

ql/src/semmle/go/frameworks/NoSQL.qll

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,51 +29,65 @@ module NoSQL {
2929
abstract class Range extends DataFlow::Node { }
3030

3131
/**
32-
* Holds if method `name` of `Collection` struct of `go.mongodb.org/mongo-driver/mongo`
33-
* package interprets parameter `n` as a query.
32+
* Holds if method `name` of struct `Collection` from package
33+
* [go.mongodb.org/mongo-driver/mongo](https://pkg.go.dev/go.mongodb.org/mongo-driver/mongo)
34+
* interprets parameter `n` as a query.
3435
*/
3536
private predicate collectionMethods(string name, int n) {
3637
// func (coll *Collection) CountDocuments(ctx context.Context, filter interface{},
3738
// opts ...*options.CountOptions) (int64, error)
3839
name = "CountDocuments" and n = 1
3940
or
40-
// func (coll *Collection) DeleteMany(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*DeleteResult, error)
41+
// func (coll *Collection) DeleteMany(ctx context.Context, filter interface{},
42+
// opts ...*options.DeleteOptions) (*DeleteResult, error)
4143
name = "DeleteMany" and n = 1
4244
or
43-
// func (coll *Collection) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*DeleteResult, error)
45+
// func (coll *Collection) DeleteOne(ctx context.Context, filter interface{},
46+
// opts ...*options.DeleteOptions) (*DeleteResult, error)
4447
name = "DeleteOne" and n = 1
4548
or
46-
// func (coll *Collection) Distinct(ctx context.Context, fieldName string, filter interface{}, ...) ([]interface{}, error)
49+
// func (coll *Collection) Distinct(ctx context.Context, fieldName string, filter interface{},
50+
// ...) ([]interface{}, error)
4751
name = "Distinct" and n = 2
4852
or
49-
// func (coll *Collection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (*Cursor, error)
53+
// func (coll *Collection) Find(ctx context.Context, filter interface{},
54+
// opts ...*options.FindOptions) (*Cursor, error)
5055
name = "Find" and n = 1
5156
or
52-
// func (coll *Collection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) *SingleResult
57+
// func (coll *Collection) FindOne(ctx context.Context, filter interface{},
58+
// opts ...*options.FindOneOptions) *SingleResult
5359
name = "FindOne" and n = 1
5460
or
55-
// func (coll *Collection) FindOneAndDelete(ctx context.Context, filter interface{}, ...) *SingleResult
61+
// func (coll *Collection) FindOneAndDelete(ctx context.Context, filter interface{}, ...)
62+
// *SingleResult
5663
name = "FindOneAndDelete" and n = 1
5764
or
58-
// func (coll *Collection) FindOneAndReplace(ctx context.Context, filter interface{}, replacement interface{}, ...) *SingleResult
65+
// func (coll *Collection) FindOneAndReplace(ctx context.Context, filter interface{},
66+
// replacement interface{}, ...) *SingleResult
5967
name = "FindOneAndReplace" and n = 1
6068
or
61-
// func (coll *Collection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, ...) *SingleResult
69+
// func (coll *Collection) FindOneAndUpdate(ctx context.Context, filter interface{},
70+
// update interface{}, ...) *SingleResult
6271
name = "FindOneAndUpdate" and n = 1
6372
or
64-
// func (coll *Collection) ReplaceOne(ctx context.Context, filter interface{}, replacement interface{}, ...) (*UpdateResult, error)
73+
// func (coll *Collection) ReplaceOne(ctx context.Context, filter interface{},
74+
// replacement interface{}, ...) (*UpdateResult, error)
6575
name = "ReplaceOne" and n = 1
6676
or
67-
// func (coll *Collection) UpdateMany(ctx context.Context, filter interface{}, update interface{}, ...) (*UpdateResult, error)
77+
// func (coll *Collection) UpdateMany(ctx context.Context, filter interface{},
78+
// update interface{}, ...) (*UpdateResult, error)
6879
name = "UpdateMany" and n = 1
6980
or
70-
// func (coll *Collection) UpdateOne(ctx context.Context, filter interface{}, update interface{}, ...) (*UpdateResult, error)
81+
// func (coll *Collection) UpdateOne(ctx context.Context, filter interface{},
82+
// update interface{}, ...) (*UpdateResult, error)
7183
name = "UpdateOne" and n = 1
7284
or
73-
// func (coll *Collection) Watch(ctx context.Context, pipeline interface{}, ...) (*ChangeStream, error)
85+
// func (coll *Collection) Watch(ctx context.Context, pipeline interface{}, ...)
86+
// (*ChangeStream, error)
7487
name = "Watch" and n = 1
7588
or
76-
// func (coll *Collection) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (*Cursor, error)
89+
// func (coll *Collection) Aggregate(ctx context.Context, pipeline interface{},
90+
// opts ...*options.AggregateOptions) (*Cursor, error)
7791
name = "Aggregate" and n = 1
7892
}
7993

0 commit comments

Comments
 (0)