Preparing report...

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

A+    Excellent!    Found 126 issues across 414 files

Tweet

gofmt95%

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


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!


gocyclo83%

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/extjson_parser.go
    • Line 212: warning: cyclomatic complexity 50 of function (*extJSONParser).readValue() is high (> 15) (gocyclo)
    • Line 455: warning: cyclomatic complexity 21 of function (*extJSONParser).advanceState() is high (> 15) (gocyclo)
    • Line 86: warning: cyclomatic complexity 19 of function (*extJSONParser).peekType() is high (> 15) (gocyclo)
    • Line 148: warning: cyclomatic complexity 19 of function (*extJSONParser).readKey() is high (> 15) (gocyclo)
    • mongo-go-driver/mongo/collection.go
    • Line 1038: warning: cyclomatic complexity 39 of function (*Collection).Find() is high (> 15) (gocyclo)
    • Line 693: warning: cyclomatic complexity 29 of function aggregate() is high (> 15) (gocyclo)
    • Line 1430: warning: cyclomatic complexity 18 of function (*Collection).FindOneAndUpdate() is high (> 15) (gocyclo)
    • Line 806: warning: cyclomatic complexity 18 of function (*Collection).CountDocuments() is high (> 15) (gocyclo)
    • Line 1358: warning: cyclomatic complexity 17 of function (*Collection).FindOneAndReplace() is high (> 15) (gocyclo)
    • Line 949: warning: cyclomatic complexity 16 of function (*Collection).Distinct() is high (> 15) (gocyclo)
    • mongo-go-driver/x/mongo/driver/operation.go
    • Line 235: warning: cyclomatic complexity 104 of function (Operation).Execute() is high (> 15) (gocyclo)
    • Line 1026: warning: cyclomatic complexity 26 of function (Operation).createReadPref() is high (> 15) (gocyclo)
    • Line 539: warning: cyclomatic complexity 21 of function (Operation).retryable() is high (> 15) (gocyclo)
    • Line 859: warning: cyclomatic complexity 19 of function (Operation).addReadConcern() is high (> 15) (gocyclo)
    • Line 1188: warning: cyclomatic complexity 19 of function (Operation).decodeResult() is high (> 15) (gocyclo)
    • Line 565: warning: cyclomatic complexity 16 of function (Operation).roundTrip() is high (> 15) (gocyclo)
    • mongo-go-driver/x/mongo/driver/connstring/connstring.go
    • Line 444: warning: cyclomatic complexity 102 of function (*parser).addOption() is high (> 15) (gocyclo)
    • Line 135: warning: cyclomatic complexity 32 of function (*parser).parse() is high (> 15) (gocyclo)
    • Line 324: warning: cyclomatic complexity 30 of function (*parser).validateAuth() is high (> 15) (gocyclo)
    • Line 276: warning: cyclomatic complexity 23 of function (*parser).setDefaultAuthParams() 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/mongo/index_view.go
    • Line 250: warning: cyclomatic complexity 24 of function (IndexView).createOptionsDoc() is high (> 15) (gocyclo)
    • Line 156: warning: cyclomatic complexity 17 of function (IndexView).CreateMany() is high (> 15) (gocyclo)
    • mongo-go-driver/bson/bsoncodec/struct_codec.go
    • Line 172: warning: cyclomatic complexity 33 of function (*StructCodec).DecodeValue() is high (> 15) (gocyclo)
    • Line 363: warning: cyclomatic complexity 23 of function (*StructCodec).describeStruct() is high (> 15) (gocyclo)
    • Line 78: warning: cyclomatic complexity 22 of function (*StructCodec).EncodeValue() is high (> 15) (gocyclo)
    • Line 298: warning: cyclomatic complexity 18 of function (*StructCodec).isZero() is high (> 15) (gocyclo)
    • mongo-go-driver/mongo/mongo.go
    • Line 336: warning: cyclomatic complexity 27 of function transformUpdateValue() is high (> 15) (gocyclo)
    • Line 288: warning: cyclomatic complexity 16 of function transformAggregatePipelinev2() 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/bson/bsonrw/json_scanner.go
    • Line 275: warning: cyclomatic complexity 54 of function (*jsonScanner).scanNumber() is high (> 15) (gocyclo)
    • Line 53: warning: cyclomatic complexity 18 of function (*jsonScanner).nextToken() is high (> 15) (gocyclo)
    • Line 166: warning: cyclomatic complexity 17 of function (*jsonScanner).scanString() is high (> 15) (gocyclo)
    • mongo-go-driver/bson/bsoncodec/default_value_decoders.go
    • Line 235: warning: cyclomatic complexity 30 of function (DefaultValueDecoders).UintDecodeValue() is high (> 15) (gocyclo)
    • Line 151: warning: cyclomatic complexity 30 of function (DefaultValueDecoders).IntDecodeValue() is high (> 15) (gocyclo)
    • Line 904: warning: cyclomatic complexity 20 of function (DefaultValueDecoders).ArrayDecodeValue() is high (> 15) (gocyclo)
    • Line 316: warning: cyclomatic complexity 19 of function (DefaultValueDecoders).FloatDecodeValue() is high (> 15) (gocyclo)

golint97%

Golint is a linter for Go source code.

    • 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/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)
    • 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/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_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/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/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/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/internal/testutil/config.go
    • Line 251: warning: exported function GetConnString should have comment or be unexported (golint)
    • Line 272: warning: exported function GetDBName should have comment or be unexported (golint)
    • Line 289: warning: comment on exported function CompareVersions should be of the form "CompareVersions ..." (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/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)
    • mongo-go-driver/x/mongo/driver/topology/CMAP_spec_test.go
    • Line 124: warning: "recieved" is a misspelling of "received" (misspell)
    • Line 169: warning: "recieved" is a misspelling of "received" (misspell)
    • Line 194: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 201: warning: "recieved" is a misspelling of "received" (misspell)
    • Line 206: warning: "recieved" is a misspelling of "received" (misspell)
    • Line 209: warning: "recieved" is a misspelling of "received" (misspell)
    • Line 262: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 271: warning: "occured" is a misspelling of "occurred" (misspell)