Preparing report...

Report for github.com/taia/go-ethereum

(v1.0.0)

A+    Excellent!    Found 271 issues across 1049 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!


gofmt86%

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!


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.

    • ethstats/ethstats.go
    • Line 193: 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.go
    • Line 91: warning: cyclomatic complexity 23 of function (*clientHandler).synchronise() is high (> 15) (gocyclo)
    • core/tx_pool.go
    • Line 1279: warning: cyclomatic complexity 21 of function (*TxPool).truncatePending() is high (> 15) (gocyclo)
    • Line 579: warning: cyclomatic complexity 18 of function (*TxPool).add() is high (> 15) (gocyclo)
    • Line 320: warning: cyclomatic complexity 17 of function (*TxPool).loop() is high (> 15) (gocyclo)
    • core/state/pruner/pruner.go
    • Line 116: warning: cyclomatic complexity 18 of function prune() is high (> 15) (gocyclo)
    • Line 235: warning: cyclomatic complexity 16 of function (*Pruner).Prune() 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)
    • 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/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/sync_test.go
    • Line 44: warning: cyclomatic complexity 16 of function testCheckpointSyncing() is high (> 15) (gocyclo)
    • internal/ethapi/api.go
    • Line 958: warning: cyclomatic complexity 27 of function DoEstimateGas() is high (> 15) (gocyclo)
    • Line 1892: warning: cyclomatic complexity 17 of function (*PublicTransactionPoolAPI).Resend() is high (> 15) (gocyclo)
    • Line 1619: warning: cyclomatic complexity 17 of function (*SendTxArgs).setDefaults() is high (> 15) (gocyclo)
    • les/server_requests.go
    • Line 151: warning: cyclomatic complexity 22 of function handleGetBlockHeaders() is high (> 15) (gocyclo)
    • Line 368: warning: cyclomatic complexity 18 of function handleGetProofs() is high (> 15) (gocyclo)
    • Line 451: warning: cyclomatic complexity 16 of function handleGetHelperTrieProofs() is high (> 15) (gocyclo)
    • eth/downloader/downloader.go
    • Line 1022: warning: cyclomatic complexity 42 of function (*Downloader).fetchHeaders() is high (> 15) (gocyclo)
    • Line 1535: warning: cyclomatic complexity 42 of function (*Downloader).processHeaders() is high (> 15) (gocyclo)
    • Line 1360: warning: cyclomatic complexity 40 of function (*Downloader).fetchParts() is high (> 15) (gocyclo)
    • Line 462: warning: cyclomatic complexity 26 of function (*Downloader).syncWithPeer() is high (> 15) (gocyclo)
    • Line 1762: warning: cyclomatic complexity 22 of function (*Downloader).processFastSyncContent() is high (> 15) (gocyclo)
    • Line 847: warning: cyclomatic complexity 19 of function (*Downloader).findAncestorSpanSearch() is high (> 15) (gocyclo)
    • Line 661: warning: cyclomatic complexity 18 of function (*Downloader).fetchHead() is high (> 15) (gocyclo)
    • Line 374: warning: cyclomatic complexity 17 of function (*Downloader).synchronise() is high (> 15) (gocyclo)
    • Line 931: warning: cyclomatic complexity 16 of function (*Downloader).findAncestorBinarySearch() is high (> 15) (gocyclo)
    • p2p/dial.go
    • Line 224: warning: cyclomatic complexity 23 of function (*dialScheduler).loop() is high (> 15) (gocyclo)
    • params/config.go
    • Line 521: warning: cyclomatic complexity 19 of function (*ChainConfig).checkCompatible() is high (> 15) (gocyclo)
    • p2p/enr/enr.go
    • Line 198: warning: cyclomatic complexity 16 of function decodeRecord() is high (> 15) (gocyclo)
    • core/vm/evm.go
    • Line 421: warning: cyclomatic complexity 23 of function (*EVM).create() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 18 of function (*EVM).Call() is high (> 15) (gocyclo)
    • core/state/sync_test.go
    • Line 401: warning: cyclomatic complexity 17 of function TestIncompleteStateSync() is high (> 15) (gocyclo)
    • Line 163: warning: cyclomatic complexity 17 of function testIterativeStateSync() is high (> 15) (gocyclo)
    • trie/proof_test.go
    • Line 531: warning: cyclomatic complexity 18 of function TestBadRangeProof() is high (> 15) (gocyclo)
    • Line 194: warning: cyclomatic complexity 17 of function TestRangeProofWithNonExistentProof() is high (> 15) (gocyclo)
    • Line 323: warning: cyclomatic complexity 16 of function TestOneElementRangeProof() 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)
    • 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)
    • core/dao_test.go
    • Line 31: warning: cyclomatic complexity 22 of function TestDAOForkRangeExtradata() 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)
    • les/api.go
    • Line 143: warning: cyclomatic complexity 16 of function (*PrivateLightServerAPI).setParams() is high (> 15) (gocyclo)
    • Line 257: warning: cyclomatic complexity 16 of function (*PrivateLightServerAPI).Benchmark() is high (> 15) (gocyclo)
    • eth/tracers/api.go
    • Line 238: warning: cyclomatic complexity 28 of function (*API).traceChain() is high (> 15) (gocyclo)
    • Line 572: warning: cyclomatic complexity 22 of function (*API).standardTraceBlockToFile() is high (> 15) (gocyclo)
    • les/fetcher.go
    • Line 259: warning: cyclomatic complexity 48 of function (*lightFetcher).mainloop() is high (> 15) (gocyclo)
    • les/peer.go
    • Line 590: warning: cyclomatic complexity 20 of function (*serverPeer).Handshake() is high (> 15) (gocyclo)
    • p2p/server.go
    • Line 694: warning: cyclomatic complexity 20 of function (*Server).run() is high (> 15) (gocyclo)
    • Line 535: warning: cyclomatic complexity 16 of function (*Server).setupDiscovery() is high (> 15) (gocyclo)
    • les/distributor.go
    • Line 192: warning: cyclomatic complexity 18 of function (*requestDistributor).nextRequest() is high (> 15) (gocyclo)
    • core/blockchain.go
    • Line 1128: warning: cyclomatic complexity 55 of function (*BlockChain).InsertReceiptChain() is high (> 15) (gocyclo)
    • Line 1665: warning: cyclomatic complexity 48 of function (*BlockChain).insertChain() is high (> 15) (gocyclo)
    • Line 217: warning: cyclomatic complexity 35 of function NewBlockChain() is high (> 15) (gocyclo)
    • Line 2089: warning: cyclomatic complexity 33 of function (*BlockChain).reorg() is high (> 15) (gocyclo)
    • Line 1448: warning: cyclomatic complexity 29 of function (*BlockChain).writeBlockWithState() is high (> 15) (gocyclo)
    • Line 491: warning: cyclomatic complexity 23 of function (*BlockChain).SetHeadBeyondRoot() is high (> 15) (gocyclo)
    • Line 1969: warning: cyclomatic complexity 21 of function (*BlockChain).insertSideChain() is high (> 15) (gocyclo)
    • Line 2276: warning: cyclomatic complexity 18 of function (*BlockChain).maintainTxIndex() is high (> 15) (gocyclo)
    • eth/protocols/snap/sync.go
    • Line 1765: warning: cyclomatic complexity 44 of function (*Syncer).processStorageResponse() is high (> 15) (gocyclo)
    • Line 1019: warning: cyclomatic complexity 24 of function (*Syncer).assignStorageTasks() is high (> 15) (gocyclo)
    • Line 532: warning: cyclomatic complexity 24 of function (*Syncer).Sync() is high (> 15) (gocyclo)
    • Line 2321: warning: cyclomatic complexity 23 of function (*Syncer).OnStorage() is high (> 15) (gocyclo)
    • Line 2114: warning: cyclomatic complexity 19 of function (*Syncer).OnAccounts() is high (> 15) (gocyclo)
    • Line 1266: warning: cyclomatic complexity 17 of function (*Syncer).assignBytecodeHealTasks() is high (> 15) (gocyclo)
    • Line 1156: warning: cyclomatic complexity 17 of function (*Syncer).assignTrienodeHealTasks() is high (> 15) (gocyclo)
    • Line 1368: warning: cyclomatic complexity 16 of function (*Syncer).revertRequests() is high (> 15) (gocyclo)
    • Line 2042: warning: cyclomatic complexity 16 of function (*Syncer).forwardAccountTask() is high (> 15) (gocyclo)
    • cmd/geth/main.go
    • Line 329: warning: cyclomatic complexity 20 of function startNode() is high (> 15) (gocyclo)
    • Line 266: warning: cyclomatic complexity 16 of function prepare() is high (> 15) (gocyclo)
    • cmd/faucet/faucet.go
    • Line 319: warning: cyclomatic complexity 42 of function (*faucet).apiHandler() is high (> 15) (gocyclo)
    • Line 102: warning: cyclomatic complexity 18 of function main() is high (> 15) (gocyclo)
    • eth/handler.go
    • Line 238: warning: cyclomatic complexity 20 of function (*handler).runEthPeer() is high (> 15) (gocyclo)
    • log/format.go
    • Line 328: warning: cyclomatic complexity 21 of function formatLogfmtValue() is high (> 15) (gocyclo)
    • core/blockchain_sethead_test.go
    • Line 56: warning: cyclomatic complexity 20 of function (*rewindTest).dump() is high (> 15) (gocyclo)
    • Line 1952: warning: cyclomatic complexity 20 of function testSetHead() is high (> 15) (gocyclo)
    • Line 2062: warning: cyclomatic complexity 19 of function verifyNoGaps() is high (> 15) (gocyclo)
    • les/odr_test.go
    • Line 261: warning: cyclomatic complexity 18 of function testGetTxStatusFromUnindexedPeers() is high (> 15) (gocyclo)
    • core/state/snapshot/generate.go
    • Line 539: warning: cyclomatic complexity 35 of function (*diskLayer).generate() is high (> 15) (gocyclo)
    • Line 384: warning: cyclomatic complexity 27 of function (*diskLayer).generateRange() is high (> 15) (gocyclo)
    • Line 251: warning: cyclomatic complexity 18 of function (*diskLayer).proveRange() 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)
    • 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 377: warning: cyclomatic complexity 17 of function testReorg() is high (> 15) (gocyclo)
    • Line 823: warning: cyclomatic complexity 17 of function TestChainTxReorgs() is high (> 15) (gocyclo)
    • Line 1258: warning: cyclomatic complexity 17 of function TestEIP155Transition() is high (> 15) (gocyclo)
    • rlp/encode.go
    • Line 330: warning: cyclomatic complexity 17 of function makeWriter() is high (> 15) (gocyclo)
    • trie/trie.go
    • Line 368: warning: cyclomatic complexity 23 of function (*Trie).delete() is high (> 15) (gocyclo)
    • Line 276: warning: cyclomatic complexity 18 of function (*Trie).insert() is high (> 15) (gocyclo)
    • Line 176: warning: cyclomatic complexity 16 of function (*Trie).tryGetNode() 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)
    • miner/worker.go
    • Line 869: warning: cyclomatic complexity 30 of function (*worker).commitNewWork() is high (> 15) (gocyclo)
    • Line 433: warning: cyclomatic complexity 28 of function (*worker).mainLoop() is high (> 15) (gocyclo)
    • Line 336: warning: cyclomatic complexity 21 of function (*worker).newWorkLoop() is high (> 15) (gocyclo)
    • Line 750: warning: cyclomatic complexity 21 of function (*worker).commitTransactions() is high (> 15) (gocyclo)
    • 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)
    • eth/filters/api.go
    • Line 467: warning: cyclomatic complexity 24 of function (*FilterCriteria).UnmarshalJSON() 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)
    • core/genesis.go
    • Line 159: warning: cyclomatic complexity 21 of function SetupGenesisBlockWithOverride() is high (> 15) (gocyclo)
    • les/api_test.go
    • Line 95: warning: cyclomatic complexity 45 of function testCapacityAPI() is high (> 15) (gocyclo)
    • cmd/geth/snapshot.go
    • Line 308: warning: cyclomatic complexity 22 of function traverseRawState() is high (> 15) (gocyclo)
    • Line 218: warning: cyclomatic complexity 16 of function traverseState() 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)
    • core/tx_pool_test.go
    • Line 880: warning: cyclomatic complexity 29 of function testTransactionQueueTimeLimiting() is high (> 15) (gocyclo)
    • Line 577: warning: cyclomatic complexity 28 of function TestTransactionPostponing() is high (> 15) (gocyclo)
    • Line 1251: warning: cyclomatic complexity 24 of function TestTransactionPoolRepricing() is high (> 15) (gocyclo)
    • Line 1434: warning: cyclomatic complexity 20 of function TestTransactionPoolUnderpricing() is high (> 15) (gocyclo)
    • Line 473: warning: cyclomatic complexity 19 of function TestTransactionDropping() is high (> 15) (gocyclo)
    • Line 1754: warning: cyclomatic complexity 19 of function testTransactionJournaling() is high (> 15) (gocyclo)
    • Line 1671: warning: cyclomatic complexity 17 of function TestTransactionReplacement() is high (> 15) (gocyclo)
    • Line 1605: warning: cyclomatic complexity 17 of function TestTransactionDeduplication() is high (> 15) (gocyclo)
    • core/state/statedb.go
    • Line 913: warning: cyclomatic complexity 19 of function (*StateDB).Commit() is high (> 15) (gocyclo)
    • Line 661: warning: cyclomatic complexity 16 of function (*StateDB).Copy() is high (> 15) (gocyclo)
    • trie/sync.go
    • Line 365: warning: cyclomatic complexity 17 of function (*Sync).children() is high (> 15) (gocyclo)
    • trie/proof.go
    • Line 219: warning: cyclomatic complexity 29 of function unsetInternal() is high (> 15) (gocyclo)
    • Line 471: warning: cyclomatic complexity 24 of function VerifyRangeProof() is high (> 15) (gocyclo)
    • Line 137: warning: cyclomatic complexity 16 of function proofToPath() is high (> 15) (gocyclo)
    • cmd/utils/flags.go
    • Line 1461: warning: cyclomatic complexity 63 of function SetEthConfig() is high (> 15) (gocyclo)
    • Line 1131: warning: cyclomatic complexity 24 of function SetP2PConfig() is high (> 15) (gocyclo)
    • Line 912: warning: cyclomatic complexity 17 of function setHTTP() 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!