Preparing report...

Report for github.com/ibrahimsn98/blockchain-in-go

A    Great!    Found 16 issues across 16 files

Tweet

gofmt87%

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!


gocyclo93%

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.


golint6%

Golint is a linter for Go source code.

    • blockchain-in-go/cli/cli.go
    • Line 15: warning: comment on exported type CommandLine should be of the form "CommandLine ..." (with optional leading article) (golint)
    • Line 38: warning: comment on exported method CommandLine.StartNode should be of the form "StartNode ..." (golint)
    • Line 200: warning: comment on exported method CommandLine.Run should be of the form "Run ..." (golint)
    • blockchain-in-go/network/models.go
    • Line 3: warning: exported type Addr should have comment or be unexported (golint)
    • Line 7: warning: exported type Block should have comment or be unexported (golint)
    • Line 12: warning: exported type GetBlocks should have comment or be unexported (golint)
    • Line 16: warning: exported type GetData should have comment or be unexported (golint)
    • Line 22: warning: exported type Inv should have comment or be unexported (golint)
    • Line 28: warning: exported type Tx should have comment or be unexported (golint)
    • Line 33: warning: exported type Version should have comment or be unexported (golint)
    • blockchain-in-go/blockchain/merkle.go
    • Line 8: warning: exported type MerkleTree should have comment or be unexported (golint)
    • Line 12: warning: exported type MerkleNode should have comment or be unexported (golint)
    • Line 18: warning: exported function NewMerkleNode should have comment or be unexported (golint)
    • Line 36: warning: exported function NewMerkleTree should have comment or be unexported (golint)
    • blockchain-in-go/blockchain/proof.go
    • Line 13: warning: comment on exported const Difficulty should be of the form "Difficulty ..." (golint)
    • Line 16: warning: comment on exported type ProofOfWork should be of the form "ProofOfWork ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported function NewProof should be of the form "NewProof ..." (golint)
    • Line 32: warning: exported method ProofOfWork.InitData should have comment or be unexported (golint)
    • Line 46: warning: exported method ProofOfWork.Run should have comment or be unexported (golint)
    • Line 72: warning: exported method ProofOfWork.Validate should have comment or be unexported (golint)
    • Line 83: warning: exported function ToHex should have comment or be unexported (golint)
    • blockchain-in-go/database/database.go
    • Line 12: warning: exported type Database should have comment or be unexported (golint)
    • Line 16: warning: exported function GetDatabase should have comment or be unexported (golint)
    • Line 29: 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)
    • Line 34: warning: exported method Database.Iterator should have comment or be unexported (golint)
    • Line 65: warning: exported method Database.Update should have comment or be unexported (golint)
    • blockchain-in-go/wallet/wallets.go
    • Line 15: warning: exported type Wallets should have comment or be unexported (golint)
    • Line 19: warning: exported function CreateWallets should have comment or be unexported (golint)
    • Line 28: warning: exported method Wallets.AddWallet should have comment or be unexported (golint)
    • Line 37: warning: exported method Wallets.GetAllAddresses should have comment or be unexported (golint)
    • Line 47: warning: exported method Wallets.GetWallet should have comment or be unexported (golint)
    • Line 51: warning: exported method Wallets.LoadFile should have comment or be unexported (golint)
    • Line 76: warning: exported method Wallets.SaveFile should have comment or be unexported (golint)
    • blockchain-in-go/blockchain/blockchain.go
    • Line 20: warning: exported type BlockChain should have comment or be unexported (golint)
    • Line 25: warning: exported type ChainIterator should have comment or be unexported (golint)
    • Line 30: warning: exported function DBExists should have comment or be unexported (golint)
    • Line 38: warning: exported function InitBlockChain should have comment or be unexported (golint)
    • Line 70: warning: exported function ContinueBlockChain should have comment or be unexported (golint)
    • Line 89: warning: exported method BlockChain.MineBlock should have comment or be unexported (golint)
    • Line 123: warning: exported method BlockChain.AddBlock should have comment or be unexported (golint)
    • Line 155: warning: exported method BlockChain.GetBlockHashes should have comment or be unexported (golint)
    • Line 173: warning: exported method BlockChain.GetBlock should have comment or be unexported (golint)
    • Line 183: warning: exported method BlockChain.GetBestHeight should have comment or be unexported (golint)
    • Line 195: warning: exported method BlockChain.Iterator should have comment or be unexported (golint)
    • Line 199: warning: exported method ChainIterator.Next should have comment or be unexported (golint)
    • Line 209: warning: comment on exported method BlockChain.FindUTXO should be of the form "FindUTXO ..." (golint)
    • Line 255: warning: exported method BlockChain.FindUnspentTransactions should have comment or be unexported (golint)
    • Line 302: warning: exported method BlockChain.FindSpendableOutputs should have comment or be unexported (golint)
    • Line 326: warning: exported method BlockChain.FindTransaction should have comment or be unexported (golint)
    • Line 346: warning: exported method BlockChain.SignTransaction should have comment or be unexported (golint)
    • Line 359: warning: exported method BlockChain.VerifyTransaction should have comment or be unexported (golint)
    • blockchain-in-go/blockchain/tx.go
    • Line 9: warning: exported type TxOutput should have comment or be unexported (golint)
    • Line 14: warning: exported type TxOutputs should have comment or be unexported (golint)
    • Line 18: warning: exported type TxInput should have comment or be unexported (golint)
    • Line 25: warning: exported method TxInput.UsesKey should have comment or be unexported (golint)
    • Line 31: warning: exported method TxOutput.Lock should have comment or be unexported (golint)
    • Line 37: warning: exported method TxOutput.IsLockedWithKey should have comment or be unexported (golint)
    • Line 41: warning: exported function NewTXOutput should have comment or be unexported (golint)
    • Line 48: warning: exported method TxOutputs.Serialize should have comment or be unexported (golint)
    • Line 56: warning: exported function DeserializeOutputs should have comment or be unexported (golint)
    • blockchain-in-go/wallet/wallet.go
    • Line 19: warning: exported type Wallet should have comment or be unexported (golint)
    • Line 24: warning: exported method Wallet.Address should have comment or be unexported (golint)
    • Line 43: warning: exported function ValidateAddress should have comment or be unexported (golint)
    • Line 62: warning: exported function NewKeyPair should have comment or be unexported (golint)
    • Line 77: warning: exported function MakeWallet should have comment or be unexported (golint)
    • Line 84: warning: exported function PublicKeyHash should have comment or be unexported (golint)
    • Line 100: warning: exported function Checksum should have comment or be unexported (golint)
    • blockchain-in-go/network/util.go
    • Line 10: warning: comment on exported function CmdToBytes should be of the form "CmdToBytes ..." (golint)
    • Line 21: warning: comment on exported function BytesToCmd should be of the form "BytesToCmd ..." (golint)
    • Line 34: warning: comment on exported function GobEncode should be of the form "GobEncode ..." (golint)
    • blockchain-in-go/blockchain/utxo.go
    • Line 14: warning: exported type UTXOSet should have comment or be unexported (golint)
    • Line 18: warning: exported method UTXOSet.FindSpendableOutputs should have comment or be unexported (golint)
    • Line 54: warning: exported method UTXOSet.FindUnspentTransactions should have comment or be unexported (golint)
    • Line 88: warning: exported method UTXOSet.FindUTXO should have comment or be unexported (golint)
    • Line 124: warning: exported method UTXOSet.CountTransactions should have comment or be unexported (golint)
    • Line 141: warning: exported method UTXOSet.Reindex should have comment or be unexported (golint)
    • Line 165: warning: exported method UTXOSet.Update should have comment or be unexported (golint)
    • Line 220: warning: exported method UTXOSet.DeleteByPrefix should have comment or be unexported (golint)
    • blockchain-in-go/blockchain/transaction.go
    • Line 19: warning: exported type Transaction should have comment or be unexported (golint)
    • Line 25: warning: exported method Transaction.Hash should have comment or be unexported (golint)
    • Line 46: warning: exported method Transaction.Serialize should have comment or be unexported (golint)
    • Line 58: warning: exported function DeserializeTransaction should have comment or be unexported (golint)
    • Line 68: warning: exported function CoinbaseTx should have comment or be unexported (golint)
    • Line 85: warning: exported function NewTransaction should have comment or be unexported (golint)
    • Line 121: warning: exported method Transaction.IsCoinbase should have comment or be unexported (golint)
    • Line 125: warning: exported method Transaction.Sign should have comment or be unexported (golint)
    • Line 154: warning: exported method Transaction.Verify should have comment or be unexported (golint)
    • Line 198: warning: exported method Transaction.TrimmedCopy should have comment or be unexported (golint)
    • blockchain-in-go/network/network.go
    • Line 28: warning: exported var KnownNodes should have comment or be unexported (golint)
    • Line 33: warning: exported function RequestBlocks should have comment or be unexported (golint)
    • Line 39: warning: exported function SendBlock should have comment or be unexported (golint)
    • Line 49: warning: exported function SendData should have comment or be unexported (golint)
    • Line 80: warning: exported function SendInv should have comment or be unexported (golint)
    • Line 90: warning: exported function SendGetBlocks should have comment or be unexported (golint)
    • Line 99: warning: exported function SendGetData should have comment or be unexported (golint)
    • Line 108: warning: exported function SendTx should have comment or be unexported (golint)
    • Line 118: warning: exported function SendVersion should have comment or be unexported (golint)
    • Line 129: warning: exported function HandleAddr should have comment or be unexported (golint)
    • Line 147: warning: exported function HandleBlock should have comment or be unexported (golint)
    • Line 177: warning: exported function HandleInv should have comment or be unexported (golint)
    • Line 216: warning: exported function HandleGetBlocks should have comment or be unexported (golint)
    • Line 234: warning: exported function HandleGetData should have comment or be unexported (golint)
    • Line 264: warning: exported function HandleTx should have comment or be unexported (golint)
    • Line 297: warning: exported function MineTx should have comment or be unexported (golint)
    • Line 338: warning: exported function HandleVersion should have comment or be unexported (golint)
    • Line 368: warning: exported function HandleConnection should have comment or be unexported (golint)
    • Line 399: warning: exported function StartServer should have comment or be unexported (golint)
    • Line 440: warning: exported function NodeIsKnown should have comment or be unexported (golint)
    • Line 450: warning: exported function CloseDB should have comment or be unexported (golint)
    • blockchain-in-go/blockchain/block.go
    • Line 10: warning: exported type Block should have comment or be unexported (golint)
    • Line 19: warning: exported method Block.HashTransactions should have comment or be unexported (golint)
    • Line 30: warning: exported function CreateBlock should have comment or be unexported (golint)
    • Line 41: warning: exported function Genesis should have comment or be unexported (golint)
    • Line 45: warning: exported method Block.Serialize should have comment or be unexported (golint)
    • Line 56: warning: exported function Deserialize should have comment or be unexported (golint)
    • Line 68: warning: exported function Handle 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!