Preparing report...

Report for github.com/hacpy/go-ethereum

D    Needs lots of improvement    Found 192 issues across 1029 files

Tweet

gofmt0%

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

An error occurred while running this test (AddError: could not parse "_repos/src/github.com/hacpy/go-ethereum/eth/stat handler_eth_test.go: no such file or directory:1::warning: file is not gofmted with -s (gofmt)" - strconv.Atoi: parsing " no such file or directory": invalid syntax)


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!


golint0%

Golint is a linter for Go source code.

An error occurred while running this test (exit status 3)


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.

    • go-ethereum/internal/ethapi/api.go
    • Line 944: warning: cyclomatic complexity 27 of function DoEstimateGas() is high (> 15) (gocyclo)
    • Line 1505: warning: cyclomatic complexity 17 of function (*SendTxArgs).setDefaults() is high (> 15) (gocyclo)
    • Line 1780: warning: cyclomatic complexity 17 of function (*PublicTransactionPoolAPI).Resend() is high (> 15) (gocyclo)
    • Line 815: warning: cyclomatic complexity 17 of function DoCall() is high (> 15) (gocyclo)
    • go-ethereum/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 750: warning: cyclomatic complexity 22 of function (*worker).commitTransactions() is high (> 15) (gocyclo)
    • Line 336: warning: cyclomatic complexity 21 of function (*worker).newWorkLoop() is high (> 15) (gocyclo)
    • go-ethereum/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)
    • go-ethereum/trie/proof.go
    • Line 219: warning: cyclomatic complexity 31 of function unsetInternal() is high (> 15) (gocyclo)
    • Line 467: warning: cyclomatic complexity 29 of function VerifyRangeProof() is high (> 15) (gocyclo)
    • Line 137: warning: cyclomatic complexity 17 of function proofToPath() is high (> 15) (gocyclo)
    • go-ethereum/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)
    • Line 577: warning: cyclomatic complexity 16 of function (*Clique).Seal() is high (> 15) (gocyclo)
    • go-ethereum/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 1754: warning: cyclomatic complexity 19 of function testTransactionJournaling() is high (> 15) (gocyclo)
    • Line 473: warning: cyclomatic complexity 19 of function TestTransactionDropping() is high (> 15) (gocyclo)
    • Line 1605: warning: cyclomatic complexity 17 of function TestTransactionDeduplication() is high (> 15) (gocyclo)
    • Line 1671: warning: cyclomatic complexity 17 of function TestTransactionReplacement() is high (> 15) (gocyclo)
    • go-ethereum/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)
    • go-ethereum/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)
    • go-ethereum/core/blockchain_test.go
    • Line 2072: warning: cyclomatic complexity 28 of function TestTransactionIndices() is high (> 15) (gocyclo)
    • Line 591: warning: cyclomatic complexity 28 of function TestFastVsFullChains() 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)
    • go-ethereum/eth/protocols/snap/sync.go
    • Line 1682: warning: cyclomatic complexity 31 of function (*Syncer).processStorageResponse() is high (> 15) (gocyclo)
    • Line 2206: warning: cyclomatic complexity 26 of function (*Syncer).OnStorage() is high (> 15) (gocyclo)
    • Line 947: warning: cyclomatic complexity 24 of function (*Syncer).assignStorageTasks() is high (> 15) (gocyclo)
    • Line 543: warning: cyclomatic complexity 23 of function (*Syncer).Sync() is high (> 15) (gocyclo)
    • Line 1985: warning: cyclomatic complexity 21 of function (*Syncer).OnAccounts() is high (> 15) (gocyclo)
    • Line 1186: warning: cyclomatic complexity 17 of function (*Syncer).assignBytecodeHealTasks() is high (> 15) (gocyclo)
    • Line 1899: warning: cyclomatic complexity 17 of function (*Syncer).forwardAccountTask() is high (> 15) (gocyclo)
    • Line 1080: warning: cyclomatic complexity 17 of function (*Syncer).assignTrienodeHealTasks() is high (> 15) (gocyclo)
    • Line 1284: warning: cyclomatic complexity 16 of function (*Syncer).revertRequests() is high (> 15) (gocyclo)
    • Line 1548: warning: cyclomatic complexity 16 of function (*Syncer).processAccountResponse() is high (> 15) (gocyclo)
    • go-ethereum/les/api.go
    • Line 217: warning: cyclomatic complexity 17 of function (*PrivateLightServerAPI).Benchmark() is high (> 15) (gocyclo)
    • Line 110: warning: cyclomatic complexity 17 of function (*PrivateLightServerAPI).setParams() is high (> 15) (gocyclo)
    • go-ethereum/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)
    • go-ethereum/trie/trie.go
    • Line 357: warning: cyclomatic complexity 25 of function (*Trie).delete() is high (> 15) (gocyclo)
    • Line 265: warning: cyclomatic complexity 19 of function (*Trie).insert() is high (> 15) (gocyclo)
    • Line 165: warning: cyclomatic complexity 17 of function (*Trie).tryGetNode() is high (> 15) (gocyclo)
    • go-ethereum/eth/downloader/downloader.go
    • Line 1524: warning: cyclomatic complexity 44 of function (*Downloader).processHeaders() is high (> 15) (gocyclo)
    • Line 1349: warning: cyclomatic complexity 44 of function (*Downloader).fetchParts() is high (> 15) (gocyclo)
    • Line 1011: warning: cyclomatic complexity 42 of function (*Downloader).fetchHeaders() is high (> 15) (gocyclo)
    • Line 451: warning: cyclomatic complexity 26 of function (*Downloader).syncWithPeer() is high (> 15) (gocyclo)
    • Line 1751: warning: cyclomatic complexity 23 of function (*Downloader).processFastSyncContent() is high (> 15) (gocyclo)
    • Line 836: warning: cyclomatic complexity 20 of function (*Downloader).findAncestorSpanSearch() is high (> 15) (gocyclo)
    • Line 369: warning: cyclomatic complexity 19 of function (*Downloader).synchronise() is high (> 15) (gocyclo)
    • Line 650: warning: cyclomatic complexity 18 of function (*Downloader).fetchHead() is high (> 15) (gocyclo)
    • Line 920: warning: cyclomatic complexity 17 of function (*Downloader).findAncestorBinarySearch() is high (> 15) (gocyclo)
    • go-ethereum/trie/stacktrie.go
    • Line 281: warning: cyclomatic complexity 17 of function (*StackTrie).hash() is high (> 15) (gocyclo)
    • Line 135: warning: cyclomatic complexity 16 of function (*StackTrie).insert() is high (> 15) (gocyclo)
    • go-ethereum/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)
    • go-ethereum/metrics/ewma_test.go
    • Line 86: warning: cyclomatic complexity 17 of function TestEWMA5() is high (> 15) (gocyclo)
    • Line 17: warning: cyclomatic complexity 17 of function TestEWMA1() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 17 of function TestEWMA15() is high (> 15) (gocyclo)
    • go-ethereum/core/blockchain.go
    • Line 1134: warning: cyclomatic complexity 65 of function (*BlockChain).InsertReceiptChain() is high (> 15) (gocyclo)
    • Line 1704: warning: cyclomatic complexity 49 of function (*BlockChain).insertChain() is high (> 15) (gocyclo)
    • Line 218: warning: cyclomatic complexity 35 of function NewBlockChain() is high (> 15) (gocyclo)
    • Line 2128: warning: cyclomatic complexity 33 of function (*BlockChain).reorg() is high (> 15) (gocyclo)
    • Line 1503: warning: cyclomatic complexity 29 of function (*BlockChain).writeBlockWithState() is high (> 15) (gocyclo)
    • Line 492: warning: cyclomatic complexity 23 of function (*BlockChain).SetHeadBeyondRoot() is high (> 15) (gocyclo)
    • Line 2008: warning: cyclomatic complexity 21 of function (*BlockChain).insertSideChain() is high (> 15) (gocyclo)
    • Line 2316: warning: cyclomatic complexity 18 of function (*BlockChain).maintainTxIndex() is high (> 15) (gocyclo)
    • go-ethereum/eth/tracers/api.go
    • Line 221: warning: cyclomatic complexity 27 of function (*API).traceChain() is high (> 15) (gocyclo)
    • Line 529: warning: cyclomatic complexity 22 of function (*API).standardTraceBlockToFile() is high (> 15) (gocyclo)
    • go-ethereum/console/console.go
    • Line 344: warning: cyclomatic complexity 17 of function (*Console).Interactive() is high (> 15) (gocyclo)
    • Line 431: warning: cyclomatic complexity 16 of function countIndents() is high (> 15) (gocyclo)
    • go-ethereum/les/server_requests.go
    • Line 151: warning: cyclomatic complexity 22 of function handleGetBlockHeaders() is high (> 15) (gocyclo)
    • Line 368: warning: cyclomatic complexity 19 of function handleGetProofs() is high (> 15) (gocyclo)
    • Line 451: warning: cyclomatic complexity 16 of function handleGetHelperTrieProofs() is high (> 15) (gocyclo)
    • go-ethereum/cmd/utils/flags.go
    • Line 1475: warning: cyclomatic complexity 58 of function SetEthConfig() is high (> 15) (gocyclo)
    • Line 1137: warning: cyclomatic complexity 23 of function SetP2PConfig() is high (> 15) (gocyclo)
    • Line 918: warning: cyclomatic complexity 17 of function setHTTP() is high (> 15) (gocyclo)
    • Line 1816: warning: cyclomatic complexity 16 of function MakeChain() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


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!