Preparing report...

Report for github.com/aviator-coding/bchd

A+    Excellent!    Found 87 issues across 398 files

Tweet

gofmt91%

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!


golint99%

Golint is a linter for Go source code.

    • bchd/txscript/opcode.go
    • Line 37: warning: don't use underscores in Go names; const OP_0 should be OP0 (golint)
    • Line 119: warning: don't use underscores in Go names; const OP_1 should be OP1 (golint)
    • Line 121: warning: don't use underscores in Go names; const OP_2 should be OP2 (golint)
    • Line 122: warning: don't use underscores in Go names; const OP_3 should be OP3 (golint)
    • Line 123: warning: don't use underscores in Go names; const OP_4 should be OP4 (golint)
    • Line 124: warning: don't use underscores in Go names; const OP_5 should be OP5 (golint)
    • Line 125: warning: don't use underscores in Go names; const OP_6 should be OP6 (golint)
    • Line 126: warning: don't use underscores in Go names; const OP_7 should be OP7 (golint)
    • Line 127: warning: don't use underscores in Go names; const OP_8 should be OP8 (golint)
    • Line 128: warning: don't use underscores in Go names; const OP_9 should be OP9 (golint)

gocyclo85%

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.

    • bchd/txscript/opcode.go
    • Line 2378: warning: cyclomatic complexity 63 of function opcodeCheckMultiSig() is high (> 15) (gocyclo)
    • Line 2226: warning: cyclomatic complexity 21 of function opcodeCheckSig() is high (> 15) (gocyclo)
    • Line 2745: warning: cyclomatic complexity 20 of function opcodeCheckDataSig() is high (> 15) (gocyclo)
    • Line 677: warning: cyclomatic complexity 16 of function (*parsedOpcode).checkMinimalDataPush() is high (> 15) (gocyclo)
    • bchd/txscript/engine.go
    • Line 505: warning: cyclomatic complexity 27 of function (*Engine).checkSignatureEncoding() is high (> 15) (gocyclo)
    • Line 842: warning: cyclomatic complexity 17 of function NewEngine() is high (> 15) (gocyclo)
    • bchd/rpcserver.go
    • Line 1993: warning: cyclomatic complexity 45 of function chainErrToGBTErrString() is high (> 15) (gocyclo)
    • Line 4305: warning: cyclomatic complexity 40 of function (*rpcServer).jsonRPCRead() is high (> 15) (gocyclo)
    • Line 3373: warning: cyclomatic complexity 39 of function handleSearchRawTransactions() is high (> 15) (gocyclo)
    • Line 532: warning: cyclomatic complexity 20 of function handleCreateRawTransaction() is high (> 15) (gocyclo)
    • Line 414: warning: cyclomatic complexity 19 of function handleNode() is high (> 15) (gocyclo)
    • Line 2851: warning: cyclomatic complexity 19 of function handleGetTxOutProof() is high (> 15) (gocyclo)
    • Line 1911: warning: cyclomatic complexity 17 of function handleGetBlockTemplateRequest() is high (> 15) (gocyclo)
    • Line 2626: warning: cyclomatic complexity 16 of function handleGetRawTransaction() is high (> 15) (gocyclo)
    • Line 3236: warning: cyclomatic complexity 16 of function createVinListPrevOut() is high (> 15) (gocyclo)
    • Line 930: warning: cyclomatic complexity 16 of function handleGetAddedNodeInfo() is high (> 15) (gocyclo)
    • bchd/blockchain/fullblocktests/generate.go
    • Line 812: warning: cyclomatic complexity 27 of function Generate() is high (> 15) (gocyclo)
    • Line 2475: warning: cyclomatic complexity 20 of function GenerateGravitonTestBlocks() is high (> 15) (gocyclo)
    • Line 2326: warning: cyclomatic complexity 16 of function GenerateGreatWallTestBlocks() is high (> 15) (gocyclo)
    • bchd/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)
    • bchd/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)
    • bchd/bchd.go
    • Line 45: warning: cyclomatic complexity 18 of function bchdMain() is high (> 15) (gocyclo)
    • bchd/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)
    • bchd/netsync/manager.go
    • Line 1171: warning: cyclomatic complexity 35 of function (*SyncManager).handleInvMsg() is high (> 15) (gocyclo)
    • Line 698: warning: cyclomatic complexity 30 of function (*SyncManager).handleBlockMsg() is high (> 15) (gocyclo)
    • Line 1373: warning: cyclomatic complexity 26 of function (*SyncManager).blockHandler() is high (> 15) (gocyclo)
    • Line 978: warning: cyclomatic complexity 18 of function (*SyncManager).handleHeadersMsg() is high (> 15) (gocyclo)
    • Line 311: warning: cyclomatic complexity 16 of function (*SyncManager).startSync() is high (> 15) (gocyclo)
    • bchd/blockchain/validate.go
    • Line 1073: warning: cyclomatic complexity 38 of function (*BlockChain).checkConnectBlock() is high (> 15) (gocyclo)
    • Line 246: warning: cyclomatic complexity 19 of function CheckTransactionSanity() is high (> 15) (gocyclo)
    • Line 809: warning: cyclomatic complexity 16 of function (*BlockChain).checkBlockContext() is high (> 15) (gocyclo)
    • bchd/config.go
    • Line 428: warning: cyclomatic complexity 124 of function loadConfig() is high (> 15) (gocyclo)
    • bchd/server.go
    • Line 3042: warning: cyclomatic complexity 42 of function newServer() is high (> 15) (gocyclo)
    • Line 2533: warning: cyclomatic complexity 22 of function (*server).peerHandler() is high (> 15) (gocyclo)
    • Line 2296: warning: cyclomatic complexity 21 of function (*server).handleQuery() is high (> 15) (gocyclo)
    • Line 3412: warning: cyclomatic complexity 20 of function initListeners() is high (> 15) (gocyclo)
    • Line 1149: warning: cyclomatic complexity 18 of function (*serverPeer).OnGetCFHeaders() is high (> 15) (gocyclo)
    • Line 2126: warning: cyclomatic complexity 17 of function (*server).handleRelayInvMsg() is high (> 15) (gocyclo)
    • Line 1266: warning: cyclomatic complexity 17 of function (*serverPeer).OnGetCFCheckpt() is high (> 15) (gocyclo)
    • bchd/blockchain/chain.go
    • Line 952: warning: cyclomatic complexity 32 of function (*BlockChain).reorganizeChain() is high (> 15) (gocyclo)
    • Line 2214: warning: cyclomatic complexity 28 of function New() is high (> 15) (gocyclo)
    • Line 1223: warning: cyclomatic complexity 19 of function (*BlockChain).connectBestChain() is high (> 15) (gocyclo)
    • Line 676: warning: cyclomatic complexity 18 of function (*BlockChain).connectBlock() is high (> 15) (gocyclo)
    • bchd/txscript/reference_test.go
    • Line 208: warning: cyclomatic complexity 38 of function parseExpectedResult() is high (> 15) (gocyclo)
    • Line 655: warning: cyclomatic complexity 26 of function TestTxValidTests() is high (> 15) (gocyclo)
    • Line 499: warning: cyclomatic complexity 26 of function TestTxInvalidTests() is high (> 15) (gocyclo)
    • Line 150: warning: cyclomatic complexity 24 of function parseScriptFlags() is high (> 15) (gocyclo)
    • Line 333: warning: cyclomatic complexity 22 of function testScripts() is high (> 15) (gocyclo)
    • Line 88: warning: cyclomatic complexity 18 of function parseShortForm() is high (> 15) (gocyclo)
    • bchd/netsync/manager_test.go
    • Line 244: warning: cyclomatic complexity 51 of function TestBlockchainSync() is high (> 15) (gocyclo)
    • Line 512: warning: cyclomatic complexity 41 of function TestMempoolSync() is high (> 15) (gocyclo)
    • Line 128: warning: cyclomatic complexity 21 of function TestPeerConnections() is high (> 15) (gocyclo)
    • bchd/integration/csv_fork_test.go
    • Line 423: warning: cyclomatic complexity 35 of function TestBIP0068AndBIP0112Activation() is high (> 15) (gocyclo)
    • Line 115: warning: cyclomatic complexity 24 of function TestBIP0113Activation() is high (> 15) (gocyclo)
    • bchd/peer/peer.go
    • Line 1446: warning: cyclomatic complexity 81 of function (*Peer).inHandler() is high (> 15) (gocyclo)
    • Line 1737: warning: cyclomatic complexity 28 of function (*Peer).queueHandler() is high (> 15) (gocyclo)
    • Line 1297: warning: cyclomatic complexity 27 of function (*Peer).stallHandler() is high (> 15) (gocyclo)
    • bchd/rpcwebsocket.go
    • Line 1306: warning: cyclomatic complexity 84 of function (*wsClient).inHandler() is high (> 15) (gocyclo)
    • Line 2617: warning: cyclomatic complexity 37 of function handleRescan() is high (> 15) (gocyclo)
    • Line 482: warning: cyclomatic complexity 30 of function (*wsNotificationManager).notificationHandler() is high (> 15) (gocyclo)
    • Line 2290: warning: cyclomatic complexity 22 of function rescanBlock() is high (> 15) (gocyclo)
    • bchd/bchrpc/server.go
    • Line 1399: warning: cyclomatic complexity 34 of function (*GrpcServer).SubscribeBlocks() is high (> 15) (gocyclo)
    • Line 1260: warning: cyclomatic complexity 26 of function (*GrpcServer).SubscribeTransactionStream() is high (> 15) (gocyclo)
    • Line 1139: warning: cyclomatic complexity 21 of function (*GrpcServer).SubscribeTransactions() is high (> 15) (gocyclo)
    • Line 867: warning: cyclomatic complexity 19 of function (*GrpcServer).GetAddressUnspentOutputs() is high (> 15) (gocyclo)

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!