Preparing report...

Report for github.com/pubnub/go

A+    Excellent!    Found 36 issues across 205 files

Tweet

gofmt96%

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!


golint93%

Golint is a linter for Go source code.

    • go/tests/helpers/url_helpers.go
    • Line 11: warning: comment on exported function UrlsEqual should be of the form "UrlsEqual ..." (golint)
    • Line 87: warning: exported function QueriesEqual should have comment or be unexported (golint)
    • Line 123: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 150: warning: comment on exported function AssertPathsEqual should be of the form "AssertPathsEqual ..." (golint)
    • Line 159: warning: exported function AssertQueriesEqual should have comment or be unexported (golint)
    • go/examples/snippets/design_patterns/message_updates_and_deletes.go
    • Line 10: warning: exported type Lists should have comment or be unexported (golint)
    • Line 11: warning: don't use underscores in Go names; struct field message_list should be messageList (golint)
    • Line 12: warning: don't use underscores in Go names; struct field deleted_ids should be deletedIds (golint)
    • Line 13: warning: don't use underscores in Go names; struct field message_ids should be messageIds (golint)
    • Line 16: warning: don't use underscores in Go names; var my_channel should be myChannel (golint)
    • Line 34: warning: don't use underscores in Go names; var message_id should be messageID (golint)
    • Line 35: warning: don't use underscores in Go names; var m_ids should be mIds (golint)
    • Line 38: warning: don't use underscores in Go names; var m_id should be mID (golint)
    • Line 48: warning: don't use underscores in Go names; var m_id should be mID (golint)
    • go/utils/crypto.go
    • Line 53: warning: exported type A should have comment or be unexported (golint)
    • Line 57: warning: exported type B should have comment or be unexported (golint)
    • Line 167: warning: comment on exported function GetHmacSha256 should be of the form "GetHmacSha256 ..." (golint)
    • Line 228: warning: exported function EncryptFile should have comment or be unexported (golint)
    • Line 298: warning: exported function DecryptFile should have comment or be unexported (golint)
    • go/utils/string_utils.go
    • Line 30: warning: comment on exported function EncodeJSONAsPathComponent should be of the form "EncodeJSONAsPathComponent ..." (golint)
    • Line 42: warning: exported function Serialize should have comment or be unexported (golint)
    • Line 50: warning: exported function SerializeAndEncrypt should have comment or be unexported (golint)
    • Line 69: warning: exported function SerializeEncryptAndSerialize should have comment or be unexported (golint)
    • Line 92: warning: comment on exported function ValueAsString should be of the form "ValueAsString ..." (golint)
    • Line 103: warning: comment on exported function UUID should be of the form "UUID ..." (golint)
    • Line 112: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 122: warning: exported function PreparePamParams should have comment or be unexported (golint)
    • Line 144: warning: exported function PamEncode should have comment or be unexported (golint)
    • Line 164: warning: comment on exported function URLEncode should be of the form "URLEncode ..." (golint)
    • go/pnerr/types.go
    • Line 9: warning: comment on exported type ValidationError should be of the form "ValidationError ..." (with optional leading article) (golint)
    • Line 18: warning: exported method ValidationError.OrigErr should have comment or be unexported (golint)
    • Line 26: warning: exported function NewValidationError should have comment or be unexported (golint)
    • Line 32: warning: comment on exported type BuildRequestError should be of the form "BuildRequestError ..." (with optional leading article) (golint)
    • Line 37: warning: exported method BuildRequestError.OrigErr should have comment or be unexported (golint)
    • Line 45: warning: exported function NewBuildRequestError should have comment or be unexported (golint)
    • Line 51: warning: comment on exported type ServerError should be of the form "ServerError ..." (with optional leading article) (golint)
    • Line 65: warning: exported function NewServerError should have comment or be unexported (golint)
    • Line 74: warning: comment on exported type ConnectionError should be of the form "ConnectionError ..." (with optional leading article) (golint)
    • Line 85: warning: exported function NewConnectionError should have comment or be unexported (golint)
    • Line 92: warning: comment on exported type ResponseParsingError should be of the form "ResponseParsingError ..." (with optional leading article) (golint)
    • Line 103: warning: exported function NewResponseParsingError should have comment or be unexported (golint)
    • go/tests/stubs/interceptor.go
    • Line 15: warning: exported type Interceptor should have comment or be unexported (golint)
    • Line 19: warning: exported function NewInterceptor should have comment or be unexported (golint)
    • Line 25: warning: exported method Interceptor.AddStub should have comment or be unexported (golint)
    • Line 29: warning: exported method Interceptor.GetClient should have comment or be unexported (golint)
    • Line 35: warning: exported type Stub should have comment or be unexported (golint)
    • Line 47: warning: exported method Stub.Match should have comment or be unexported (golint)
    • go/tests/e2e/helper.go
    • Line 18: warning: exported const SPECIAL_CHARACTERS should have comment (or a comment on this block) or be unexported (golint)
    • go/tests/e2e/subscribe_test_1.8.go
    • Line 14: warning: comment on exported function TestSubscribeUnsubscribeGroup should be of the form "TestSubscribeUnsubscribeGroup ..." (golint)
    • Line 118: warning: exported function TestSubscribePublishUnsubscribeAllGroup should have comment or be unexported (golint)

