Preparing report...

Report for github.com/EnsicoinDevs/eccd

A+    Excellent!    Found 26 issues across 36 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!


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.

    • eccd/blockchain/blockchain.go
    • Line 919: warning: cyclomatic complexity 18 of function (*Blockchain).acceptBlock() is high (> 15) (gocyclo)
    • Line 436: warning: cyclomatic complexity 16 of function (*Blockchain).validateBlock() is high (> 15) (gocyclo)

golint27%

Golint is a linter for Go source code.

    • eccd/network/msg_tx.go
    • Line 11: warning: exported type Outpoint should have comment or be unexported (golint)
    • Line 16: warning: exported method Outpoint.MarshalBinary should have comment or be unexported (golint)
    • Line 32: warning: exported method Outpoint.UnmarshalBinary should have comment or be unexported (golint)
    • Line 73: warning: exported type TxIn should have comment or be unexported (golint)
    • Line 116: warning: exported type TxOut should have comment or be unexported (golint)
    • Line 163: warning: exported type TxMessage should have comment or be unexported (golint)
    • Line 170: warning: exported function NewTxMessage should have comment or be unexported (golint)
    • Line 174: warning: exported method TxMessage.Decode should have comment or be unexported (golint)
    • Line 236: warning: exported method TxMessage.Encode should have comment or be unexported (golint)
    • Line 281: warning: exported method TxMessage.Hash should have comment or be unexported (golint)
    • Line 292: warning: exported method TxMessage.SHash should have comment or be unexported (golint)
    • Line 335: warning: exported method TxMessage.MsgType should have comment or be unexported (golint)
    • eccd/network/msg_whoamiack.go
    • Line 7: warning: exported type WhoamiAckMessage should have comment or be unexported (golint)
    • Line 10: warning: exported function NewWhoamiAckMessage should have comment or be unexported (golint)
    • Line 14: warning: exported method WhoamiAckMessage.Decode should have comment or be unexported (golint)
    • Line 18: warning: exported method WhoamiAckMessage.Encode should have comment or be unexported (golint)
    • Line 22: warning: exported method WhoamiAckMessage.MsgType should have comment or be unexported (golint)
    • eccd/utils/hash.go
    • Line 9: warning: exported type Hash should have comment or be unexported (golint)
    • Line 11: warning: exported function NewHash should have comment or be unexported (golint)
    • Line 23: warning: exported method Hash.Big should have comment or be unexported (golint)
    • Line 27: warning: exported method Hash.IsEqual should have comment or be unexported (golint)
    • Line 31: warning: exported method Hash.Bytes should have comment or be unexported (golint)
    • Line 39: warning: exported function StringToHash should have comment or be unexported (golint)
    • Line 48: warning: exported function BigToHash should have comment or be unexported (golint)
    • eccd/blockchain/blockchain.go
    • Line 20: warning: exported type ValidationError should have comment or be unexported (golint)
    • Line 28: warning: exported type Config should have comment or be unexported (golint)
    • Line 34: warning: exported type BlockchainStats should have comment or be unexported (golint)
    • Line 39: warning: exported type Blockchain should have comment or be unexported (golint)
    • Line 55: warning: exported function NewBlockchain should have comment or be unexported (golint)
    • Line 82: warning: exported method Blockchain.Load should have comment or be unexported (golint)
    • Line 157: warning: exported method Blockchain.Stop should have comment or be unexported (golint)
    • Line 164: warning: exported method Blockchain.GenerateBlockLocator should have comment or be unexported (golint)
    • Line 211: warning: exported method Blockchain.FetchUtxos should have comment or be unexported (golint)
    • Line 256: warning: exported method Blockchain.FetchAllUtxos should have comment or be unexported (golint)
    • Line 321: warning: exported method Blockchain.FindBlockByHash should have comment or be unexported (golint)
    • Line 345: warning: exported method Blockchain.HaveBlock should have comment or be unexported (golint)
    • Line 360: warning: exported method Blockchain.FindBestBlock should have comment or be unexported (golint)
    • Line 407: warning: exported method Blockchain.FindBlockHashesStartingAt should have comment or be unexported (golint)
    • Line 422: warning: exported method Blockchain.CalcNextBlockDifficulty should have comment or be unexported (golint)
    • Line 506: warning: exported method Blockchain.ValidateBlock should have comment or be unexported (golint)
    • Line 561: warning: exported method Blockchain.Validatetx should have comment or be unexported (golint)
    • Line 609: warning: exported method Blockchain.GetAncestor should have comment or be unexported (golint)
    • Line 630: warning: exported method Blockchain.GetFollowing should have comment or be unexported (golint)
    • Line 674: warning: exported method Blockchain.FetchStxojEntry should have comment or be unexported (golint)
    • Line 707: warning: exported method Blockchain.GetBlockHashAtHeight should have comment or be unexported (golint)
    • Line 1036: warning: exported method Blockchain.FindOrphan should have comment or be unexported (golint)
    • Line 1060: warning: exported method Blockchain.ProcessBlock should have comment or be unexported (golint)
    • eccd/network/msg_block.go
    • Line 14: warning: exported type BlockHeader should have comment or be unexported (golint)
    • Line 140: warning: exported method BlockHeader.Hash should have comment or be unexported (golint)
    • Line 151: warning: exported method BlockHeader.HashString should have comment or be unexported (golint)
    • Line 155: warning: exported type BlockMessage should have comment or be unexported (golint)
    • Line 160: warning: exported function NewBlockMessage should have comment or be unexported (golint)
    • Line 164: warning: exported method BlockMessage.Decode should have comment or be unexported (golint)
    • Line 191: warning: exported method BlockMessage.Encode should have comment or be unexported (golint)
    • Line 212: warning: exported method BlockMessage.MsgType should have comment or be unexported (golint)
    • eccd/peer/peer.go
    • Line 12: warning: exported type PeerCallbacks should have comment or be unexported (golint)
    • Line 26: warning: exported type Config should have comment or be unexported (golint)
    • Line 30: warning: exported type Peer should have comment or be unexported (golint)
    • Line 45: warning: exported function NewPeer should have comment or be unexported (golint)
    • Line 57: warning: exported method Peer.Ingoing should have comment or be unexported (golint)
    • Line 61: warning: exported method Peer.Outgoing should have comment or be unexported (golint)
    • Line 65: warning: exported method Peer.Start should have comment or be unexported (golint)
    • Line 97: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 110: warning: exported method Peer.Stop should have comment or be unexported (golint)
    • Line 121: warning: exported method Peer.RemoteAddr should have comment or be unexported (golint)
    • Line 274: warning: exported method Peer.Send should have comment or be unexported (golint)
    • eccd/blockchain/block.go
    • Line 12: warning: exported var MaxTarget should have comment or be unexported (golint)
    • Line 14: warning: exported type Block should have comment or be unexported (golint)
    • Line 19: warning: exported function NewBlock should have comment or be unexported (golint)
    • Line 25: warning: exported function NewBlockFromBlockMessage should have comment or be unexported (golint)
    • Line 37: warning: exported method Block.Hash should have comment or be unexported (golint)
    • Line 41: warning: exported method Block.MarshalBinary should have comment or be unexported (golint)
    • Line 51: warning: exported method Block.UnmarshalBinary should have comment or be unexported (golint)
    • Line 65: warning: exported method Block.IsSane should have comment or be unexported (golint)
    • Line 120: warning: exported method Block.CalcBlockSubsidy should have comment or be unexported (golint)
    • Line 132: warning: exported method Block.GetWork should have comment or be unexported (golint)
    • Line 136: warning: exported function CheckProofOfWork should have comment or be unexported (golint)
    • eccd/blockchain/merkle_tree.go
    • Line 8: warning: exported function ComputeMerkleRoot should have comment or be unexported (golint)
    • Line 38: warning: exported function DoubleHash should have comment or be unexported (golint)
    • eccd/blockchain/utxos.go
    • Line 9: warning: exported type UtxoEntry should have comment or be unexported (golint)
    • Line 21: warning: exported function WriteUtxoEntry should have comment or be unexported (golint)
    • Line 49: warning: exported function ReadUtxoEntry should have comment or be unexported (golint)
    • Line 83: warning: exported method UtxoEntry.MarshalBinary should have comment or be unexported (golint)
    • Line 94: warning: exported method UtxoEntry.UnmarshalBinary should have comment or be unexported (golint)
    • Line 103: warning: exported method UtxoEntry.Amount should have comment or be unexported (golint)
    • Line 107: warning: exported method UtxoEntry.Script should have comment or be unexported (golint)
    • Line 111: warning: exported method UtxoEntry.BlockHeight should have comment or be unexported (golint)
    • Line 115: warning: exported method UtxoEntry.IsCoinBase should have comment or be unexported (golint)
    • Line 119: warning: exported type Utxos should have comment or be unexported (golint)
    • Line 129: warning: exported method Utxos.AddEntry should have comment or be unexported (golint)
    • Line 133: warning: exported method Utxos.AddEntryWithTx should have comment or be unexported (golint)
    • Line 144: warning: exported method Utxos.FindEntry should have comment or be unexported (golint)
    • Line 148: warning: exported method Utxos.RemoveEntry should have comment or be unexported (golint)
    • eccd/network/msg_getaddr.go
    • Line 7: warning: exported type GetAddrMessage should have comment or be unexported (golint)
    • Line 10: warning: exported function NewGetAddrMessage should have comment or be unexported (golint)
    • Line 14: warning: exported method GetAddrMessage.Decode should have comment or be unexported (golint)
    • Line 18: warning: exported method GetAddrMessage.Encode should have comment or be unexported (golint)
    • Line 22: warning: exported method GetAddrMessage.MsgType should have comment or be unexported (golint)
    • eccd/mempool/mempool.go
    • Line 14: warning: exported type Config should have comment or be unexported (golint)
    • Line 19: warning: exported type Mempool should have comment or be unexported (golint)
    • Line 30: warning: exported function NewMempool should have comment or be unexported (golint)
    • Line 43: warning: exported method Mempool.Start should have comment or be unexported (golint)
    • Line 47: warning: exported method Mempool.Stop should have comment or be unexported (golint)
    • Line 54: warning: exported method Mempool.FetchTxs should have comment or be unexported (golint)
    • Line 214: warning: exported method Mempool.ProcessOrphans should have comment or be unexported (golint)
    • Line 255: warning: exported method Mempool.ProcessTx should have comment or be unexported (golint)
    • Line 270: warning: exported method Mempool.RemoveTx should have comment or be unexported (golint)
    • Line 285: warning: exported method Mempool.FindTxByHash should have comment or be unexported (golint)
    • eccd/sssync/synchronizer.go
    • Line 15: warning: exported type Config should have comment or be unexported (golint)
    • Line 19: warning: exported type Synchronizer should have comment or be unexported (golint)
    • Line 31: warning: exported function NewSynchronizer should have comment or be unexported (golint)
    • Line 44: warning: exported method Synchronizer.Start should have comment or be unexported (golint)
    • Line 48: warning: exported method Synchronizer.Stop should have comment or be unexported (golint)
    • Line 57: warning: exported method Synchronizer.OnPushedBlock should have comment or be unexported (golint)
    • Line 83: warning: exported method Synchronizer.OnPoppedBlock should have comment or be unexported (golint)
    • Line 92: warning: exported method Synchronizer.HandleBlockInvVect should have comment or be unexported (golint)
    • Line 111: warning: exported method Synchronizer.HandleBlock should have comment or be unexported (golint)
    • Line 115: warning: exported method Synchronizer.ProcessBlock should have comment or be unexported (golint)
    • Line 130: warning: exported method Synchronizer.HandleReadyPeer should have comment or be unexported (golint)
    • Line 149: warning: exported method Synchronizer.HandleDisconnectedPeer should have comment or be unexported (golint)
    • eccd/network/msg_getblocks.go
    • Line 8: warning: exported type GetBlocksMessage should have comment or be unexported (golint)
    • Line 13: warning: exported function NewGetBlocksMessage should have comment or be unexported (golint)
    • Line 17: warning: exported method GetBlocksMessage.Decode should have comment or be unexported (golint)
    • Line 37: warning: exported method GetBlocksMessage.Encode should have comment or be unexported (golint)
    • Line 53: warning: exported method GetBlocksMessage.MsgType should have comment or be unexported (golint)
    • eccd/network/msg_notfound.go
    • Line 7: warning: exported type NotFoundMessage should have comment or be unexported (golint)
    • Line 11: warning: exported function NewNotFoundMessage should have comment or be unexported (golint)
    • Line 15: warning: exported method NotFoundMessage.Decode should have comment or be unexported (golint)
    • Line 33: warning: exported method NotFoundMessage.Encode should have comment or be unexported (golint)
    • Line 49: warning: exported method NotFoundMessage.MsgType should have comment or be unexported (golint)
    • eccd/network/utils.go
    • Line 10: warning: exported function ReadUint8 should have comment or be unexported (golint)
    • Line 20: warning: exported function WriteUint8 should have comment or be unexported (golint)
    • Line 29: warning: exported function ReadUint16 should have comment or be unexported (golint)
    • Line 41: warning: exported function WriteUint16 should have comment or be unexported (golint)
    • Line 51: warning: exported function ReadUint32 should have comment or be unexported (golint)
    • Line 63: warning: exported function WriteUint32 should have comment or be unexported (golint)
    • Line 73: warning: exported function ReadUint64 should have comment or be unexported (golint)
    • Line 85: warning: exported function WriteUint64 should have comment or be unexported (golint)
    • Line 95: warning: exported function ReadVarUint should have comment or be unexported (golint)
    • Line 126: warning: exported function WriteVarUint should have comment or be unexported (golint)
    • Line 157: warning: exported function ReadVarString should have comment or be unexported (golint)
    • Line 166: warning: exported function WriteVarString should have comment or be unexported (golint)
    • Line 175: warning: exported function ReadString should have comment or be unexported (golint)
    • Line 185: warning: exported function WriteString should have comment or be unexported (golint)
    • Line 191: warning: exported function ReadHash should have comment or be unexported (golint)
    • Line 200: warning: exported function WriteHash should have comment or be unexported (golint)
    • eccd/blockchain/tx.go
    • Line 8: warning: exported type Tx should have comment or be unexported (golint)
    • Line 12: warning: exported function NewTxFromTxMessage should have comment or be unexported (golint)
    • Line 18: warning: exported method Tx.Hash should have comment or be unexported (golint)
    • Line 22: warning: exported method Tx.SHash should have comment or be unexported (golint)
    • eccd/network/msg_getdata.go
    • Line 8: warning: exported type GetDataMessage should have comment or be unexported (golint)
    • Line 12: warning: exported function NewGetDataMessage should have comment or be unexported (golint)
    • Line 16: warning: exported method GetDataMessage.Decode should have comment or be unexported (golint)
    • Line 34: warning: exported method GetDataMessage.Encode should have comment or be unexported (golint)
    • Line 50: warning: exported method GetDataMessage.MsgType should have comment or be unexported (golint)
    • eccd/network/msg_getmempool.go
    • Line 7: warning: exported type GetMempoolMessage should have comment or be unexported (golint)
    • Line 10: warning: exported function NewGetMempoolMessage should have comment or be unexported (golint)
    • Line 14: warning: exported method GetMempoolMessage.Decode should have comment or be unexported (golint)
    • Line 18: warning: exported method GetMempoolMessage.Encode should have comment or be unexported (golint)
    • Line 22: warning: exported method GetMempoolMessage.MsgType should have comment or be unexported (golint)
    • eccd/network/msg_inv.go
    • Line 9: warning: exported type InvVectType should have comment or be unexported (golint)
    • Line 12: warning: exported const INV_VECT_TX should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported type InvVect should have comment or be unexported (golint)
    • Line 47: warning: exported type InvMessage should have comment or be unexported (golint)
    • Line 51: warning: exported function NewInvMessage should have comment or be unexported (golint)
    • Line 55: warning: exported method InvMessage.Decode should have comment or be unexported (golint)
    • Line 73: warning: exported method InvMessage.Encode should have comment or be unexported (golint)
    • Line 89: warning: exported method InvMessage.MsgType should have comment or be unexported (golint)
    • eccd/network/msg_minus1thats3.go
    • Line 7: warning: exported type MinusOneThatsThreeMessage should have comment or be unexported (golint)
    • Line 10: warning: exported function NewMinusOneThatsThreeMessage should have comment or be unexported (golint)
    • Line 14: warning: exported method MinusOneThatsThreeMessage.Decode should have comment or be unexported (golint)
    • Line 18: warning: exported method MinusOneThatsThreeMessage.Encode should have comment or be unexported (golint)
    • Line 22: warning: exported method MinusOneThatsThreeMessage.MsgType should have comment or be unexported (golint)
    • eccd/network/msg_whoami.go
    • Line 8: warning: exported type WhoamiMessage should have comment or be unexported (golint)
    • Line 14: warning: exported function NewWhoamiMessage should have comment or be unexported (golint)
    • Line 18: warning: exported method WhoamiMessage.Decode should have comment or be unexported (golint)
    • Line 49: warning: exported method WhoamiMessage.Encode should have comment or be unexported (golint)
    • Line 75: warning: exported method WhoamiMessage.MsgType should have comment or be unexported (golint)
    • eccd/scripts/opcodes.go
    • Line 3: warning: exported type Opcode should have comment or be unexported (golint)
    • Line 6: warning: exported const OP_FALSE should have comment (or a comment on this block) or be unexported (golint)
    • eccd/scripts/script.go
    • Line 10: warning: exported type Script should have comment or be unexported (golint)
    • Line 17: warning: exported function NewScript should have comment or be unexported (golint)
    • Line 31: warning: exported method Script.Validate should have comment or be unexported (golint)
    • eccd/network/msg_addr.go
    • Line 16: warning: exported function ReadAddress should have comment or be unexported (golint)
    • Line 39: warning: exported function WriteAddress should have comment or be unexported (golint)
    • Line 53: warning: exported type AddrMessage should have comment or be unexported (golint)
    • Line 57: warning: exported function NewAddrMessage should have comment or be unexported (golint)
    • Line 61: warning: exported method AddrMessage.Decode should have comment or be unexported (golint)
    • Line 79: warning: exported method AddrMessage.Encode should have comment or be unexported (golint)
    • Line 83: warning: exported method AddrMessage.MsgType 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!