Preparing report...

Report for github.com/mongodb/mongo-go-driver

A+    Excellent!    Found 131 issues across 515 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo84%

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.

    • mongo-go-driver/bson/bsonrw/json_scanner.go
    • Line 364: warning: cyclomatic complexity 54 of function (*jsonScanner).scanNumber() is high (> 15) (gocyclo)
    • Line 191: warning: cyclomatic complexity 27 of function (*jsonScanner).scanString() is high (> 15) (gocyclo)
    • Line 53: warning: cyclomatic complexity 18 of function (*jsonScanner).nextToken() is high (> 15) (gocyclo)
    • mongo-go-driver/mongo/integration/unified_spec_test.go
    • Line 602: warning: cyclomatic complexity 66 of function executeCollectionOperation() is high (> 15) (gocyclo)
    • Line 405: warning: cyclomatic complexity 32 of function executeTestRunnerOperation() is high (> 15) (gocyclo)
    • Line 746: warning: cyclomatic complexity 24 of function executeDatabaseOperation() is high (> 15) (gocyclo)
    • Line 329: warning: cyclomatic complexity 18 of function runOperation() is high (> 15) (gocyclo)
    • mongo-go-driver/x/mongo/driver/connstring/connstring.go
    • Line 558: warning: cyclomatic complexity 119 of function (*parser).addOption() is high (> 15) (gocyclo)
    • Line 416: warning: cyclomatic complexity 40 of function (*parser).validateAuth() is high (> 15) (gocyclo)
    • Line 361: warning: cyclomatic complexity 25 of function (*parser).setDefaultAuthParams() is high (> 15) (gocyclo)
    • Line 192: warning: cyclomatic complexity 24 of function (*parser).parse() is high (> 15) (gocyclo)
    • Line 318: warning: cyclomatic complexity 19 of function (*parser).validate() is high (> 15) (gocyclo)
    • mongo-go-driver/mongo/options/clientoptions.go
    • Line 213: warning: cyclomatic complexity 54 of function (*ClientOptions).ApplyURI() is high (> 15) (gocyclo)
    • Line 766: warning: cyclomatic complexity 37 of function MergeClientOptions() is high (> 15) (gocyclo)
    • Line 926: warning: cyclomatic complexity 17 of function addClientCertFromBytes() is high (> 15) (gocyclo)
    • mongo-go-driver/x/bsonx/primitive_codecs.go
    • Line 498: warning: cyclomatic complexity 45 of function (PrimitiveCodecs).valueDecodeValue() is high (> 15) (gocyclo)
    • Line 280: warning: cyclomatic complexity 45 of function (PrimitiveCodecs).elementDecodeValue() is high (> 15) (gocyclo)
    • Line 426: warning: cyclomatic complexity 26 of function (PrimitiveCodecs).encodeValue() is high (> 15) (gocyclo)
    • mongo-go-driver/bson/bsoncodec/struct_codec.go
    • Line 216: warning: cyclomatic complexity 35 of function (*StructCodec).DecodeValue() is high (> 15) (gocyclo)
    • Line 445: warning: cyclomatic complexity 29 of function (*StructCodec).describeStruct() is high (> 15) (gocyclo)
    • Line 109: warning: cyclomatic complexity 22 of function (*StructCodec).EncodeValue() is high (> 15) (gocyclo)
    • Line 350: warning: cyclomatic complexity 18 of function (*StructCodec).isZero() is high (> 15) (gocyclo)
    • mongo-go-driver/mongo/index_view.go
    • Line 281: warning: cyclomatic complexity 25 of function (IndexView).createOptionsDoc() is high (> 15) (gocyclo)
    • Line 179: warning: cyclomatic complexity 19 of function (IndexView).CreateMany() is high (> 15) (gocyclo)
    • mongo-go-driver/x/mongo/driver/operation.go
    • Line 284: warning: cyclomatic complexity 121 of function (Operation).Execute() is high (> 15) (gocyclo)
    • Line 1163: warning: cyclomatic complexity 29 of function (Operation).createReadPref() is high (> 15) (gocyclo)
    • Line 632: warning: cyclomatic complexity 21 of function (Operation).retryable() is high (> 15) (gocyclo)
    • Line 1335: warning: cyclomatic complexity 19 of function (Operation).decodeResult() is high (> 15) (gocyclo)
    • Line 999: warning: cyclomatic complexity 19 of function (Operation).addReadConcern() is high (> 15) (gocyclo)
    • Line 870: warning: cyclomatic complexity 17 of function (Operation).createMsgWireMessage() is high (> 15) (gocyclo)
    • mongo-go-driver/bson/bsoncodec/default_value_decoders.go
    • Line 252: warning: cyclomatic complexity 31 of function (DefaultValueDecoders).intDecodeType() is high (> 15) (gocyclo)
    • Line 357: warning: cyclomatic complexity 30 of function (DefaultValueDecoders).UintDecodeValue() is high (> 15) (gocyclo)
    • Line 1339: warning: cyclomatic complexity 21 of function (DefaultValueDecoders).ArrayDecodeValue() is high (> 15) (gocyclo)
    • Line 437: warning: cyclomatic complexity 20 of function (DefaultValueDecoders).floatDecodeType() is high (> 15) (gocyclo)
    • mongo-go-driver/bson/bsonrw/extjson_parser.go
    • Line 229: warning: cyclomatic complexity 60 of function (*extJSONParser).readValue() is high (> 15) (gocyclo)
    • Line 90: warning: cyclomatic complexity 22 of function (*extJSONParser).peekType() is high (> 15) (gocyclo)
    • Line 530: warning: cyclomatic complexity 21 of function (*extJSONParser).advanceState() is high (> 15) (gocyclo)
    • Line 165: warning: cyclomatic complexity 19 of function (*extJSONParser).readKey() is high (> 15) (gocyclo)
    • mongo-go-driver/x/bsonx/value.go
    • Line 229: warning: cyclomatic complexity 26 of function (*Val).UnmarshalBSONValue() is high (> 15) (gocyclo)
    • Line 104: warning: cyclomatic complexity 26 of function (Val).Interface() is high (> 15) (gocyclo)
    • Line 818: warning: cyclomatic complexity 25 of function (Val).Equal() is high (> 15) (gocyclo)
    • Line 168: warning: cyclomatic complexity 25 of function (Val).MarshalAppendBSONValue() is high (> 15) (gocyclo)
    • mongo-go-driver/mongo/client.go
    • Line 347: warning: cyclomatic complexity 47 of function (*Client).configure() is high (> 15) (gocyclo)
    • Line 154: warning: cyclomatic complexity 17 of function (*Client).Connect() is high (> 15) (gocyclo)
    • Line 206: warning: cyclomatic complexity 16 of function (*Client).Disconnect() is high (> 15) (gocyclo)
    • mongo-go-driver/mongo/collection.go
    • Line 1102: warning: cyclomatic complexity 39 of function (*Collection).Find() is high (> 15) (gocyclo)
    • Line 743: warning: cyclomatic complexity 30 of function aggregate() is high (> 15) (gocyclo)
    • Line 870: warning: cyclomatic complexity 18 of function (*Collection).CountDocuments() is high (> 15) (gocyclo)
    • Line 1500: warning: cyclomatic complexity 18 of function (*Collection).FindOneAndUpdate() is high (> 15) (gocyclo)
    • Line 235: warning: cyclomatic complexity 18 of function (*Collection).insert() is high (> 15) (gocyclo)
    • Line 1427: warning: cyclomatic complexity 17 of function (*Collection).FindOneAndReplace() is high (> 15) (gocyclo)
    • Line 395: warning: cyclomatic complexity 17 of function (*Collection).delete() is high (> 15) (gocyclo)
    • Line 1013: warning: cyclomatic complexity 16 of function (*Collection).Distinct() is high (> 15) (gocyclo)
    • mongo-go-driver/mongo/mongo.go
    • Line 249: warning: cyclomatic complexity 22 of function transformUpdateValue() is high (> 15) (gocyclo)
    • Line 199: warning: cyclomatic complexity 19 of function transformAggregatePipeline() is high (> 15) (gocyclo)

