Preparing report...

Report for github.com/CoderZhi/go-ethereum

A+    Excellent!    Found 51 issues across 175 files

Tweet

gofmt99%

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!


gocyclo92%

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-ethereum/core/vm/evm.go
    • Line 345: warning: cyclomatic complexity 24 of function (*EVM).create() is high (> 15) (gocyclo)
    • Line 163: warning: cyclomatic complexity 16 of function (*EVM).Call() is high (> 15) (gocyclo)

golint76%

Golint is a linter for Go source code.

    • go-ethereum/rlp/encode.go
    • Line 28: warning: comment on exported var EmptyString should be of the form "EmptyString ..." (golint)
    • Line 31: warning: exported var EmptyList should have comment or be unexported (golint)
    • go-ethereum/accounts/keystore/key.go
    • Line 42: warning: exported type Key should have comment or be unexported (golint)
    • Line 94: warning: exported method Key.MarshalJSON should have comment or be unexported (golint)
    • Line 105: warning: exported method Key.UnmarshalJSON should have comment or be unexported (golint)
    • go-ethereum/crypto/crypto.go
    • Line 142: warning: exported function FromECDSAPub should have comment or be unexported (golint)
    • Line 184: warning: exported function GenerateKey should have comment or be unexported (golint)
    • Line 203: warning: exported function PubkeyToAddress should have comment or be unexported (golint)
    • go-ethereum/crypto/ecies/ecies.go
    • Line 45: warning: exported var ErrImport should have comment or be unexported (golint)
    • Line 61: warning: comment on exported method PublicKey.ExportECDSA should be of the form "ExportECDSA ..." (golint)
    • Line 66: warning: comment on exported function ImportECDSAPublic should be of the form "ImportECDSAPublic ..." (golint)
    • Line 82: warning: comment on exported method PrivateKey.ExportECDSA should be of the form "ExportECDSA ..." (golint)
    • Line 89: warning: comment on exported function ImportECDSA should be of the form "ImportECDSA ..." (golint)
    • Line 95: warning: comment on exported function GenerateKey should be of the form "GenerateKey ..." (golint)
    • Line 120: warning: comment on exported method PrivateKey.GenerateShared should be of the form "GenerateShared ..." (golint)
    • Line 141: warning: exported var ErrKeyDataTooLong should have comment or be unexported (golint)
    • go-ethereum/core/vm/noop.go
    • Line 26: warning: exported function NoopCanTransfer should have comment or be unexported (golint)
    • Line 29: warning: exported function NoopTransfer should have comment or be unexported (golint)
    • Line 31: warning: exported type NoopEVMCallContext should have comment or be unexported (golint)
    • Line 33: warning: exported method NoopEVMCallContext.Call should have comment or be unexported (golint)
    • Line 36: warning: exported method NoopEVMCallContext.CallCode should have comment or be unexported (golint)
    • Line 39: warning: exported method NoopEVMCallContext.Create should have comment or be unexported (golint)
    • Line 42: warning: exported method NoopEVMCallContext.DelegateCall should have comment or be unexported (golint)
    • Line 46: warning: exported type NoopStateDB should have comment or be unexported (golint)
    • Line 48: warning: exported method NoopStateDB.CreateAccount should have comment or be unexported (golint)
    • Line 49: warning: exported method NoopStateDB.SubBalance should have comment or be unexported (golint)
    • Line 50: warning: exported method NoopStateDB.AddBalance should have comment or be unexported (golint)
    • Line 51: warning: exported method NoopStateDB.GetBalance should have comment or be unexported (golint)
    • Line 52: warning: exported method NoopStateDB.GetNonce should have comment or be unexported (golint)
    • Line 53: warning: exported method NoopStateDB.SetNonce should have comment or be unexported (golint)
    • Line 54: warning: exported method NoopStateDB.GetCodeHash should have comment or be unexported (golint)
    • Line 55: warning: exported method NoopStateDB.GetCode should have comment or be unexported (golint)
    • Line 56: warning: exported method NoopStateDB.SetCode should have comment or be unexported (golint)
    • Line 57: warning: exported method NoopStateDB.GetCodeSize should have comment or be unexported (golint)
    • Line 58: warning: exported method NoopStateDB.AddRefund should have comment or be unexported (golint)
    • Line 59: warning: exported method NoopStateDB.GetRefund should have comment or be unexported (golint)
    • Line 60: warning: exported method NoopStateDB.GetState should have comment or be unexported (golint)
    • Line 61: warning: exported method NoopStateDB.SetState should have comment or be unexported (golint)
    • Line 62: warning: exported method NoopStateDB.Suicide should have comment or be unexported (golint)
    • Line 63: warning: exported method NoopStateDB.HasSuicided should have comment or be unexported (golint)
    • Line 64: warning: exported method NoopStateDB.Exist should have comment or be unexported (golint)
    • Line 65: warning: exported method NoopStateDB.Empty should have comment or be unexported (golint)
    • Line 66: warning: exported method NoopStateDB.RevertToSnapshot should have comment or be unexported (golint)
    • Line 67: warning: exported method NoopStateDB.Snapshot should have comment or be unexported (golint)
    • Line 68: warning: exported method NoopStateDB.AddLog should have comment or be unexported (golint)
    • Line 69: warning: exported method NoopStateDB.AddPreimage should have comment or be unexported (golint)
    • Line 70: warning: exported method NoopStateDB.ForEachStorage should have comment or be unexported (golint)
    • go-ethereum/event/filter/generic_filter.go
    • Line 19: warning: exported type Generic should have comment or be unexported (golint)
    • Line 26: warning: comment on exported method Generic.Compare should be of the form "Compare ..." (golint)
    • Line 27: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 46: warning: exported method Generic.Trigger should have comment or be unexported (golint)
    • Line 46: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • go-ethereum/core/types/transaction_signing.go
    • Line 31: warning: exported var ErrInvalidChainId should have comment or be unexported (golint)
    • Line 105: warning: comment on exported type EIP155Signer should be of the form "EIP155Signer ..." (with optional leading article) (golint)
    • Line 110: warning: exported function NewEIP155Signer should have comment or be unexported (golint)
    • Line 120: warning: exported method EIP155Signer.Equal should have comment or be unexported (golint)
    • Line 127: warning: exported method EIP155Signer.Sender should have comment or be unexported (golint)
    • Line 139: warning: comment on exported method EIP155Signer.SignatureValues should be of the form "SignatureValues ..." (golint)
    • Line 167: warning: comment on exported type HomesteadSigner should be of the form "HomesteadSigner ..." (with optional leading article) (golint)
    • Line 171: warning: exported method HomesteadSigner.Equal should have comment or be unexported (golint)
    • Line 178: warning: receiver name hs should be consistent with previous receiver name s for HomesteadSigner (golint)
    • Line 182: warning: exported method HomesteadSigner.Sender should have comment or be unexported (golint)
    • Line 182: warning: receiver name hs should be consistent with previous receiver name s for HomesteadSigner (golint)
    • Line 186: warning: exported type FrontierSigner should have comment or be unexported (golint)
    • Line 188: warning: exported method FrontierSigner.Equal should have comment or be unexported (golint)
    • Line 195: warning: receiver name fs should be consistent with previous receiver name s for FrontierSigner (golint)
    • Line 207: warning: receiver name fs should be consistent with previous receiver name s for FrontierSigner (golint)
    • Line 218: warning: exported method FrontierSigner.Sender should have comment or be unexported (golint)
    • Line 218: warning: receiver name fs should be consistent with previous receiver name s for FrontierSigner (golint)
    • go-ethereum/crypto/bn256/cloudflare/bn256.go
    • Line 54: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 63: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 72: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 81: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 90: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 99: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 120: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 338: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • Line 347: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • Line 356: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • Line 365: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • Line 374: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • Line 381: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • Line 418: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • go-ethereum/rlp/decode.go
    • Line 34: warning: error var EOL should have name of the form ErrFoo (golint)
    • Line 36: warning: comment on exported var ErrExpectedString should be of the form "ErrExpectedString ..." (golint)
    • Line 38: warning: exported var ErrExpectedList should have comment or be unexported (golint)
    • Line 556: warning: exported const Byte should have comment (or a comment on this block) or be unexported (golint)
    • go-ethereum/rpc/json.go
    • Line 278: 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)
    • go-ethereum/rpc/subscription.go
    • Line 28: warning: comment on exported var ErrSubscriptionNotFound should be of the form "ErrSubscriptionNotFound ..." (golint)
    • Line 35: warning: comment on exported type Subscription should be of the form "Subscription ..." (with optional leading article) (golint)
    • go-ethereum/rpc/http.go
    • Line 238: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 239: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 240: warning: should not use basic type string as key in context.WithValue (golint)
    • go-ethereum/core/types/bloom9.go
    • Line 71: warning: exported method Bloom.Bytes should have comment or be unexported (golint)
    • Line 75: warning: exported method Bloom.Test should have comment or be unexported (golint)
    • Line 79: warning: exported method Bloom.TestBytes should have comment or be unexported (golint)
    • Line 94: warning: exported function CreateBloom should have comment or be unexported (golint)
    • Line 103: warning: exported function LogsBloom should have comment or be unexported (golint)
    • Line 129: warning: exported var Bloom9 should have comment or be unexported (golint)
    • Line 131: warning: exported function BloomLookup should have comment or be unexported (golint)
    • go-ethereum/core/types/transaction.go
    • Line 36: warning: exported var ErrInvalidSig should have comment or be unexported (golint)
    • Line 39: warning: exported type Transaction should have comment or be unexported (golint)
    • Line 89: warning: exported function NewTransaction should have comment or be unexported (golint)
    • Line 93: warning: exported function NewContractCreation should have comment or be unexported (golint)
    • Line 185: warning: exported method Transaction.Data should have comment or be unexported (golint)
    • Line 186: warning: exported method Transaction.Gas should have comment or be unexported (golint)
    • Line 187: warning: exported method Transaction.GasPrice should have comment or be unexported (golint)
    • Line 188: warning: exported method Transaction.Value should have comment or be unexported (golint)
    • Line 189: warning: exported method Transaction.Nonce should have comment or be unexported (golint)
    • Line 190: warning: exported method Transaction.CheckNonce should have comment or be unexported (golint)
    • Line 265: warning: exported method Transaction.RawSignatureValues should have comment or be unexported (golint)
    • Line 319: warning: exported method TxByPrice.Push should have comment or be unexported (golint)
    • Line 323: warning: exported method TxByPrice.Pop should have comment or be unexported (golint)
    • Line 407: warning: exported function NewMessage should have comment or be unexported (golint)
    • Line 420: warning: exported method Message.From should have comment or be unexported (golint)
    • Line 421: warning: exported method Message.To should have comment or be unexported (golint)
    • Line 422: warning: exported method Message.GasPrice should have comment or be unexported (golint)
    • Line 423: warning: exported method Message.Value should have comment or be unexported (golint)
    • Line 424: warning: exported method Message.Gas should have comment or be unexported (golint)
    • Line 425: warning: exported method Message.Nonce should have comment or be unexported (golint)
    • Line 426: warning: exported method Message.Data should have comment or be unexported (golint)
    • Line 427: warning: exported method Message.CheckNonce should have comment or be unexported (golint)
    • go-ethereum/crypto/ecies/params.go
    • Line 49: warning: exported var DefaultCurve should have comment or be unexported (golint)
    • Line 54: warning: exported type ECIESParams should have comment or be unexported (golint)
    • Line 69: warning: exported var ECIES_AES128_SHA256 should have comment or be unexported (golint)
    • Line 109: warning: exported function AddParamsForCurve should have comment or be unexported (golint)
    • go-ethereum/event/filter/filter.go
    • Line 22: warning: exported type Filter should have comment or be unexported (golint)
    • Line 27: warning: exported type FilterEvent should have comment or be unexported (golint)
    • Line 32: warning: exported type Filters should have comment or be unexported (golint)
    • Line 40: warning: exported function New should have comment or be unexported (golint)
    • Line 48: warning: exported method Filters.Start should have comment or be unexported (golint)
    • Line 52: warning: exported method Filters.Stop should have comment or be unexported (golint)
    • Line 56: warning: exported method Filters.Notify should have comment or be unexported (golint)
    • Line 60: warning: exported method Filters.Install should have comment or be unexported (golint)
    • Line 67: warning: exported method Filters.Uninstall should have comment or be unexported (golint)
    • Line 89: warning: exported method Filters.Match should have comment or be unexported (golint)
    • Line 93: warning: exported method Filters.Get should have comment or be unexported (golint)
    • go-ethereum/rpc/client.go
    • Line 40: warning: exported var ErrClientQuit should have comment or be unexported (golint)
    • Line 184: warning: exported type StdIOConn should have comment or be unexported (golint)
    • Line 194: warning: exported method StdIOConn.Close should have comment or be unexported (golint)
    • Line 198: warning: exported method StdIOConn.LocalAddr should have comment or be unexported (golint)
    • Line 202: warning: exported method StdIOConn.RemoteAddr should have comment or be unexported (golint)
    • Line 206: warning: exported method StdIOConn.SetDeadline should have comment or be unexported (golint)
    • Line 210: warning: exported method StdIOConn.SetReadDeadline should have comment or be unexported (golint)
    • Line 214: warning: exported method StdIOConn.SetWriteDeadline should have comment or be unexported (golint)
    • Line 217: warning: exported function DialStdIO should have comment or be unexported (golint)
    • Line 332: warning: comment on exported method Client.BatchCallContext should be of the form "BatchCallContext ..." (golint)
    • Line 784: warning: error should be the last type when returning multiple items (golint)
    • go-ethereum/log/logger.go
    • Line 18: warning: exported type Lvl should have comment or be unexported (golint)
    • Line 21: warning: exported const LvlCrit should have comment (or a comment on this block) or be unexported (golint)
    • go-ethereum/event/event.go
    • Line 174: warning: exported method TypeMuxSubscription.Chan should have comment or be unexported (golint)
    • Line 178: warning: exported method TypeMuxSubscription.Unsubscribe should have comment or be unexported (golint)
    • Line 183: warning: exported method TypeMuxSubscription.Closed should have comment or be unexported (golint)
    • go-ethereum/accounts/abi/bind/backend.go
    • Line 35: warning: comment on exported var ErrNoPendingState should be of the form "ErrNoPendingState ..." (golint)
    • Line 39: warning: comment on exported var ErrNoCodeAfterDeploy should be of the form "ErrNoCodeAfterDeploy ..." (golint)
    • go-ethereum/crypto/bn256/google/bn256.go
    • Line 58: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 64: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 73: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 83: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 92: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 101: warning: receiver name n should be consistent with previous receiver name g for G1 (golint)
    • Line 119: warning: receiver name e should be consistent with previous receiver name g for G1 (golint)
    • Line 160: warning: comment on exported function RandomG2 should be of the form "RandomG2 ..." (golint)
    • Line 184: warning: receiver name e should be consistent with previous receiver name g for G2 (golint)
    • Line 190: warning: receiver name e should be consistent with previous receiver name g for G2 (golint)
    • Line 199: warning: receiver name e should be consistent with previous receiver name g for G2 (golint)
    • Line 209: warning: receiver name e should be consistent with previous receiver name g for G2 (golint)
    • Line 218: warning: receiver name n should be consistent with previous receiver name g for G2 (golint)
    • Line 240: warning: receiver name e should be consistent with previous receiver name g for G2 (golint)
    • Line 297: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • Line 306: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • Line 315: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • Line 324: warning: receiver name n should be consistent with previous receiver name g for GT (golint)
    • Line 362: warning: receiver name e should be consistent with previous receiver name g for GT (golint)
    • go-ethereum/rpc/types.go
    • Line 119: warning: exported type BlockNumber should have comment or be unexported (golint)
    • Line 122: warning: exported const PendingBlockNumber should have comment (or a comment on this block) or be unexported (golint)
    • Line 163: warning: exported method BlockNumber.Int64 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!