Preparing report...

Report for github.com/dominant-strategies/go-quai

(v0.1.0-pre.8)

A+    Excellent!    Found 224 issues across 1087 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!


gofmt92%

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.

    • les/sync_test.go
    • Line 44: warning: cyclomatic complexity 16 of function testCheckpointSyncing() is high (> 15) (gocyclo)
    • build/ci.go
    • Line 454: warning: cyclomatic complexity 32 of function doDocker() is high (> 15) (gocyclo)
    • les/sync.go
    • Line 92: warning: cyclomatic complexity 23 of function (*clientHandler).synchronise() is high (> 15) (gocyclo)
    • les/distributor.go
    • Line 192: warning: cyclomatic complexity 18 of function (*requestDistributor).nextRequest() is high (> 15) (gocyclo)
    • core/state/sync_test.go
    • Line 164: warning: cyclomatic complexity 17 of function testIterativeStateSync() is high (> 15) (gocyclo)
    • Line 402: warning: cyclomatic complexity 17 of function TestIncompleteStateSync() 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)
    • core/vm/evm.go
    • Line 412: warning: cyclomatic complexity 27 of function (*EVM).create() is high (> 15) (gocyclo)
    • Line 167: warning: cyclomatic complexity 18 of function (*EVM).Call() is high (> 15) (gocyclo)
    • cmd/quai/snapshot.go
    • Line 326: warning: cyclomatic complexity 22 of function traverseRawState() is high (> 15) (gocyclo)
    • Line 236: warning: cyclomatic complexity 16 of function traverseState() 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)
    • params/config.go
    • Line 974: warning: cyclomatic complexity 16 of function (*ChainConfig).checkCompatible() 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)
    • p2p/enr/enr.go
    • Line 198: warning: cyclomatic complexity 16 of function decodeRecord() is high (> 15) (gocyclo)
    • core/state/statedb.go
    • Line 900: warning: cyclomatic complexity 20 of function (*StateDB).Commit() is high (> 15) (gocyclo)
    • Line 647: warning: cyclomatic complexity 16 of function (*StateDB).Copy() is high (> 15) (gocyclo)
    • eth/handler.go
    • Line 239: warning: cyclomatic complexity 20 of function (*handler).runEthPeer() is high (> 15) (gocyclo)
    • miner/worker.go
    • Line 499: warning: cyclomatic complexity 33 of function (*worker).mainLoop() is high (> 15) (gocyclo)
    • Line 399: warning: cyclomatic complexity 21 of function (*worker).newWorkLoop() is high (> 15) (gocyclo)
    • Line 842: warning: cyclomatic complexity 20 of function (*worker).commitTransactions() is high (> 15) (gocyclo)
    • core/tx_pool.go
    • Line 1406: warning: cyclomatic complexity 21 of function (*TxPool).truncatePending() is high (> 15) (gocyclo)
    • Line 589: warning: cyclomatic complexity 20 of function (*TxPool).validateTx() is high (> 15) (gocyclo)
    • Line 1229: warning: cyclomatic complexity 20 of function (*TxPool).reset() is high (> 15) (gocyclo)
    • Line 666: warning: cyclomatic complexity 19 of function (*TxPool).add() is high (> 15) (gocyclo)
    • Line 340: warning: cyclomatic complexity 17 of function (*TxPool).loop() is high (> 15) (gocyclo)
    • eth/downloader/downloader.go
    • Line 1558: warning: cyclomatic complexity 42 of function (*Downloader).processHeaders() is high (> 15) (gocyclo)
    • Line 1021: warning: cyclomatic complexity 42 of function (*Downloader).fetchHeaders() is high (> 15) (gocyclo)
    • Line 1383: warning: cyclomatic complexity 40 of function (*Downloader).fetchParts() is high (> 15) (gocyclo)
    • Line 452: warning: cyclomatic complexity 26 of function (*Downloader).syncWithPeer() is high (> 15) (gocyclo)
    • Line 1795: warning: cyclomatic complexity 22 of function (*Downloader).processFastSyncContent() is high (> 15) (gocyclo)
    • Line 840: warning: cyclomatic complexity 20 of function (*Downloader).findAncestorSpanSearch() is high (> 15) (gocyclo)
    • Line 653: warning: cyclomatic complexity 19 of function (*Downloader).fetchHead() is high (> 15) (gocyclo)
    • Line 925: warning: cyclomatic complexity 18 of function (*Downloader).findAncestorBinarySearch() is high (> 15) (gocyclo)
    • Line 364: warning: cyclomatic complexity 17 of function (*Downloader).synchronise() is high (> 15) (gocyclo)
    • cmd/puppeth/wizard_netstats.go
    • Line 193: warning: cyclomatic complexity 28 of function (serverStats).render() is high (> 15) (gocyclo)
    • Line 73: warning: cyclomatic complexity 21 of function (*wizard).gatherStats() 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)
    • log/format.go
    • Line 328: warning: cyclomatic complexity 21 of function formatLogfmtValue() is high (> 15) (gocyclo)
    • les/odr_test.go
    • Line 261: warning: cyclomatic complexity 18 of function testGetTxStatusFromUnindexedPeers() is high (> 15) (gocyclo)
    • ethstats/ethstats.go
    • Line 214: warning: cyclomatic complexity 29 of function (*Service).loop() is high (> 15) (gocyclo)
    • Line 355: warning: cyclomatic complexity 20 of function (*Service).readLoop() is high (> 15) (gocyclo)
    • les/fetcher.go
    • Line 257: warning: cyclomatic complexity 48 of function (*lightFetcher).mainloop() is high (> 15) (gocyclo)
    • eth/tracers/api.go
    • Line 231: warning: cyclomatic complexity 28 of function (*API).traceChain() is high (> 15) (gocyclo)
    • Line 631: warning: cyclomatic complexity 22 of function (*API).standardTraceBlockToFile() is high (> 15) (gocyclo)
    • core/state/pruner/pruner.go
    • Line 115: warning: cyclomatic complexity 18 of function prune() is high (> 15) (gocyclo)
    • Line 234: warning: cyclomatic complexity 16 of function (*Pruner).Prune() is high (> 15) (gocyclo)
    • consensus/clique/clique.go
    • Line 246: warning: cyclomatic complexity 22 of function (*Clique).verifyHeader() is high (> 15) (gocyclo)
    • Line 366: warning: cyclomatic complexity 21 of function (*Clique).snapshot() is high (> 15) (gocyclo)
    • Line 310: warning: cyclomatic complexity 16 of function (*Clique).verifyCascadingFields() 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)
    • core/blockchain.go
    • Line 1985: warning: cyclomatic complexity 62 of function (*BlockChain).insertChain() is high (> 15) (gocyclo)
    • Line 1197: warning: cyclomatic complexity 50 of function (*BlockChain).InsertReceiptChain() is high (> 15) (gocyclo)
    • Line 238: warning: cyclomatic complexity 38 of function NewBlockChain() is high (> 15) (gocyclo)
    • Line 3281: warning: cyclomatic complexity 27 of function (*BlockChain).PCRC() is high (> 15) (gocyclo)
    • Line 2545: warning: cyclomatic complexity 27 of function (*BlockChain).reorg() is high (> 15) (gocyclo)
    • Line 2368: warning: cyclomatic complexity 23 of function (*BlockChain).insertSideChain() is high (> 15) (gocyclo)
    • Line 567: warning: cyclomatic complexity 23 of function (*BlockChain).SetHeadBeyondRoot() is high (> 15) (gocyclo)
    • Line 1789: warning: cyclomatic complexity 21 of function (*BlockChain).ReOrgRollBack() is high (> 15) (gocyclo)
    • Line 2749: warning: cyclomatic complexity 18 of function (*BlockChain).maintainTxIndex() is high (> 15) (gocyclo)
    • les/downloader/downloader.go
    • Line 1516: warning: cyclomatic complexity 42 of function (*Downloader).processHeaders() is high (> 15) (gocyclo)
    • Line 1003: warning: cyclomatic complexity 42 of function (*Downloader).fetchHeaders() is high (> 15) (gocyclo)
    • Line 1341: warning: cyclomatic complexity 40 of function (*Downloader).fetchParts() is high (> 15) (gocyclo)
    • Line 443: warning: cyclomatic complexity 26 of function (*Downloader).syncWithPeer() is high (> 15) (gocyclo)
    • Line 1743: warning: cyclomatic complexity 22 of function (*Downloader).processFastSyncContent() is high (> 15) (gocyclo)
    • Line 828: warning: cyclomatic complexity 19 of function (*Downloader).findAncestorSpanSearch() is high (> 15) (gocyclo)
    • Line 642: warning: cyclomatic complexity 18 of function (*Downloader).fetchHead() is high (> 15) (gocyclo)
    • Line 355: warning: cyclomatic complexity 17 of function (*Downloader).synchronise() is high (> 15) (gocyclo)
    • Line 912: warning: cyclomatic complexity 16 of function (*Downloader).findAncestorBinarySearch() 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)
    • p2p/dial.go
    • Line 224: warning: cyclomatic complexity 23 of function (*dialScheduler).loop() 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)
    • eth/protocols/snap/sync.go
    • Line 1851: warning: cyclomatic complexity 44 of function (*Syncer).processStorageResponse() is high (> 15) (gocyclo)
    • Line 1058: warning: cyclomatic complexity 26 of function (*Syncer).assignStorageTasks() is high (> 15) (gocyclo)
    • Line 540: warning: cyclomatic complexity 24 of function (*Syncer).Sync() is high (> 15) (gocyclo)
    • Line 2409: warning: cyclomatic complexity 23 of function (*Syncer).OnStorage() is high (> 15) (gocyclo)
    • Line 2200: warning: cyclomatic complexity 19 of function (*Syncer).OnAccounts() is high (> 15) (gocyclo)
    • Line 1214: warning: cyclomatic complexity 18 of function (*Syncer).assignTrienodeHealTasks() is high (> 15) (gocyclo)
    • Line 1338: warning: cyclomatic complexity 18 of function (*Syncer).assignBytecodeHealTasks() is high (> 15) (gocyclo)
    • Line 1454: warning: cyclomatic complexity 16 of function (*Syncer).revertRequests() is high (> 15) (gocyclo)
    • Line 2128: warning: cyclomatic complexity 16 of function (*Syncer).forwardAccountTask() is high (> 15) (gocyclo)
    • core/blockchain_test.go
    • Line 597: warning: cyclomatic complexity 34 of function TestFastVsFullChains() is high (> 15) (gocyclo)
    • Line 2124: warning: cyclomatic complexity 28 of function TestTransactionIndices() is high (> 15) (gocyclo)
    • Line 2255: warning: cyclomatic complexity 21 of function TestSkipStaleTxIndicesInFastSync() is high (> 15) (gocyclo)
    • Line 2781: warning: cyclomatic complexity 19 of function TestDeleteRecreateSlotsAcrossManyBlocks() is high (> 15) (gocyclo)
    • Line 1881: warning: cyclomatic complexity 18 of function testInsertKnownChainData() is high (> 15) (gocyclo)
    • Line 854: warning: cyclomatic complexity 17 of function TestChainTxReorgs() is high (> 15) (gocyclo)
    • Line 380: warning: cyclomatic complexity 17 of function testReorg() is high (> 15) (gocyclo)
    • Line 1665: warning: cyclomatic complexity 17 of function TestInsertReceiptChainRollback() is high (> 15) (gocyclo)
    • Line 1289: warning: cyclomatic complexity 17 of function TestEIP155Transition() 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)
    • 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)
    • core/rawdb/freezer_table.go
    • Line 560: warning: cyclomatic complexity 22 of function (*freezerTable).retrieveItems() is high (> 15) (gocyclo)
    • Line 214: warning: cyclomatic complexity 19 of function (*freezerTable).repair() is high (> 15) (gocyclo)
    • les/api_test.go
    • Line 95: warning: cyclomatic complexity 45 of function testCapacityAPI() 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/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)
    • 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/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)
    • internal/ethapi/api.go
    • Line 1014: warning: cyclomatic complexity 31 of function DoEstimateGas() is high (> 15) (gocyclo)
    • Line 1962: warning: cyclomatic complexity 17 of function (*PublicTransactionPoolAPI).Resend() is high (> 15) (gocyclo)
    • internal/ethapi/transaction_args.go
    • Line 77: warning: cyclomatic complexity 29 of function (*TransactionArgs).setDefaults() is high (> 15) (gocyclo)
    • Line 178: warning: cyclomatic complexity 17 of function (*TransactionArgs).ToMessage() is high (> 15) (gocyclo)
    • consensus/blake3/consensus.go
    • Line 522: warning: cyclomatic complexity 27 of function (*Blake3).RegionTraceBranch() is high (> 15) (gocyclo)
    • Line 443: warning: cyclomatic complexity 19 of function (*Blake3).PrimeTraceBranch() is high (> 15) (gocyclo)
    • Line 241: warning: cyclomatic complexity 17 of function (*Blake3).verifyHeader() is high (> 15) (gocyclo)
    • Line 684: warning: cyclomatic complexity 16 of function (*Blake3).PreviousCoincidentOnPath() is high (> 15) (gocyclo)
    • trie/sync.go
    • Line 365: warning: cyclomatic complexity 17 of function (*Sync).children() is high (> 15) (gocyclo)
    • cmd/utils/flags.go
    • Line 1459: warning: cyclomatic complexity 67 of function SetEthConfig() is high (> 15) (gocyclo)
    • Line 1148: warning: cyclomatic complexity 24 of function SetP2PConfig() is high (> 15) (gocyclo)
    • trie/trie.go
    • Line 378: warning: cyclomatic complexity 24 of function (*Trie).delete() is high (> 15) (gocyclo)
    • Line 286: warning: cyclomatic complexity 18 of function (*Trie).insert() is high (> 15) (gocyclo)
    • Line 178: warning: cyclomatic complexity 16 of function (*Trie).tryGetNode() is high (> 15) (gocyclo)
    • rlp/encode.go
    • Line 326: warning: cyclomatic complexity 17 of function makeWriter() 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)
    • les/peer.go
    • Line 590: warning: cyclomatic complexity 20 of function (*serverPeer).Handshake() is high (> 15) (gocyclo)
    • signer/core/signed_data.go
    • Line 898: warning: cyclomatic complexity 101 of function isPrimitiveTypeValid() is high (> 15) (gocyclo)
    • Line 575: warning: cyclomatic complexity 20 of function (*TypedData).EncodePrimitiveValue() is high (> 15) (gocyclo)
    • core/genesis.go
    • Line 160: warning: cyclomatic complexity 21 of function SetupGenesisBlockWithOverride() is high (> 15) (gocyclo)
    • eth/filters/api.go
    • Line 588: warning: cyclomatic complexity 24 of function (*FilterCriteria).UnmarshalJSON() 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)
    • core/tx_pool_test.go
    • Line 981: warning: cyclomatic complexity 29 of function testTransactionQueueTimeLimiting() is high (> 15) (gocyclo)
    • Line 678: warning: cyclomatic complexity 28 of function TestTransactionPostponing() is high (> 15) (gocyclo)
    • Line 1476: warning: cyclomatic complexity 24 of function TestTransactionPoolRepricingDynamicFee() is high (> 15) (gocyclo)
    • Line 1352: warning: cyclomatic complexity 24 of function TestTransactionPoolRepricing() is high (> 15) (gocyclo)
    • Line 1848: warning: cyclomatic complexity 20 of function TestTransactionPoolUnderpricingDynamicFee() is high (> 15) (gocyclo)
    • Line 1673: warning: cyclomatic complexity 20 of function TestTransactionPoolUnderpricing() is high (> 15) (gocyclo)
    • Line 574: warning: cyclomatic complexity 19 of function TestTransactionDropping() is high (> 15) (gocyclo)
    • Line 2270: warning: cyclomatic complexity 19 of function testTransactionJournaling() is high (> 15) (gocyclo)
    • Line 2011: warning: cyclomatic complexity 17 of function TestTransactionDeduplication() is high (> 15) (gocyclo)
    • Line 2157: warning: cyclomatic complexity 17 of function TestTransactionReplacementDynamicFee() is high (> 15) (gocyclo)
    • Line 2077: warning: cyclomatic complexity 17 of function TestTransactionReplacement() 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!