Preparing report...

Report for github.com/gcash/bchd

(v0.19.0)

A+    Excellent!    Found 62 issues across 410 files

Tweet

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!


gofmt100%

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

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo84%

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.

    • peer/log.go
    • Line 147: warning: cyclomatic complexity 26 of function messageSummary() is high (> 15) (gocyclo)
    • mining/mining.go
    • Line 458: warning: cyclomatic complexity 37 of function (*BlkTmplGenerator).NewBlockTemplate() is high (> 15) (gocyclo)
    • integration/csv_fork_test.go
    • Line 424: warning: cyclomatic complexity 35 of function TestBIP0068AndBIP0112Activation() is high (> 15) (gocyclo)
    • Line 116: warning: cyclomatic complexity 24 of function TestBIP0113Activation() is high (> 15) (gocyclo)
    • txscript/engine.go
    • Line 542: warning: cyclomatic complexity 27 of function (*Engine).checkSignatureEncoding() is high (> 15) (gocyclo)
    • Line 879: warning: cyclomatic complexity 18 of function NewEngine() is high (> 15) (gocyclo)
    • rpcwebsocket.go
    • Line 1306: warning: cyclomatic complexity 83 of function (*wsClient).inHandler() is high (> 15) (gocyclo)
    • Line 482: warning: cyclomatic complexity 29 of function (*wsNotificationManager).notificationHandler() is high (> 15) (gocyclo)
    • Line 2611: warning: cyclomatic complexity 23 of function scanBlockChunks() is high (> 15) (gocyclo)
    • Line 2290: warning: cyclomatic complexity 22 of function rescanBlock() is high (> 15) (gocyclo)
    • Line 2800: warning: cyclomatic complexity 18 of function handleRescan() is high (> 15) (gocyclo)
    • peer/peer.go
    • Line 1461: warning: cyclomatic complexity 73 of function (*Peer).inHandler() is high (> 15) (gocyclo)
    • Line 1741: warning: cyclomatic complexity 27 of function (*Peer).queueHandler() is high (> 15) (gocyclo)
    • Line 1312: warning: cyclomatic complexity 24 of function (*Peer).stallHandler() is high (> 15) (gocyclo)
    • rpcserver.go
    • Line 1980: warning: cyclomatic complexity 45 of function chainErrToGBTErrString() is high (> 15) (gocyclo)
    • Line 3360: warning: cyclomatic complexity 39 of function handleSearchRawTransactions() is high (> 15) (gocyclo)
    • Line 4237: warning: cyclomatic complexity 36 of function (*rpcServer).jsonRPCRead() is high (> 15) (gocyclo)
    • Line 2838: warning: cyclomatic complexity 19 of function handleGetTxOutProof() is high (> 15) (gocyclo)
    • Line 527: warning: cyclomatic complexity 19 of function handleCreateRawTransaction() is high (> 15) (gocyclo)
    • Line 1898: warning: cyclomatic complexity 17 of function handleGetBlockTemplateRequest() is high (> 15) (gocyclo)
    • Line 409: warning: cyclomatic complexity 17 of function handleNode() is high (> 15) (gocyclo)
    • Line 2613: warning: cyclomatic complexity 16 of function handleGetRawTransaction() is high (> 15) (gocyclo)
    • Line 3223: warning: cyclomatic complexity 16 of function createVinListPrevOut() is high (> 15) (gocyclo)
    • netsync/manager.go
    • Line 1273: warning: cyclomatic complexity 34 of function (*SyncManager).handleInvMsg() is high (> 15) (gocyclo)
    • Line 794: warning: cyclomatic complexity 31 of function (*SyncManager).handleBlockMsg() is high (> 15) (gocyclo)
    • Line 1475: warning: cyclomatic complexity 25 of function (*SyncManager).blockHandler() is high (> 15) (gocyclo)
    • Line 1074: warning: cyclomatic complexity 19 of function (*SyncManager).handleHeadersMsg() is high (> 15) (gocyclo)
    • Line 322: warning: cyclomatic complexity 17 of function (*SyncManager).startSync() is high (> 15) (gocyclo)
    • server.go
    • Line 3116: warning: cyclomatic complexity 46 of function newServer() is high (> 15) (gocyclo)
    • Line 2002: warning: cyclomatic complexity 22 of function (*server).handleAddPeerMsg() is high (> 15) (gocyclo)
    • Line 2350: warning: cyclomatic complexity 21 of function (*server).handleQuery() is high (> 15) (gocyclo)
    • Line 2593: warning: cyclomatic complexity 21 of function (*server).peerHandler() is high (> 15) (gocyclo)
    • Line 3516: warning: cyclomatic complexity 20 of function initListeners() is high (> 15) (gocyclo)
    • Line 2180: warning: cyclomatic complexity 17 of function (*server).handleRelayInvMsg() is high (> 15) (gocyclo)
    • Line 1164: warning: cyclomatic complexity 17 of function (*serverPeer).OnGetCFHeaders() is high (> 15) (gocyclo)
    • Line 1281: warning: cyclomatic complexity 16 of function (*serverPeer).OnGetCFCheckpt() is high (> 15) (gocyclo)
    • database/ffldb/interface_test.go
    • Line 1688: warning: cyclomatic complexity 39 of function testClosedTxInterface() is high (> 15) (gocyclo)
    • Line 909: warning: cyclomatic complexity 35 of function testMetadataTxInterface() is high (> 15) (gocyclo)
    • Line 1221: warning: cyclomatic complexity 35 of function testFetchBlockIO() is high (> 15) (gocyclo)
    • Line 407: warning: cyclomatic complexity 34 of function testBucketInterface() is high (> 15) (gocyclo)
    • Line 1512: warning: cyclomatic complexity 30 of function testBlockIOTxInterface() is high (> 15) (gocyclo)
    • Line 642: warning: cyclomatic complexity 29 of function testMetadataManualTxInterface() is high (> 15) (gocyclo)
    • Line 1996: warning: cyclomatic complexity 24 of function testConcurrecy() is high (> 15) (gocyclo)
    • Line 263: warning: cyclomatic complexity 21 of function testCursorInterface() is high (> 15) (gocyclo)
    • wire/message.go
    • Line 105: warning: cyclomatic complexity 36 of function makeEmptyMessage() is high (> 15) (gocyclo)
    • blockchain/chain.go
    • Line 960: warning: cyclomatic complexity 32 of function (*BlockChain).reorganizeChain() is high (> 15) (gocyclo)
    • Line 2224: warning: cyclomatic complexity 29 of function New() is high (> 15) (gocyclo)
    • Line 1233: warning: cyclomatic complexity 19 of function (*BlockChain).connectBestChain() is high (> 15) (gocyclo)
    • Line 680: warning: cyclomatic complexity 18 of function (*BlockChain).connectBlock() is high (> 15) (gocyclo)
    • wire/msgtx.go
    • Line 356: warning: cyclomatic complexity 19 of function (*MsgTx).BchDecode() is high (> 15) (gocyclo)
    • bchrpc/server.go
    • Line 1606: warning: cyclomatic complexity 71 of function (*GrpcServer).checkTransactionSlpValidity() is high (> 15) (gocyclo)
    • Line 3143: warning: cyclomatic complexity 58 of function marshalTransaction() is high (> 15) (gocyclo)
    • Line 1899: warning: cyclomatic complexity 48 of function (*GrpcServer).getSlpIndexEntryAndCheckBurnOtherToken() is high (> 15) (gocyclo)
    • Line 951: warning: cyclomatic complexity 38 of function (*GrpcServer).GetAddressUnspentOutputs() is high (> 15) (gocyclo)
    • Line 1366: warning: cyclomatic complexity 35 of function (*GrpcServer).GetSlpTrustedValidation() is high (> 15) (gocyclo)
    • Line 2396: warning: cyclomatic complexity 34 of function (*GrpcServer).SubscribeBlocks() is high (> 15) (gocyclo)
    • Line 2246: warning: cyclomatic complexity 29 of function (*GrpcServer).SubscribeTransactionStream() is high (> 15) (gocyclo)
    • Line 2819: warning: cyclomatic complexity 28 of function (*GrpcServer).getSlpToken() is high (> 15) (gocyclo)
    • Line 663: warning: cyclomatic complexity 24 of function (*GrpcServer).GetTransaction() is high (> 15) (gocyclo)
    • Line 2117: warning: cyclomatic complexity 23 of function (*GrpcServer).SubscribeTransactions() is high (> 15) (gocyclo)
    • Line 1108: warning: cyclomatic complexity 23 of function (*GrpcServer).GetUnspentOutput() is high (> 15) (gocyclo)
    • Line 805: warning: cyclomatic complexity 18 of function (*GrpcServer).GetAddressTransactions() is high (> 15) (gocyclo)
    • blockchain/validate.go
    • Line 963: warning: cyclomatic complexity 36 of function (*BlockChain).checkConnectBlock() is high (> 15) (gocyclo)
    • Line 238: warning: cyclomatic complexity 18 of function CheckTransactionSanity() is high (> 15) (gocyclo)
    • Line 699: warning: cyclomatic complexity 16 of function (*BlockChain).checkBlockContext() is high (> 15) (gocyclo)
    • blockchain/fullblocks_test.go
    • Line 136: warning: cyclomatic complexity 23 of function TestFullBlocks() is high (> 15) (gocyclo)
    • Line 316: warning: cyclomatic complexity 16 of function TestCTORActivation() is high (> 15) (gocyclo)
    • bchd.go
    • Line 45: warning: cyclomatic complexity 20 of function bchdMain() is high (> 15) (gocyclo)
    • blockchain/indexers/slpindex.go
    • Line 829: warning: cyclomatic complexity 43 of function CheckSlpTx() is high (> 15) (gocyclo)
    • Line 660: warning: cyclomatic complexity 19 of function (*SlpIndex).LoadSlpGraphSearchDb() is high (> 15) (gocyclo)
    • Line 537: warning: cyclomatic complexity 17 of function (*SlpIndex).ConnectBlock() is high (> 15) (gocyclo)
    • Line 1052: warning: cyclomatic complexity 16 of function (*SlpIndex).AddPotentialSlpEntries() is high (> 15) (gocyclo)
    • wire/common.go
    • Line 191: warning: cyclomatic complexity 34 of function readElement() is high (> 15) (gocyclo)
    • Line 347: warning: cyclomatic complexity 30 of function writeElement() is high (> 15) (gocyclo)
    • blockchain/fullblocktests/generate.go
    • Line 2491: warning: cyclomatic complexity 35 of function GeneratePhononBlocks() is high (> 15) (gocyclo)
    • Line 764: warning: cyclomatic complexity 24 of function Generate() is high (> 15) (gocyclo)
    • Line 2291: warning: cyclomatic complexity 19 of function GenerateGravitonTestBlocks() is high (> 15) (gocyclo)
    • Line 2858: warning: cyclomatic complexity 19 of function GenerateCosmicInflationBlocks() is high (> 15) (gocyclo)
    • netsync/manager_test.go
    • Line 244: warning: cyclomatic complexity 47 of function TestBlockchainSync() is high (> 15) (gocyclo)
    • Line 512: warning: cyclomatic complexity 37 of function TestMempoolSync() is high (> 15) (gocyclo)
    • Line 128: warning: cyclomatic complexity 21 of function TestPeerConnections() is high (> 15) (gocyclo)
    • addrmgr/addrmanager.go
    • Line 443: warning: cyclomatic complexity 22 of function (*AddrManager).deserializePeers() is high (> 15) (gocyclo)
    • Line 1023: warning: cyclomatic complexity 20 of function getReachabilityFrom() is high (> 15) (gocyclo)
    • bchrpc/txfilter.go
    • Line 236: warning: cyclomatic complexity 31 of function (*txFilter).MatchAndUpdate() is high (> 15) (gocyclo)
    • txscript/opcode.go
    • Line 2472: warning: cyclomatic complexity 64 of function opcodeCheckMultiSig() is high (> 15) (gocyclo)
    • Line 2319: warning: cyclomatic complexity 21 of function opcodeCheckSig() is high (> 15) (gocyclo)
    • Line 2848: warning: cyclomatic complexity 20 of function opcodeCheckDataSig() is high (> 15) (gocyclo)
    • Line 679: warning: cyclomatic complexity 16 of function (*parsedOpcode).checkMinimalDataPush() is high (> 15) (gocyclo)
    • txscript/reference_test.go
    • Line 210: warning: cyclomatic complexity 38 of function parseExpectedResult() is high (> 15) (gocyclo)
    • Line 502: warning: cyclomatic complexity 26 of function TestTxInvalidTests() is high (> 15) (gocyclo)
    • Line 658: warning: cyclomatic complexity 26 of function TestTxValidTests() is high (> 15) (gocyclo)
    • Line 150: warning: cyclomatic complexity 24 of function parseScriptFlags() is high (> 15) (gocyclo)
    • Line 335: warning: cyclomatic complexity 22 of function testScripts() is high (> 15) (gocyclo)
    • Line 88: warning: cyclomatic complexity 18 of function parseShortForm() is high (> 15) (gocyclo)
    • mempool/mempool.go
    • Line 717: warning: cyclomatic complexity 41 of function (*TxPool).maybeAcceptTransaction() is high (> 15) (gocyclo)
    • config.go
    • Line 446: warning: cyclomatic complexity 133 of function loadConfig() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!