golint97%

Golint is a linter for Go source code.

    • mongo-go-driver/benchmark/bson_map.go
    • Line 66: warning: exported function BSONFlatMapDecoding should have comment or be unexported (golint)
    • Line 70: warning: exported function BSONFlatMapEncoding should have comment or be unexported (golint)
    • Line 74: warning: exported function BSONDeepMapDecoding should have comment or be unexported (golint)
    • Line 78: warning: exported function BSONDeepMapEncoding should have comment or be unexported (golint)
    • Line 82: warning: exported function BSONFullMapDecoding should have comment or be unexported (golint)
    • Line 86: warning: exported function BSONFullMapEncoding should have comment or be unexported (golint)
    • mongo-go-driver/benchmark/harness.go
    • Line 27: warning: exported const ExecutionTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported type BenchCase should have comment or be unexported (golint)
    • Line 34: warning: exported type BenchFunction should have comment or be unexported (golint)
    • Line 36: warning: exported function WrapCase should have comment or be unexported (golint)
    • mongo-go-driver/benchmark/harness_results.go
    • Line 16: warning: exported type BenchResult should have comment or be unexported (golint)
    • Line 26: warning: exported method BenchResult.EvergreenPerfFormat should have comment or be unexported (golint)
    • Line 103: warning: exported method BenchResult.HasErrors should have comment or be unexported (golint)
    • Line 128: warning: exported type Result should have comment or be unexported (golint)
    • mongo-go-driver/internal/testutil/config.go
    • Line 292: warning: exported function GetConnString should have comment or be unexported (golint)
    • Line 313: warning: exported function GetDBName should have comment or be unexported (golint)
    • Line 330: warning: comment on exported function CompareVersions should be of the form "CompareVersions ..." (golint)
    • mongo-go-driver/benchmark/bson_document.go
    • Line 89: warning: exported function BSONFlatDocumentEncoding should have comment or be unexported (golint)
    • Line 93: warning: exported function BSONFlatDocumentDecodingLazy should have comment or be unexported (golint)
    • Line 97: warning: exported function BSONFlatDocumentDecoding should have comment or be unexported (golint)
    • Line 101: warning: exported function BSONDeepDocumentEncoding should have comment or be unexported (golint)
    • Line 105: warning: exported function BSONDeepDocumentDecodingLazy should have comment or be unexported (golint)
    • Line 109: warning: exported function BSONDeepDocumentDecoding should have comment or be unexported (golint)
    • Line 113: warning: exported function BSONFullDocumentEncoding should have comment or be unexported (golint)
    • Line 117: warning: exported function BSONFullDocumentDecodingLazy should have comment or be unexported (golint)
    • Line 121: warning: exported function BSONFullDocumentDecoding should have comment or be unexported (golint)
    • mongo-go-driver/benchmark/bson_struct.go
    • Line 16: warning: exported function BSONFlatStructDecoding should have comment or be unexported (golint)
    • Line 34: warning: exported function BSONFlatStructEncoding should have comment or be unexported (golint)
    • Line 61: warning: exported function BSONFlatStructTagsEncoding should have comment or be unexported (golint)
    • Line 88: warning: exported function BSONFlatStructTagsDecoding should have comment or be unexported (golint)
    • mongo-go-driver/benchmark/harness_case.go
    • Line 19: warning: exported type CaseDefinition should have comment or be unexported (golint)
    • Line 40: warning: exported method CaseDefinition.ResetTimer should have comment or be unexported (golint)
    • Line 46: warning: exported method CaseDefinition.StartTimer should have comment or be unexported (golint)
    • Line 51: warning: exported method CaseDefinition.StopTimer should have comment or be unexported (golint)
    • Line 63: warning: exported method CaseDefinition.Run should have comment or be unexported (golint)
    • Line 136: warning: exported method CaseDefinition.Name should have comment or be unexported (golint)
    • mongo-go-driver/benchmark/multi.go
    • Line 16: warning: exported function MultiFindMany should have comment or be unexported (golint)
    • Line 136: warning: exported function MultiInsertSmallDocument should have comment or be unexported (golint)
    • Line 140: warning: exported function MultiInsertLargeDocument should have comment or be unexported (golint)
    • mongo-go-driver/benchmark/single.go
    • Line 43: warning: exported function SingleRunCommand should have comment or be unexported (golint)
    • Line 73: warning: exported function SingleFindOneByID should have comment or be unexported (golint)
    • Line 168: warning: exported function SingleInsertSmallDocument should have comment or be unexported (golint)
    • Line 172: warning: exported function SingleInsertLargeDocument should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign93%

