Preparing report...

Report for github.com/nats-io/nats

A+    Excellent!    Found 14 issues across 47 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!


golint78%

Golint is a linter for Go source code.

    • nats/encoders/builtin/default_enc.go
    • Line 37: warning: comment on exported method DefaultEncoder.Encode should be of the form "Encode ..." (golint)
    • Line 48: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 60: warning: comment on exported method DefaultEncoder.Decode should be of the form "Decode ..." (golint)
    • nats/encoders/builtin/json_enc.go
    • Line 28: warning: comment on exported method JsonEncoder.Encode should be of the form "Encode ..." (golint)
    • Line 37: warning: comment on exported method JsonEncoder.Decode should be of the form "Decode ..." (golint)
    • nats/context.go
    • Line 149: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • nats/parser.go
    • Line 28: warning: exported const MAX_CONTROL_LINE_SIZE should have comment or be unexported (golint)
    • Line 42: warning: exported const OP_START should have comment (or a comment on this block) or be unexported (golint)
    • Line 52: warning: don't use underscores in Go names; const OP_M should be OPM (golint)
    • Line 59: warning: don't use underscores in Go names; const OP_H should be OPH (golint)
    • Line 60: warning: don't use underscores in Go names; const OP_P should be OPP (golint)
    • Line 67: warning: don't use underscores in Go names; const OP_I should be OPI (golint)
    • Line 535: warning: don't use underscores in Go names; const ascii_0 should be ascii0 (golint)
    • Line 536: warning: don't use underscores in Go names; const ascii_9 should be ascii9 (golint)
    • nats/test/js_test.go
    • Line 1856: warning: don't use underscores in Go names; func testJetStreamManagement_GetMsg should be testJetStreamManagementGetMsg (golint)
    • Line 4280: warning: don't use underscores in Go names; func testJetStreamMirror_Source should be testJetStreamMirrorSource (golint)
    • Line 4736: warning: don't use underscores in Go names; func testJetStream_ClusterMultipleSubscribe should be testJetStreamClusterMultipleSubscribe (golint)
    • Line 4817: warning: don't use underscores in Go names; func testJetStream_ClusterMultipleQueueSubscribe should be testJetStreamClusterMultipleQueueSubscribe (golint)
    • Line 4899: warning: don't use underscores in Go names; func testJetStream_ClusterMultiplePullSubscribe should be testJetStreamClusterMultiplePullSubscribe (golint)
    • Line 5023: warning: don't use underscores in Go names; func testJetStream_ClusterReconnectDurableQueueSubscriber should be testJetStreamClusterReconnectDurableQueueSubscriber (golint)
    • Line 5170: warning: don't use underscores in Go names; func testJetStream_ClusterReconnectDurablePushSubscriber should be testJetStreamClusterReconnectDurablePushSubscriber (golint)
    • Line 5283: warning: don't use underscores in Go names; func testJetStream_ClusterReconnectPullQueueSubscriber should be testJetStreamClusterReconnectPullQueueSubscriber (golint)
    • nats/encoders/protobuf/protobuf_enc.go
    • Line 41: warning: exported var ErrInvalidProtoMsgEncode should have comment or be unexported (golint)
    • Line 45: warning: comment on exported method ProtobufEncoder.Encode should be of the form "Encode ..." (golint)
    • Line 62: warning: comment on exported method ProtobufEncoder.Decode should be of the form "Decode ..." (golint)
    • nats/encoders/builtin/gob_enc.go
    • Line 30: warning: comment on exported method GobEncoder.Encode should be of the form "Encode ..." (golint)
    • Line 40: warning: comment on exported method GobEncoder.Decode should be of the form "Decode ..." (golint)
    • nats/js.go
    • Line 706: warning: comment on exported function ExpectLastMsgId should be of the form "ExpectLastMsgId ..." (golint)
    • Line 1508: warning: exported method Subscription.ConsumerInfo should have comment or be unexported (golint)
    • Line 1666: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 1928: warning: comment on exported method Msg.AckSync should be of the form "AckSync ..." (golint)
    • Line 2049: warning: exported method AckPolicy.UnmarshalJSON should have comment or be unexported (golint)
    • Line 2064: warning: exported method AckPolicy.MarshalJSON should have comment or be unexported (golint)
    • Line 2103: warning: exported method ReplayPolicy.UnmarshalJSON should have comment or be unexported (golint)
    • Line 2116: warning: exported method ReplayPolicy.MarshalJSON should have comment or be unexported (golint)
    • Line 2150: warning: comment on exported const DeliverByStartSequencePolicy should be of the form "DeliverByStartSequencePolicy ..." (golint)
    • Line 2159: warning: exported method DeliverPolicy.UnmarshalJSON should have comment or be unexported (golint)
    • Line 2176: warning: exported method DeliverPolicy.MarshalJSON should have comment or be unexported (golint)
    • Line 2237: warning: exported method RetentionPolicy.MarshalJSON should have comment or be unexported (golint)
    • Line 2250: warning: exported method RetentionPolicy.UnmarshalJSON should have comment or be unexported (golint)
    • Line 2275: warning: exported method DiscardPolicy.MarshalJSON should have comment or be unexported (golint)
    • Line 2286: warning: exported method DiscardPolicy.UnmarshalJSON should have comment or be unexported (golint)
    • Line 2324: warning: exported method StorageType.MarshalJSON should have comment or be unexported (golint)
    • Line 2335: warning: exported method StorageType.UnmarshalJSON should have comment or be unexported (golint)
    • nats/jsm.go
    • Line 391: warning: receiver name jsc should be consistent with previous receiver name js for js (golint)
    • Line 488: warning: receiver name jsc should be consistent with previous receiver name js for js (golint)
    • Line 942: warning: receiver name jsc should be consistent with previous receiver name js for js (golint)
    • Line 1026: warning: receiver name jsc should be consistent with previous receiver name js for js (golint)
    • nats/nats.go
    • Line 14: warning: package comment should be of the form "Package nats ..." (golint)
    • Line 175: warning: comment on exported var DefaultOptions should be of the form "DefaultOptions ..." (golint)
    • Line 184: warning: exported const DISCONNECTED should have comment (or a comment on this block) or be unexported (golint)
    • Line 623: warning: comment on exported type Statistics should be of the form "Statistics ..." (with optional leading article) (golint)
    • Line 2013: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 3937: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 4041: warning: comment on exported method Subscription.QueuedMsgs should be of the form "QueuedMsgs ..." (golint)

gocyclo97%

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.


ineffassign91%

IneffAssign detects ineffectual assignments in Go code.

    • nats/js.go
    • Line 1026: warning: ineffectual assignment to stream (ineffassign)
    • Line 1027: warning: ineffectual assignment to consumer (ineffassign)
    • nats/ws.go
    • Line 181: warning: ineffectual assignment to rem (ineffassign)
    • Line 252: warning: ineffectual assignment to rem (ineffassign)
    • Line 261: warning: ineffectual assignment to rem (ineffassign)

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!