gocyclo91%

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.

    • go/examples/cli/cli_demo.go
    • Line 513: warning: cyclomatic complexity 58 of function readCommand() is high (> 15) (gocyclo)
    • Line 1459: warning: cyclomatic complexity 20 of function granttoken() is high (> 15) (gocyclo)
    • Line 2054: warning: cyclomatic complexity 16 of function historyRequest() is high (> 15) (gocyclo)
    • Line 1916: warning: cyclomatic complexity 16 of function fetchRequest() is high (> 15) (gocyclo)
    • Line 37: warning: cyclomatic complexity 16 of function connect() is high (> 15) (gocyclo)
    • go/request.go
    • Line 78: warning: cyclomatic complexity 22 of function executeRequest() is high (> 15) (gocyclo)
    • go/enums.go
    • Line 454: warning: cyclomatic complexity 64 of function (OperationType).String() is high (> 15) (gocyclo)
    • go/subscription_manager.go
    • Line 289: warning: cyclomatic complexity 22 of function (*SubscriptionManager).startSubscribeLoop() is high (> 15) (gocyclo)
    • Line 802: warning: cyclomatic complexity 17 of function createPNObjectsResult() is high (> 15) (gocyclo)
    • go/tests/e2e/objectsV2_test.go
    • Line 1533: warning: cyclomatic complexity 62 of function ObjectsListenersCommonV2() is high (> 15) (gocyclo)
    • Line 387: warning: cyclomatic complexity 55 of function ObjectsSetRemoveMembershipsCommonV2() is high (> 15) (gocyclo)
    • Line 961: warning: cyclomatic complexity 55 of function ObjectsMembershipsCommonV2() is high (> 15) (gocyclo)
    • Line 228: warning: cyclomatic complexity 16 of function ObjectsCreateUpdateGetDeleteChannelCommon() is high (> 15) (gocyclo)
    • Line 59: warning: cyclomatic complexity 16 of function ObjectsCreateUpdateGetDeleteUUIDCommon() is high (> 15) (gocyclo)
    • go/grant_request.go
    • Line 527: warning: cyclomatic complexity 17 of function readKeyData() is high (> 15) (gocyclo)
    • Line 359: warning: cyclomatic complexity 17 of function newGrantResponse() is high (> 15) (gocyclo)
    • Line 223: warning: cyclomatic complexity 17 of function (*grantOpts).buildQuery() is high (> 15) (gocyclo)
    • go/tests/e2e/files_test.go
    • Line 52: warning: cyclomatic complexity 46 of function FileUploadCommon() is high (> 15) (gocyclo)
    • Line 352: warning: cyclomatic complexity 20 of function FileEncryptDecryptWithoutBase64Test() is high (> 15) (gocyclo)
    • go/tests/e2e/subscribe_test.go
    • Line 1417: warning: cyclomatic complexity 22 of function JoinLeaveChannel() is high (> 15) (gocyclo)
    • Line 1552: warning: cyclomatic complexity 22 of function SubscribeJoinLeaveGroup() is high (> 15) (gocyclo)
    • Line 811: warning: cyclomatic complexity 20 of function SubscribePublishUnsubscribeMultiCommon() is high (> 15) (gocyclo)
    • Line 154: warning: cyclomatic complexity 17 of function TestSubscribeUnsubscribe() is high (> 15) (gocyclo)

ineffassign93%

IneffAssign detects ineffectual assignments in Go code.

    • go/tests/e2e/files_test.go
    • Line 354: warning: ineffectual assignment to filepathInput (ineffassign)
    • Line 357: warning: ineffectual assignment to filepathInput (ineffassign)
    • Line 463: warning: ineffectual assignment to filepathDecOutput (ineffassign)
    • Line 464: warning: ineffectual assignment to filepathDecOutput (ineffassign)
    • Line 612: warning: ineffectual assignment to filepathInput (ineffassign)
    • Line 613: warning: ineffectual assignment to filepathDecOutput (ineffassign)
    • Line 614: warning: ineffectual assignment to filepathInput (ineffassign)
    • Line 615: warning: ineffectual assignment to filepathDecOutput (ineffassign)
    • Line 616: warning: ineffectual assignment to filepathInput (ineffassign)
    • Line 617: warning: ineffectual assignment to filepathDecOutput (ineffassign)
    • Line 618: warning: ineffectual assignment to filepathInput (ineffassign)
    • Line 619: warning: ineffectual assignment to filepathDecOutput (ineffassign)
    • go/tests/e2e/objectsV2_test.go
    • Line 531: warning: ineffectual assignment to sortMembers1 (ineffassign)
    • Line 532: warning: ineffectual assignment to sortMembers2 (ineffassign)
    • Line 788: warning: ineffectual assignment to sortMemberships1 (ineffassign)
    • Line 789: warning: ineffectual assignment to sortMemberships2 (ineffassign)
    • Line 1105: warning: ineffectual assignment to sortMembers1 (ineffassign)
    • Line 1106: warning: ineffectual assignment to sortMembers2 (ineffassign)
    • Line 1361: warning: ineffectual assignment to sortMemberships1 (ineffassign)
    • Line 1362: warning: ineffectual assignment to sortMemberships2 (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!