Preparing report...

Report for github.com/vulcanize/eth-header-sync

A+    Excellent!    Found 14 issues across 47 files

Tweet

gofmt97%

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!


gocyclo100%

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.

No problems detected. Good job!


golint74%

Golint is a linter for Go source code.

    • eth-header-sync/pkg/fakes/mock_rpc_client.go
    • Line 26: warning: should not use dot imports (golint)
    • Line 32: warning: exported type MockRPCClient should have comment or be unexported (golint)
    • Line 50: warning: exported method MockRPCClient.Subscribe should have comment or be unexported (golint)
    • Line 62: warning: exported method MockRPCClient.AssertSubscribeCalledWith should have comment or be unexported (golint)
    • Line 68: warning: exported function NewMockRPCClient should have comment or be unexported (golint)
    • Line 72: warning: exported method MockRPCClient.SetRPCPath should have comment or be unexported (golint)
    • Line 76: warning: exported method MockRPCClient.BatchCall should have comment or be unexported (golint)
    • Line 97: warning: exported method MockRPCClient.CallContext should have comment or be unexported (golint)
    • Line 130: warning: exported method MockRPCClient.RPCPath should have comment or be unexported (golint)
    • Line 134: warning: exported method MockRPCClient.SupportedModules should have comment or be unexported (golint)
    • Line 138: warning: exported method MockRPCClient.SetSupporedModules should have comment or be unexported (golint)
    • Line 142: warning: exported method MockRPCClient.SetCallContextErr should have comment or be unexported (golint)
    • Line 146: warning: exported method MockRPCClient.SetReturnPOAHeader should have comment or be unexported (golint)
    • Line 150: warning: exported method MockRPCClient.SetReturnPOWHeaders should have comment or be unexported (golint)
    • Line 154: warning: exported method MockRPCClient.SetReturnPOAHeaders should have comment or be unexported (golint)
    • Line 158: warning: exported method MockRPCClient.AssertCallContextCalledWith should have comment or be unexported (golint)
    • Line 164: warning: exported method MockRPCClient.AssertBatchCalledWith should have comment or be unexported (golint)
    • eth-header-sync/test_config/test_config.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 30: warning: exported var TestConfig should have comment or be unexported (golint)
    • Line 31: warning: exported var DBConfig should have comment or be unexported (golint)
    • Line 32: warning: exported var TestClient should have comment or be unexported (golint)
    • eth-header-sync/pkg/repository/header_repository.go
    • Line 29: warning: exported var ErrValidHeaderExists should have comment or be unexported (golint)
    • Line 58: warning: exported method HeaderRepository.GetHeader should have comment or be unexported (golint)
    • Line 68: warning: exported method HeaderRepository.MissingBlockNumbers should have comment or be unexported (golint)
    • eth-header-sync/pkg/core/node_info.go
    • Line 23: warning: exported const GETH should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported const KOVAN_NETWORK_ID should have comment (or a comment on this block) or be unexported (golint)
    • eth-header-sync/pkg/fetcher/fetcher.go
    • Line 34: warning: exported var ErrEmptyHeader should have comment or be unexported (golint)
    • Line 36: warning: exported const MAX_BATCH_SIZE should have comment or be unexported (golint)
    • Line 116: warning: receiver name blockChain should be consistent with previous receiver name fetcher for Fetcher (golint)
    • Line 179: warning: receiver name blockChain should be consistent with previous receiver name fetcher for Fetcher (golint)
    • eth-header-sync/pkg/fakes/data.go
    • Line 32: warning: error var FakeError should have name of the form ErrFoo (golint)
    • Line 32: warning: exported var FakeError should have comment or be unexported (golint)
    • Line 38: warning: exported var FakeHeader should have comment or be unexported (golint)
    • eth-header-sync/pkg/fakes/mock_eth_client.go
    • Line 26: warning: should not use dot imports (golint)
    • Line 31: warning: exported type MockEthClient should have comment or be unexported (golint)
    • Line 64: warning: exported function NewMockEthClient should have comment or be unexported (golint)
    • Line 90: warning: exported method MockEthClient.SetCallContractErr should have comment or be unexported (golint)
    • Line 94: warning: exported method MockEthClient.SetCallContractReturnBytes should have comment or be unexported (golint)
    • Line 98: warning: exported method MockEthClient.SetBlockByNumberErr should have comment or be unexported (golint)
    • Line 102: warning: exported method MockEthClient.SetBlockByNumberReturnBlock should have comment or be unexported (golint)
    • Line 106: warning: exported method MockEthClient.SetHeaderByNumberErr should have comment or be unexported (golint)
    • Line 110: warning: exported method MockEthClient.SetHeaderByNumberReturnHeader should have comment or be unexported (golint)
    • Line 114: warning: exported method MockEthClient.SetHeaderByNumbersReturnHeader should have comment or be unexported (golint)
    • Line 118: warning: exported method MockEthClient.SetFilterLogsErr should have comment or be unexported (golint)
    • Line 122: warning: exported method MockEthClient.SetFilterLogsReturnLogs should have comment or be unexported (golint)
    • Line 126: warning: exported method MockEthClient.SetTransactionReceiptErr should have comment or be unexported (golint)
    • Line 130: warning: exported method MockEthClient.SetTransactionReceipts should have comment or be unexported (golint)
    • Line 136: warning: exported method MockEthClient.SetTransactionSenderErr should have comment or be unexported (golint)
    • Line 140: warning: exported method MockEthClient.CallContract should have comment or be unexported (golint)
    • Line 147: warning: exported method MockEthClient.BatchCall should have comment or be unexported (golint)
    • Line 154: warning: exported method MockEthClient.BlockByNumber should have comment or be unexported (golint)
    • Line 160: warning: exported method MockEthClient.HeaderByNumber should have comment or be unexported (golint)
    • Line 166: warning: exported method MockEthClient.HeaderByNumbers should have comment or be unexported (golint)
    • Line 171: warning: exported method MockEthClient.FilterLogs should have comment or be unexported (golint)
    • Line 177: warning: exported method MockEthClient.TransactionSender should have comment or be unexported (golint)
    • Line 181: warning: exported method MockEthClient.TransactionReceipt should have comment or be unexported (golint)
    • Line 188: warning: exported method MockEthClient.AssertCallContractCalledWith should have comment or be unexported (golint)
    • Line 194: warning: exported method MockEthClient.AssertBlockByNumberCalledWith should have comment or be unexported (golint)
    • Line 199: warning: exported method MockEthClient.AssertHeaderByNumberCalledWith should have comment or be unexported (golint)
    • Line 204: warning: exported method MockEthClient.AssertHeaderByNumbersCalledWith should have comment or be unexported (golint)
    • Line 208: warning: exported method MockEthClient.AssertFilterLogsCalledWith should have comment or be unexported (golint)
    • Line 213: warning: exported method MockEthClient.AssertBatchCalledWith should have comment or be unexported (golint)
    • Line 217: warning: exported method MockEthClient.SetBalanceAtErr should have comment or be unexported (golint)
    • Line 221: warning: exported method MockEthClient.SetBalanceAt should have comment or be unexported (golint)
    • Line 225: warning: exported method MockEthClient.BalanceAt should have comment or be unexported (golint)
    • Line 232: warning: exported method MockEthClient.AssertBalanceAtCalled should have comment or be unexported (golint)
    • eth-header-sync/pkg/postgres/errors.go
    • Line 24: warning: exported const DbConnectionFailedMsg should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported function ErrDBConnectionFailed should have comment or be unexported (golint)
    • Line 33: warning: exported function ErrDBInsertFailed should have comment or be unexported (golint)
    • Line 37: warning: exported function ErrUnableToSetNode should have comment or be unexported (golint)
    • eth-header-sync/pkg/fakes/mock_fetcher.go
    • Line 25: warning: exported type MockFetcher should have comment or be unexported (golint)
    • Line 31: warning: exported function NewMockFetcher should have comment or be unexported (golint)
    • Line 37: warning: exported method MockFetcher.SetLastBlock should have comment or be unexported (golint)
    • Line 41: warning: exported method MockFetcher.GetHeaderByNumber should have comment or be unexported (golint)
    • Line 45: warning: exported method MockFetcher.GetHeadersByNumbers should have comment or be unexported (golint)
    • Line 54: warning: exported method MockFetcher.LastBlock should have comment or be unexported (golint)
    • Line 58: warning: exported method MockFetcher.Node should have comment or be unexported (golint)
    • eth-header-sync/pkg/fakes/mock_header_repository.go
    • Line 20: warning: should not use dot imports (golint)
    • Line 25: warning: exported type MockHeaderRepository should have comment or be unexported (golint)
    • Line 39: warning: exported function NewMockHeaderRepository should have comment or be unexported (golint)
    • Line 43: warning: exported method MockHeaderRepository.SetCreateOrUpdateHeaderReturnID should have comment or be unexported (golint)
    • Line 47: warning: exported method MockHeaderRepository.SetCreateOrUpdateHeaderReturnErr should have comment or be unexported (golint)
    • Line 51: warning: exported method MockHeaderRepository.SetMissingBlockNumbers should have comment or be unexported (golint)
    • Line 55: warning: exported method MockHeaderRepository.CreateOrUpdateHeader should have comment or be unexported (golint)
    • Line 61: warning: exported method MockHeaderRepository.GetHeader should have comment or be unexported (golint)
    • Line 66: warning: exported method MockHeaderRepository.MissingBlockNumbers should have comment or be unexported (golint)
    • Line 70: warning: exported method MockHeaderRepository.SetGetHeaderError should have comment or be unexported (golint)
    • Line 74: warning: exported method MockHeaderRepository.SetGetHeaderReturnBlockHash should have comment or be unexported (golint)
    • Line 78: warning: exported method MockHeaderRepository.AssertCreateOrUpdateHeaderCallCountAndPassedBlockNumbers should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell95%

Misspell Finds commonly misspelled English words