Preparing report...

Report for go.mongodb.org/mongo-driver

(v1.17.3)

A+    Excellent!    Found 110 issues across 588 files

Tweet

go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gofmt99%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo81%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • x/mongo/driver/operation.go
    • Line 505: warning: cyclomatic complexity 151 of function (Operation).Execute() is high (> 15) (gocyclo)
    • Line 1709: warning: cyclomatic complexity 31 of function (Operation).createReadPref() is high (> 15) (gocyclo)
    • Line 1464: warning: cyclomatic complexity 24 of function (Operation).addReadConcern() is high (> 15) (gocyclo)
    • Line 1302: warning: cyclomatic complexity 18 of function (Operation).createMsgWireMessage() is high (> 15) (gocyclo)
    • Line 1070: warning: cyclomatic complexity 17 of function (Operation).retryable() is high (> 15) (gocyclo)
    • mongo/integration/unified/collection_operation_execution.go
    • Line 1367: warning: cyclomatic complexity 29 of function createFindCursor() is high (> 15) (gocyclo)
    • Line 228: warning: cyclomatic complexity 27 of function executeCreateIndex() is high (> 15) (gocyclo)
    • Line 912: warning: cyclomatic complexity 25 of function executeFindOneAndUpdate() is high (> 15) (gocyclo)
    • Line 832: warning: cyclomatic complexity 23 of function executeFindOneAndReplace() is high (> 15) (gocyclo)
    • Line 25: warning: cyclomatic complexity 21 of function executeAggregate() is high (> 15) (gocyclo)
    • Line 771: warning: cyclomatic complexity 16 of function executeFindOneAndDelete() is high (> 15) (gocyclo)
    • Line 167: warning: cyclomatic complexity 16 of function executeCountDocuments() is high (> 15) (gocyclo)
    • mongo/integration/unified_spec_test.go
    • Line 661: warning: cyclomatic complexity 65 of function executeCollectionOperation() is high (> 15) (gocyclo)
    • Line 449: warning: cyclomatic complexity 40 of function executeTestRunnerOperation() is high (> 15) (gocyclo)
    • Line 805: warning: cyclomatic complexity 23 of function executeDatabaseOperation() is high (> 15) (gocyclo)
    • Line 233: warning: cyclomatic complexity 21 of function runSpecTestCase() is high (> 15) (gocyclo)
    • Line 373: warning: cyclomatic complexity 16 of function runOperation() is high (> 15) (gocyclo)
    • mongo/collection.go
    • Line 1232: warning: cyclomatic complexity 43 of function (*Collection).find() is high (> 15) (gocyclo)
    • Line 813: warning: cyclomatic complexity 36 of function aggregate() is high (> 15) (gocyclo)
    • Line 1695: warning: cyclomatic complexity 25 of function (*Collection).FindOneAndUpdate() is high (> 15) (gocyclo)
    • Line 1601: warning: cyclomatic complexity 23 of function (*Collection).FindOneAndReplace() is high (> 15) (gocyclo)
    • Line 245: warning: cyclomatic complexity 21 of function (*Collection).insert() is high (> 15) (gocyclo)
    • Line 420: warning: cyclomatic complexity 21 of function (*Collection).delete() is high (> 15) (gocyclo)
    • Line 547: warning: cyclomatic complexity 19 of function (*Collection).updateOrReplace() is high (> 15) (gocyclo)
    • Line 977: warning: cyclomatic complexity 18 of function (*Collection).CountDocuments() is high (> 15) (gocyclo)
    • Line 1124: warning: cyclomatic complexity 16 of function (*Collection).Distinct() is high (> 15) (gocyclo)
    • bson/bsoncodec/default_value_decoders.go
    • Line 264: warning: cyclomatic complexity 29 of function (DefaultValueDecoders).intDecodeType() is high (> 15) (gocyclo)
    • Line 372: warning: cyclomatic complexity 28 of function (DefaultValueDecoders).UintDecodeValue() is high (> 15) (gocyclo)
    • Line 1405: warning: cyclomatic complexity 19 of function (DefaultValueDecoders).ArrayDecodeValue() is high (> 15) (gocyclo)
    • Line 452: warning: cyclomatic complexity 18 of function (DefaultValueDecoders).floatDecodeType() is high (> 15) (gocyclo)
    • bson/bsonrw/extjson_parser.go
    • Line 229: warning: cyclomatic complexity 56 of function (*extJSONParser).readValue() is high (> 15) (gocyclo)
    • Line 90: warning: cyclomatic complexity 21 of function (*extJSONParser).peekType() is high (> 15) (gocyclo)
    • Line 530: warning: cyclomatic complexity 20 of function (*extJSONParser).advanceState() is high (> 15) (gocyclo)
    • Line 165: warning: cyclomatic complexity 16 of function (*extJSONParser).readKey() is high (> 15) (gocyclo)
    • mongo/integration/unified/matches.go
    • Line 218: warning: cyclomatic complexity 31 of function evaluateSpecialComparison() is high (> 15) (gocyclo)
    • Line 49: warning: cyclomatic complexity 27 of function verifyValuesMatchInner() is high (> 15) (gocyclo)
    • Line 365: warning: cyclomatic complexity 22 of function convertStringToBSONType() is high (> 15) (gocyclo)
    • bson/bsonrw/json_scanner.go
    • Line 366: warning: cyclomatic complexity 47 of function (*jsonScanner).scanNumber() is high (> 15) (gocyclo)
    • Line 192: warning: cyclomatic complexity 25 of function (*jsonScanner).scanString() is high (> 15) (gocyclo)
    • Line 53: warning: cyclomatic complexity 17 of function (*jsonScanner).nextToken() is high (> 15) (gocyclo)
    • x/bsonx/bsoncore/value.go
    • Line 213: warning: cyclomatic complexity 39 of function (Value).String() is high (> 15) (gocyclo)
    • Line 842: warning: cyclomatic complexity 20 of function escapeString() is high (> 15) (gocyclo)
    • mongo/mongo.go
    • Line 258: warning: cyclomatic complexity 28 of function marshalAggregatePipeline() is high (> 15) (gocyclo)
    • Line 346: warning: cyclomatic complexity 21 of function marshalUpdateValue() is high (> 15) (gocyclo)
    • x/mongo/driver/topology/CMAP_spec_test.go
    • Line 402: warning: cyclomatic complexity 32 of function runOperationInThread() is high (> 15) (gocyclo)
    • Line 279: warning: cyclomatic complexity 25 of function checkEvents() is high (> 15) (gocyclo)
    • Line 126: warning: cyclomatic complexity 25 of function runCMAPTest() is high (> 15) (gocyclo)
    • mongo/description/server.go
    • Line 70: warning: cyclomatic complexity 79 of function NewServer() is high (> 15) (gocyclo)
    • Line 419: warning: cyclomatic complexity 21 of function (Server).Equal() is high (> 15) (gocyclo)
    • bson/bsoncodec/registry_test.go
    • Line 435: warning: cyclomatic complexity 35 of function TestRegistry() is high (> 15) (gocyclo)
    • Line 20: warning: cyclomatic complexity 31 of function TestRegistryBuilder() is high (> 15) (gocyclo)
    • mongo/options/clientoptions.go
    • Line 421: warning: cyclomatic complexity 58 of function (*ClientOptions).ApplyURI() is high (> 15) (gocyclo)
    • Line 1068: warning: cyclomatic complexity 47 of function MergeClientOptions() is high (> 15) (gocyclo)
    • Line 315: warning: cyclomatic complexity 38 of function (*ClientOptions).validate() is high (> 15) (gocyclo)
    • Line 1271: warning: cyclomatic complexity 19 of function addClientCertFromBytes() is high (> 15) (gocyclo)
    • x/mongo/driver/topology/server.go
    • Line 545: warning: cyclomatic complexity 30 of function (*Server).update() is high (> 15) (gocyclo)
    • Line 433: warning: cyclomatic complexity 22 of function (*Server).ProcessError() is high (> 15) (gocyclo)
    • Line 817: warning: cyclomatic complexity 19 of function (*Server).check() is high (> 15) (gocyclo)
    • mongo/database.go
    • Line 680: warning: cyclomatic complexity 26 of function (*Database).createCollectionOperation() is high (> 15) (gocyclo)
    • x/mongo/driver/connstring/connstring.go
    • Line 330: warning: cyclomatic complexity 126 of function (*ConnString).addOptions() is high (> 15) (gocyclo)
    • Line 720: warning: cyclomatic complexity 42 of function (*ConnString).validateAuth() is high (> 15) (gocyclo)
    • Line 899: warning: cyclomatic complexity 33 of function (*parser).parse() is high (> 15) (gocyclo)
    • Line 275: warning: cyclomatic complexity 24 of function (*ConnString).setDefaultAuthParams() is high (> 15) (gocyclo)
    • Line 212: warning: cyclomatic complexity 24 of function (*ConnString).Validate() is high (> 15) (gocyclo)
    • bson/bsoncodec/default_value_encoders.go
    • Line 376: warning: cyclomatic complexity 19 of function (DefaultValueEncoders).ArrayEncodeValue() is high (> 15) (gocyclo)
    • Line 449: warning: cyclomatic complexity 18 of function (DefaultValueEncoders).SliceEncodeValue() is high (> 15) (gocyclo)
    • x/mongo/driver/topology/pool.go
    • Line 460: warning: cyclomatic complexity 27 of function (*pool).checkOut() is high (> 15) (gocyclo)
    • Line 983: warning: cyclomatic complexity 18 of function (*pool).clearImpl() is high (> 15) (gocyclo)
    • Line 328: warning: cyclomatic complexity 17 of function (*pool).close() is high (> 15) (gocyclo)
    • Line 1145: warning: cyclomatic complexity 16 of function (*pool).createConnections() is high (> 15) (gocyclo)
    • bson/bsoncodec/slice_codec.go
    • Line 63: warning: cyclomatic complexity 22 of function (SliceCodec).EncodeValue() is high (> 15) (gocyclo)
    • Line 137: warning: cyclomatic complexity 21 of function (*SliceCodec).DecodeValue() is high (> 15) (gocyclo)
    • mongo/change_stream.go
    • Line 245: warning: cyclomatic complexity 26 of function (*ChangeStream).executeOperation() is high (> 15) (gocyclo)
    • Line 104: warning: cyclomatic complexity 24 of function newChangeStream() is high (> 15) (gocyclo)
    • mongo/session.go
    • Line 182: warning: cyclomatic complexity 16 of function (*sessionImpl).WithTransaction() is high (> 15) (gocyclo)
    • internal/assert/difflib.go
    • Line 668: warning: cyclomatic complexity 24 of function WriteContextDiff() is high (> 15) (gocyclo)
    • Line 553: warning: cyclomatic complexity 23 of function WriteUnifiedDiff() is high (> 15) (gocyclo)
    • Line 214: warning: cyclomatic complexity 22 of function (*SequenceMatcher).findLongestMatch() is high (> 15) (gocyclo)
    • x/mongo/driver/batch_cursor.go
    • Line 356: warning: cyclomatic complexity 23 of function (*BatchCursor).getMore() is high (> 15) (gocyclo)
    • Line 79: warning: cyclomatic complexity 20 of function NewCursorResponse() is high (> 15) (gocyclo)
    • bson/bsoncodec/struct_codec.go
    • Line 272: warning: cyclomatic complexity 33 of function (*StructCodec).DecodeValue() is high (> 15) (gocyclo)
    • Line 511: warning: cyclomatic complexity 29 of function (*StructCodec).describeStructSlow() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 24 of function (*StructCodec).EncodeValue() is high (> 15) (gocyclo)
    • mongo/client.go
    • Line 135: warning: cyclomatic complexity 22 of function NewClient() is high (> 15) (gocyclo)
    • Line 307: warning: cyclomatic complexity 18 of function (*Client).Disconnect() is high (> 15) (gocyclo)
    • Line 255: warning: cyclomatic complexity 17 of function (*Client).Connect() is high (> 15) (gocyclo)
    • Line 545: warning: cyclomatic complexity 17 of function (*Client).newMongoCrypt() is high (> 15) (gocyclo)
    • mongo/index_view.go
    • Line 284: warning: cyclomatic complexity 25 of function (IndexView).createOptionsDoc() is high (> 15) (gocyclo)
    • Line 179: warning: cyclomatic complexity 18 of function (IndexView).CreateMany() is high (> 15) (gocyclo)
    • mongo/options/findoptions.go
    • Line 257: warning: cyclomatic complexity 24 of function MergeFindOptions() is high (> 15) (gocyclo)
    • Line 558: warning: cyclomatic complexity 21 of function MergeFindOneOptions() is high (> 15) (gocyclo)
    • bson/primitive/decimal.go
    • Line 52: warning: cyclomatic complexity 31 of function (Decimal128).String() is high (> 15) (gocyclo)
    • Line 281: warning: cyclomatic complexity 21 of function ParseDecimal128() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!