IneffAssign detects ineffectual assignments in Go code.


misspell93%

Misspell Finds commonly misspelled English words

    • mongo-go-driver/x/mongo/driver/topology/CMAP_spec_test.go
    • Line 126: warning: "recieved" is a misspelling of "received" (misspell)
    • Line 171: warning: "recieved" is a misspelling of "received" (misspell)
    • Line 196: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 203: warning: "recieved" is a misspelling of "received" (misspell)
    • Line 208: warning: "recieved" is a misspelling of "received" (misspell)
    • Line 211: warning: "recieved" is a misspelling of "received" (misspell)
    • Line 264: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 273: warning: "occured" is a misspelling of "occurred" (misspell)
    • mongo-go-driver/x/mongo/driver/auth/auth_test.go
    • Line 24: warning: "auther" is a misspelling of "author" (misspell)
    • Line 26: warning: "auther" is a misspelling of "author" (misspell)
    • Line 27: warning: "auther" is a misspelling of "author" (misspell)
    • Line 28: warning: "auther" is a misspelling of "author" (misspell)
    • Line 29: warning: "auther" is a misspelling of "author" (misspell)
    • Line 30: warning: "auther" is a misspelling of "author" (misspell)
    • Line 31: warning: "auther" is a misspelling of "author" (misspell)