Preparing report...

Report for github.com/error2215/go-core

(v0.0.0-20201211080316-e7872729012a)

A+    Excellent!    Found 202 issues across 995 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!


gofmt93%

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


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo86%

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.

    • cmd/puppeth/wizard_netstats.go
    • Line 201: warning: cyclomatic complexity 28 of function (serverStats).render() is high (> 15) (gocyclo)
    • Line 73: warning: cyclomatic complexity 23 of function (*wizard).gatherStats() is high (> 15) (gocyclo)
    • les/sync.go
    • Line 90: warning: cyclomatic complexity 20 of function (*clientHandler).synchronise() is high (> 15) (gocyclo)
    • eth/downloader/downloader.go
    • Line 754: warning: cyclomatic complexity 43 of function (*Downloader).findAncestor() is high (> 15) (gocyclo)
    • Line 969: warning: cyclomatic complexity 42 of function (*Downloader).fetchHeaders() is high (> 15) (gocyclo)
    • Line 1482: warning: cyclomatic complexity 42 of function (*Downloader).processHeaders() is high (> 15) (gocyclo)
    • Line 1307: warning: cyclomatic complexity 40 of function (*Downloader).fetchParts() is high (> 15) (gocyclo)
    • Line 435: warning: cyclomatic complexity 26 of function (*Downloader).syncWithPeer() is high (> 15) (gocyclo)
    • Line 1709: warning: cyclomatic complexity 21 of function (*Downloader).processFastSyncContent() is high (> 15) (gocyclo)
    • Line 634: warning: cyclomatic complexity 18 of function (*Downloader).fetchHead() is high (> 15) (gocyclo)
    • core/bloombits/matcher.go
    • Line 259: warning: cyclomatic complexity 30 of function (*Matcher).subMatch() is high (> 15) (gocyclo)
    • Line 381: warning: cyclomatic complexity 23 of function (*Matcher).distributor() is high (> 15) (gocyclo)
    • les/distributor.go
    • Line 192: warning: cyclomatic complexity 18 of function (*requestDistributor).nextRequest() is high (> 15) (gocyclo)
    • cmd/utils/flags.go
    • Line 1488: warning: cyclomatic complexity 54 of function SetEthConfig() is high (> 15) (gocyclo)
    • Line 1132: warning: cyclomatic complexity 28 of function SetP2PConfig() is high (> 15) (gocyclo)
    • Line 1814: warning: cyclomatic complexity 16 of function MakeChain() is high (> 15) (gocyclo)
    • les/api_test.go
    • Line 94: warning: cyclomatic complexity 45 of function testCapacityAPI() is high (> 15) (gocyclo)
    • les/api.go
    • Line 110: warning: cyclomatic complexity 16 of function (*PrivateLightServerAPI).setParams() is high (> 15) (gocyclo)
    • Line 217: warning: cyclomatic complexity 16 of function (*PrivateLightServerAPI).Benchmark() is high (> 15) (gocyclo)
    • eth/handler.go
    • Line 381: warning: cyclomatic complexity 118 of function (*ProtocolManager).handleMsg() is high (> 15) (gocyclo)
    • core/state/sync_test.go
    • Line 163: warning: cyclomatic complexity 17 of function testIterativeStateSync() is high (> 15) (gocyclo)
    • Line 401: warning: cyclomatic complexity 17 of function TestIncompleteStateSync() is high (> 15) (gocyclo)
    • rlp/encode.go
    • Line 330: warning: cyclomatic complexity 17 of function makeWriter() is high (> 15) (gocyclo)
    • trie/proof_test.go
    • Line 511: warning: cyclomatic complexity 18 of function TestBadRangeProof() is high (> 15) (gocyclo)
    • Line 193: warning: cyclomatic complexity 17 of function TestRangeProofWithNonExistentProof() is high (> 15) (gocyclo)
    • trie/proof.go
    • Line 219: warning: cyclomatic complexity 26 of function unsetInternal() is high (> 15) (gocyclo)
    • Line 457: warning: cyclomatic complexity 24 of function VerifyRangeProof() is high (> 15) (gocyclo)
    • Line 137: warning: cyclomatic complexity 16 of function proofToPath() is high (> 15) (gocyclo)
    • eth/api_tracer.go
    • Line 141: warning: cyclomatic complexity 38 of function (*PrivateDebugAPI).traceChain() is high (> 15) (gocyclo)
    • Line 523: warning: cyclomatic complexity 22 of function (*PrivateDebugAPI).standardTraceBlockToFile() is high (> 15) (gocyclo)
    • core/tx_pool_test.go
    • Line 870: warning: cyclomatic complexity 29 of function testTransactionQueueTimeLimiting() is high (> 15) (gocyclo)
    • Line 567: warning: cyclomatic complexity 28 of function TestTransactionPostponing() is high (> 15) (gocyclo)
    • Line 1241: warning: cyclomatic complexity 24 of function TestTransactionPoolRepricing() is high (> 15) (gocyclo)
    • Line 1424: warning: cyclomatic complexity 20 of function TestTransactionPoolUnderpricing() is high (> 15) (gocyclo)
    • Line 1744: warning: cyclomatic complexity 19 of function testTransactionJournaling() is high (> 15) (gocyclo)
    • Line 472: warning: cyclomatic complexity 19 of function TestTransactionDropping() is high (> 15) (gocyclo)
    • Line 1661: warning: cyclomatic complexity 17 of function TestTransactionReplacement() is high (> 15) (gocyclo)
    • Line 1595: warning: cyclomatic complexity 17 of function TestTransactionDeduplication() is high (> 15) (gocyclo)
    • core/blockchain_test.go
    • Line 591: warning: cyclomatic complexity 28 of function TestFastVsFullChains() is high (> 15) (gocyclo)
    • Line 2072: warning: cyclomatic complexity 28 of function TestTransactionIndices() is high (> 15) (gocyclo)
    • Line 2199: warning: cyclomatic complexity 21 of function TestSkipStaleTxIndicesInFastSync() is high (> 15) (gocyclo)
    • Line 2725: warning: cyclomatic complexity 19 of function TestDeleteRecreateSlotsAcrossManyBlocks() is high (> 15) (gocyclo)
    • Line 1831: warning: cyclomatic complexity 18 of function testInsertKnownChainData() is high (> 15) (gocyclo)
    • Line 823: warning: cyclomatic complexity 17 of function TestChainTxReorgs() is high (> 15) (gocyclo)
    • Line 377: warning: cyclomatic complexity 17 of function testReorg() is high (> 15) (gocyclo)
    • Line 1258: warning: cyclomatic complexity 17 of function TestEIP155Transition() is high (> 15) (gocyclo)
    • internal/ethapi/api.go
    • Line 946: warning: cyclomatic complexity 27 of function DoEstimateGas() is high (> 15) (gocyclo)
    • Line 1729: warning: cyclomatic complexity 18 of function (*PublicTransactionPoolAPI).Resend() is high (> 15) (gocyclo)
    • Line 817: warning: cyclomatic complexity 17 of function DoCall() is high (> 15) (gocyclo)
    • Line 1484: warning: cyclomatic complexity 16 of function (*SendTxArgs).setDefaults() is high (> 15) (gocyclo)
    • core/vm/evm.go
    • Line 436: warning: cyclomatic complexity 25 of function (*EVM).create() is high (> 15) (gocyclo)
    • Line 223: warning: cyclomatic complexity 18 of function (*EVM).Call() is high (> 15) (gocyclo)
    • signer/core/signed_data.go
    • Line 897: warning: cyclomatic complexity 101 of function isPrimitiveTypeValid() is high (> 15) (gocyclo)
    • Line 574: warning: cyclomatic complexity 20 of function (*TypedData).EncodePrimitiveValue() is high (> 15) (gocyclo)
    • consensus/clique/clique.go
    • Line 245: warning: cyclomatic complexity 22 of function (*Clique).verifyHeader() is high (> 15) (gocyclo)
    • Line 348: warning: cyclomatic complexity 21 of function (*Clique).snapshot() is high (> 15) (gocyclo)
    • consensus/ethash/sealer.go
    • Line 266: warning: cyclomatic complexity 17 of function (*remoteSealer).loop() is high (> 15) (gocyclo)
    • Line 51: warning: cyclomatic complexity 16 of function (*Ethash).Seal() is high (> 15) (gocyclo)
    • trie/trie.go
    • Line 360: warning: cyclomatic complexity 23 of function (*Trie).delete() is high (> 15) (gocyclo)
    • Line 268: warning: cyclomatic complexity 18 of function (*Trie).insert() is high (> 15) (gocyclo)
    • Line 170: warning: cyclomatic complexity 16 of function (*Trie).tryGetNode() is high (> 15) (gocyclo)
    • p2p/simulations/network_test.go
    • Line 38: warning: cyclomatic complexity 49 of function TestSnapshot() is high (> 15) (gocyclo)
    • Line 289: warning: cyclomatic complexity 19 of function TestNetworkSimulation() is high (> 15) (gocyclo)
    • miner/worker.go
    • Line 850: warning: cyclomatic complexity 31 of function (*worker).commitNewWork() is high (> 15) (gocyclo)
    • Line 426: warning: cyclomatic complexity 28 of function (*worker).mainLoop() is high (> 15) (gocyclo)
    • Line 736: warning: cyclomatic complexity 20 of function (*worker).commitTransactions() is high (> 15) (gocyclo)
    • Line 333: warning: cyclomatic complexity 19 of function (*worker).newWorkLoop() is high (> 15) (gocyclo)
    • accounts/scwallet/wallet.go
    • Line 440: warning: cyclomatic complexity 25 of function (*Wallet).selfDerive() is high (> 15) (gocyclo)
    • Line 338: warning: cyclomatic complexity 16 of function (*Wallet).Open() is high (> 15) (gocyclo)
    • p2p/simulations/http_test.go
    • Line 596: warning: cyclomatic complexity 33 of function TestHTTPSnapshot() is high (> 15) (gocyclo)
    • Line 477: warning: cyclomatic complexity 16 of function (*expectEvents).expect() is high (> 15) (gocyclo)
    • les/peer.go
    • Line 581: warning: cyclomatic complexity 18 of function (*serverPeer).Handshake() is high (> 15) (gocyclo)
    • core/genesis.go
    • Line 155: warning: cyclomatic complexity 20 of function SetupGenesisBlock() is high (> 15) (gocyclo)
    • core/state/snapshot/iterator_test.go
    • Line 308: warning: cyclomatic complexity 17 of function TestAccountIteratorTraversalValues() is high (> 15) (gocyclo)
    • Line 402: warning: cyclomatic complexity 17 of function TestStorageIteratorTraversalValues() is high (> 15) (gocyclo)
    • p2p/server.go
    • Line 694: warning: cyclomatic complexity 20 of function (*Server).run() is high (> 15) (gocyclo)
    • Line 536: warning: cyclomatic complexity 17 of function (*Server).setupDiscovery() is high (> 15) (gocyclo)
    • core/dao_test.go
    • Line 31: warning: cyclomatic complexity 22 of function TestDAOForkRangeExtradata() is high (> 15) (gocyclo)
    • core/blockchain_sethead_test.go
    • Line 1952: warning: cyclomatic complexity 20 of function testSetHead() is high (> 15) (gocyclo)
    • Line 56: warning: cyclomatic complexity 20 of function (*rewindTest).dump() is high (> 15) (gocyclo)
    • Line 2062: warning: cyclomatic complexity 19 of function verifyNoGaps() is high (> 15) (gocyclo)
    • cmd/geth/main.go
    • Line 365: warning: cyclomatic complexity 24 of function startNode() is high (> 15) (gocyclo)
    • Line 281: warning: cyclomatic complexity 21 of function prepare() is high (> 15) (gocyclo)
    • eth/filters/api.go
    • Line 460: warning: cyclomatic complexity 24 of function (*FilterCriteria).UnmarshalJSON() is high (> 15) (gocyclo)
    • metrics/ewma_test.go
    • Line 17: warning: cyclomatic complexity 17 of function TestEWMA1() is high (> 15) (gocyclo)
    • Line 86: warning: cyclomatic complexity 17 of function TestEWMA5() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 17 of function TestEWMA15() is high (> 15) (gocyclo)
    • params/config.go
    • Line 503: warning: cyclomatic complexity 18 of function (*ChainConfig).checkCompatible() is high (> 15) (gocyclo)
    • core/blockchain.go
    • Line 1137: warning: cyclomatic complexity 65 of function (*BlockChain).InsertReceiptChain() is high (> 15) (gocyclo)
    • Line 1707: warning: cyclomatic complexity 47 of function (*BlockChain).insertChain() is high (> 15) (gocyclo)
    • Line 220: warning: cyclomatic complexity 35 of function NewBlockChain() is high (> 15) (gocyclo)
    • Line 2117: warning: cyclomatic complexity 33 of function (*BlockChain).reorg() is high (> 15) (gocyclo)
    • Line 1506: warning: cyclomatic complexity 29 of function (*BlockChain).writeBlockWithState() is high (> 15) (gocyclo)
    • Line 496: warning: cyclomatic complexity 22 of function (*BlockChain).SetHeadBeyondRoot() is high (> 15) (gocyclo)
    • Line 1997: warning: cyclomatic complexity 21 of function (*BlockChain).insertSideChain() is high (> 15) (gocyclo)
    • Line 2305: warning: cyclomatic complexity 18 of function (*BlockChain).maintainTxIndex() is high (> 15) (gocyclo)
    • ethstats/ethstats.go
    • Line 184: warning: cyclomatic complexity 29 of function (*Service).loop() is high (> 15) (gocyclo)
    • Line 334: warning: cyclomatic complexity 20 of function (*Service).readLoop() is high (> 15) (gocyclo)
    • les/sync_test.go
    • Line 43: warning: cyclomatic complexity 16 of function testCheckpointSyncing() is high (> 15) (gocyclo)
    • les/fetcher.go
    • Line 259: warning: cyclomatic complexity 48 of function (*lightFetcher).mainloop() is high (> 15) (gocyclo)
    • cmd/faucet/faucet.go
    • Line 309: warning: cyclomatic complexity 48 of function (*faucet).apiHandler() is high (> 15) (gocyclo)
    • Line 97: warning: cyclomatic complexity 19 of function main() is high (> 15) (gocyclo)
    • core/state/statedb_test.go
    • Line 745: warning: cyclomatic complexity 28 of function TestStateDBAccessList() is high (> 15) (gocyclo)
    • Line 582: warning: cyclomatic complexity 21 of function TestCopyCopyCommitCopy() is high (> 15) (gocyclo)
    • Line 510: warning: cyclomatic complexity 17 of function TestCopyCommitCopy() is high (> 15) (gocyclo)
    • p2p/dial.go
    • Line 224: warning: cyclomatic complexity 23 of function (*dialScheduler).loop() is high (> 15) (gocyclo)
    • core/tx_pool.go
    • Line 1254: warning: cyclomatic complexity 21 of function (*TxPool).truncatePending() is high (> 15) (gocyclo)
    • Line 314: warning: cyclomatic complexity 17 of function (*TxPool).loop() is high (> 15) (gocyclo)
    • Line 570: warning: cyclomatic complexity 16 of function (*TxPool).add() is high (> 15) (gocyclo)
    • p2p/discv5/net.go
    • Line 354: warning: cyclomatic complexity 53 of function (*Network).loop() is high (> 15) (gocyclo)
    • Line 867: warning: cyclomatic complexity 21 of function init() is high (> 15) (gocyclo)
    • Line 1146: warning: cyclomatic complexity 17 of function (*Network).handleQueryEvent() 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!