Preparing report...

Report for github.com/driemworks/mercury-blockchain

A    Great!    Found 13 issues across 24 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo95%

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.


golint50%

Golint is a linter for Go source code.

    • mercury-blockchain/state/block.go
    • Line 13: warning: exported type Hash should have comment or be unexported (golint)
    • Line 15: warning: exported method Hash.MarshalText should have comment or be unexported (golint)
    • Line 19: warning: exported method Hash.UnmarshalText should have comment or be unexported (golint)
    • Line 24: warning: exported method Hash.Hex should have comment or be unexported (golint)
    • Line 28: warning: exported method Hash.IsEmpty should have comment or be unexported (golint)
    • Line 33: warning: exported type Block should have comment or be unexported (golint)
    • Line 38: warning: exported type BlockHeader should have comment or be unexported (golint)
    • Line 47: warning: exported type BlockFS should have comment or be unexported (golint)
    • Line 52: warning: comment on exported method Block.Hash should be of the form "Hash ..." (golint)
    • Line 64: warning: comment on exported function NewBlock should be of the form "NewBlock ..." (golint)
    • Line 72: warning: comment on exported function IsBlockHashValid should be of the form "IsBlockHashValid ..." (golint)
    • mercury-blockchain/core/channel.go
    • Line 11: warning: exported const PENDING_TX_TOPIC should have comment or be unexported (golint)
    • Line 12: warning: exported const NEW_BLOCKS_TOPIC should have comment or be unexported (golint)
    • Line 14: warning: exported type MessageTransport should have comment or be unexported (golint)
    • Line 47: warning: exported method PubSubWrapper.ListPeers should have comment or be unexported (golint)
    • Line 51: warning: exported type MessageHandler should have comment or be unexported (golint)
    • Line 52: warning: exported type PublishHandler should have comment or be unexported (golint)
    • Line 54: warning: comment on exported method PubSubWrapper.ReadLoop should be of the form "ReadLoop ..." (golint)
    • mercury-blockchain/state/state.go
    • Line 17: warning: exported const BlockReward should have comment or be unexported (golint)
    • Line 19: warning: exported type CurrentNodeState should have comment or be unexported (golint)
    • Line 25: warning: exported type State should have comment or be unexported (golint)
    • Line 38: warning: comment on exported function NewStateFromDisk should be of the form "NewStateFromDisk ..." (golint)
    • Line 90: warning: exported method State.AddBlock should have comment or be unexported (golint)
    • Line 131: warning: exported function ApplyBlock should have comment or be unexported (golint)
    • Line 158: warning: exported method State.NextBlockNumber should have comment or be unexported (golint)
    • Line 223: warning: comment on exported method State.Close should be of the form "Close ..." (golint)
    • Line 230: warning: comment on exported method State.LatestBlockHash should be of the form "LatestBlockHash ..." (golint)
    • Line 237: warning: comment on exported method State.LatestBlock should be of the form "LatestBlock ..." (golint)
    • Line 265: warning: comment on exported function GetBlocksAfter should be of the form "GetBlocksAfter ..." (golint)
    • mercury-blockchain/state/tx.go
    • Line 13: warning: exported function NewAddress should have comment or be unexported (golint)
    • Line 17: warning: exported type Tx should have comment or be unexported (golint)
    • Line 26: warning: exported type SignedTx should have comment or be unexported (golint)
    • Line 31: warning: exported function NewTx should have comment or be unexported (golint)
    • Line 35: warning: exported function NewSignedTx should have comment or be unexported (golint)
    • Line 39: warning: exported method Tx.Hash should have comment or be unexported (golint)
    • Line 48: warning: exported method Tx.Encode should have comment or be unexported (golint)
    • Line 52: warning: exported method SignedTx.IsAuthentic should have comment or be unexported (golint)
    • mercury-blockchain/node/libp2p_sync.go
    • Line 28: warning: exported const DiscoveryServiceTag should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: don't use underscores in Go names; const DiscoveryServiceTag_PendingTxs should be DiscoveryServiceTagPendingTxs (golint)
    • Line 30: warning: don't use underscores in Go names; const DiscoveryServiceTag_Blocks should be DiscoveryServiceTagBlocks (golint)
    • Line 31: warning: don't use underscores in Go names; const DiscoveryServiceTag_Announce should be DiscoveryServiceTagAnnounce (golint)
    • mercury-blockchain/node/node.go
    • Line 20: warning: exported type Node should have comment or be unexported (golint)
    • Line 38: warning: exported function NewNode should have comment or be unexported (golint)
    • Line 56: warning: exported method Node.Run should have comment or be unexported (golint)
    • Line 150: warning: comment on exported method Node.AddPendingTX should be of the form "AddPendingTX ..." (golint)
    • Line 197: warning: exported method Node.Join should have comment or be unexported (golint)
    • mercury-blockchain/wallet/wallet.go
    • Line 26: warning: exported const X25519 should have comment or be unexported (golint)
    • Line 36: warning: exported type Wallet should have comment or be unexported (golint)
    • Line 42: warning: exported function GetKeystoreDirPath should have comment or be unexported (golint)
    • Line 46: warning: exported function NewKeystoreAccount should have comment or be unexported (golint)
    • Line 130: warning: exported function SignTxWithKeystoreAccount should have comment or be unexported (golint)
    • Line 162: warning: exported function SignTx should have comment or be unexported (golint)
    • Line 176: warning: exported function Sign should have comment or be unexported (golint)
    • Line 181: warning: exported function Verify should have comment or be unexported (golint)
    • Line 192: warning: exported function RecoverPrivateKey should have comment or be unexported (golint)
    • mercury-blockchain/state/fs.go
    • Line 19: warning: exported function GetKeystoreDirPath should have comment or be unexported (golint)
    • Line 38: warning: exported function GetEncryptionKeysFilePath should have comment or be unexported (golint)
    • Line 72: warning: exported function WriteEncryptionKeys should have comment or be unexported (golint)
    • Line 104: warning: exported function ExpandPath should have comment or be unexported (golint)
    • Line 129: warning: exported function Unicode should have comment or be unexported (golint)
    • Line 135: warning: exported function Rename should have comment or be unexported (golint)
    • Line 139: warning: exported function RemoveDir should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign91%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!