Preparing report...

Report for github.com/foreverbit/biternal

(v0.0.0-20240509102609-12fd41bcd459)

A+    Excellent!    Found 204 issues across 1156 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!


gofmt97%

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!


gocyclo84%

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.

    • signer/core/apitypes/types.go
    • Line 717: warning: cyclomatic complexity 105 of function isPrimitiveTypeValid() is high (> 15) (gocyclo)
    • Line 490: warning: cyclomatic complexity 20 of function (*TypedData).EncodePrimitiveValue() is high (> 15) (gocyclo)
    • les/distributor.go
    • Line 192: warning: cyclomatic complexity 18 of function (*requestDistributor).nextRequest() is high (> 15) (gocyclo)
    • p2p/dial.go
    • Line 223: warning: cyclomatic complexity 23 of function (*dialScheduler).loop() is high (> 15) (gocyclo)
    • eth/downloader/downloader.go
    • Line 1254: warning: cyclomatic complexity 53 of function (*Downloader).processHeaders() is high (> 15) (gocyclo)
    • Line 991: warning: cyclomatic complexity 45 of function (*Downloader).fetchHeaders() is high (> 15) (gocyclo)
    • Line 448: warning: cyclomatic complexity 36 of function (*Downloader).syncWithPeer() is high (> 15) (gocyclo)
    • Line 1578: warning: cyclomatic complexity 22 of function (*Downloader).processSnapSyncContent() is high (> 15) (gocyclo)
    • les/sync.go
    • Line 91: warning: cyclomatic complexity 23 of function (*clientHandler).synchronise() is high (> 15) (gocyclo)
    • internal/ethapi/transaction_args.go
    • Line 202: warning: cyclomatic complexity 17 of function (*TransactionArgs).ToMessage() is high (> 15) (gocyclo)
    • Line 134: warning: cyclomatic complexity 16 of function (*TransactionArgs).setFeeDefaults() is high (> 15) (gocyclo)
    • metrics/ewma_test.go
    • Line 155: warning: cyclomatic complexity 17 of function TestEWMA15() is high (> 15) (gocyclo)
    • 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)
    • 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/odr_test.go
    • Line 261: warning: cyclomatic complexity 18 of function testGetTxStatusFromUnindexedPeers() is high (> 15) (gocyclo)
    • rlp/rlpgen/gen.go
    • Line 632: warning: cyclomatic complexity 18 of function (*buildContext).makeOp() is high (> 15) (gocyclo)
    • cmd/utils/cmd.go
    • Line 387: warning: cyclomatic complexity 24 of function ImportLDBData() is high (> 15) (gocyclo)
    • Line 138: warning: cyclomatic complexity 16 of function ImportChain() is high (> 15) (gocyclo)
    • node/node.go
    • Line 383: warning: cyclomatic complexity 21 of function (*Node).startRPC() is high (> 15) (gocyclo)
    • eth/protocols/snap/sync.go
    • Line 1888: warning: cyclomatic complexity 44 of function (*Syncer).processStorageResponse() is high (> 15) (gocyclo)
    • Line 1095: warning: cyclomatic complexity 26 of function (*Syncer).assignStorageTasks() is high (> 15) (gocyclo)
    • Line 547: warning: cyclomatic complexity 24 of function (*Syncer).Sync() is high (> 15) (gocyclo)
    • Line 2446: warning: cyclomatic complexity 23 of function (*Syncer).OnStorage() is high (> 15) (gocyclo)
    • Line 2237: warning: cyclomatic complexity 19 of function (*Syncer).OnAccounts() is high (> 15) (gocyclo)
    • Line 1251: warning: cyclomatic complexity 18 of function (*Syncer).assignTrienodeHealTasks() is high (> 15) (gocyclo)
    • Line 1375: warning: cyclomatic complexity 18 of function (*Syncer).assignBytecodeHealTasks() is high (> 15) (gocyclo)
    • Line 1491: warning: cyclomatic complexity 16 of function (*Syncer).revertRequests() is high (> 15) (gocyclo)
    • Line 2165: warning: cyclomatic complexity 16 of function (*Syncer).forwardAccountTask() is high (> 15) (gocyclo)
    • core/tx_pool.go
    • Line 1378: warning: cyclomatic complexity 21 of function (*TxPool).truncatePending() is high (> 15) (gocyclo)
    • Line 655: warning: cyclomatic complexity 19 of function (*TxPool).add() is high (> 15) (gocyclo)
    • Line 586: warning: cyclomatic complexity 18 of function (*TxPool).validateTx() is high (> 15) (gocyclo)
    • Line 337: warning: cyclomatic complexity 17 of function (*TxPool).loop() is high (> 15) (gocyclo)
    • rlp/encode.go
    • Line 135: warning: cyclomatic complexity 17 of function makeWriter() is high (> 15) (gocyclo)
    • les/api_test.go
    • Line 95: warning: cyclomatic complexity 45 of function testCapacityAPI() is high (> 15) (gocyclo)
    • core/rawdb/freezer_table.go
    • Line 210: warning: cyclomatic complexity 25 of function (*freezerTable).repair() is high (> 15) (gocyclo)
    • Line 730: warning: cyclomatic complexity 22 of function (*freezerTable).retrieveItems() is high (> 15) (gocyclo)
    • Line 455: warning: cyclomatic complexity 17 of function (*freezerTable).truncateTail() is high (> 15) (gocyclo)
    • core/genesis.go
    • Line 251: warning: cyclomatic complexity 23 of function SetupGenesisBlockWithOverride() is high (> 15) (gocyclo)
    • core/state/statedb_test.go
    • Line 744: 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)
    • 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 1448: warning: cyclomatic complexity 55 of function (*BlockChain).insertChain() is high (> 15) (gocyclo)
    • Line 946: warning: cyclomatic complexity 53 of function (*BlockChain).InsertReceiptChain() is high (> 15) (gocyclo)
    • Line 221: warning: cyclomatic complexity 35 of function NewBlockChain() is high (> 15) (gocyclo)
    • Line 1997: warning: cyclomatic complexity 33 of function (*BlockChain).reorg() is high (> 15) (gocyclo)
    • Line 541: warning: cyclomatic complexity 31 of function (*BlockChain).setHeadBeyondRoot() is high (> 15) (gocyclo)
    • Line 1786: warning: cyclomatic complexity 22 of function (*BlockChain).insertSideChain() is high (> 15) (gocyclo)
    • Line 2280: warning: cyclomatic complexity 19 of function (*BlockChain).maintainTxIndex() is high (> 15) (gocyclo)
    • build/ci.go
    • Line 484: warning: cyclomatic complexity 32 of function doDocker() is high (> 15) (gocyclo)
    • core/blockchain_sethead_test.go
    • Line 55: warning: cyclomatic complexity 20 of function (*rewindTest).dump() is high (> 15) (gocyclo)
    • Line 1951: warning: cyclomatic complexity 19 of function testSetHead() is high (> 15) (gocyclo)
    • Line 2057: warning: cyclomatic complexity 19 of function verifyNoGaps() is high (> 15) (gocyclo)
    • les/api.go
    • Line 257: warning: cyclomatic complexity 16 of function (*LightServerAPI).Benchmark() is high (> 15) (gocyclo)
    • Line 143: warning: cyclomatic complexity 16 of function (*LightServerAPI).setParams() is high (> 15) (gocyclo)
    • internal/ethapi/api.go
    • Line 1027: warning: cyclomatic complexity 31 of function DoEstimateGas() is high (> 15) (gocyclo)
    • Line 1830: warning: cyclomatic complexity 17 of function (*TransactionAPI).Resend() is high (> 15) (gocyclo)
    • les/downloader/downloader.go
    • Line 993: warning: cyclomatic complexity 42 of function (*Downloader).fetchHeaders() is high (> 15) (gocyclo)
    • Line 1505: warning: cyclomatic complexity 42 of function (*Downloader).processHeaders() is high (> 15) (gocyclo)
    • Line 1331: warning: cyclomatic complexity 40 of function (*Downloader).fetchParts() is high (> 15) (gocyclo)
    • Line 434: warning: cyclomatic complexity 26 of function (*Downloader).syncWithPeer() is high (> 15) (gocyclo)
    • Line 1732: warning: cyclomatic complexity 22 of function (*Downloader).processFastSyncContent() is high (> 15) (gocyclo)
    • Line 818: warning: cyclomatic complexity 19 of function (*Downloader).findAncestorSpanSearch() is high (> 15) (gocyclo)
    • Line 630: warning: cyclomatic complexity 18 of function (*Downloader).fetchHead() is high (> 15) (gocyclo)
    • Line 902: warning: cyclomatic complexity 16 of function (*Downloader).findAncestorBinarySearch() is high (> 15) (gocyclo)
    • p2p/simulations/http_test.go
    • Line 594: 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)
    • eth/handler.go
    • Line 311: warning: cyclomatic complexity 32 of function (*handler).runEthPeer() is high (> 15) (gocyclo)
    • Line 129: warning: cyclomatic complexity 28 of function newHandler() is high (> 15) (gocyclo)
    • core/state/statedb.go
    • Line 898: warning: cyclomatic complexity 23 of function (*StateDB).Commit() is high (> 15) (gocyclo)
    • Line 645: warning: cyclomatic complexity 16 of function (*StateDB).Copy() is high (> 15) (gocyclo)
    • miner/worker.go
    • Line 517: warning: cyclomatic complexity 33 of function (*worker).mainLoop() is high (> 15) (gocyclo)
    • Line 417: warning: cyclomatic complexity 21 of function (*worker).newWorkLoop() is high (> 15) (gocyclo)
    • Line 839: warning: cyclomatic complexity 20 of function (*worker).commitTransactions() is high (> 15) (gocyclo)
    • Line 968: warning: cyclomatic complexity 16 of function (*worker).prepareWork() is high (> 15) (gocyclo)
    • p2p/server.go
    • Line 706: warning: cyclomatic complexity 20 of function (*Server).run() is high (> 15) (gocyclo)
    • Line 539: warning: cyclomatic complexity 17 of function (*Server).setupDiscovery() is high (> 15) (gocyclo)
    • params/config.go
    • Line 641: warning: cyclomatic complexity 23 of function (*ChainConfig).checkCompatible() 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)
    • 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)
    • trie/proof_test.go
    • Line 532: warning: cyclomatic complexity 18 of function TestBadRangeProof() is high (> 15) (gocyclo)
    • Line 195: warning: cyclomatic complexity 17 of function TestRangeProofWithNonExistentProof() is high (> 15) (gocyclo)
    • Line 324: warning: cyclomatic complexity 16 of function TestOneElementRangeProof() is high (> 15) (gocyclo)
    • eth/protocols/snap/handler.go
    • Line 131: warning: cyclomatic complexity 26 of function HandleMessage() is high (> 15) (gocyclo)
    • Line 341: warning: cyclomatic complexity 22 of function ServiceGetStorageRangesQuery() is high (> 15) (gocyclo)
    • Line 483: warning: cyclomatic complexity 19 of function ServiceGetTrieNodesQuery() is high (> 15) (gocyclo)
    • core/dao_test.go
    • Line 31: warning: cyclomatic complexity 22 of function TestDAOForkRangeExtradata() is high (> 15) (gocyclo)
    • cmd/utils/flags.go
    • Line 1720: warning: cyclomatic complexity 65 of function SetEthConfig() is high (> 15) (gocyclo)
    • Line 1374: warning: cyclomatic complexity 23 of function SetP2PConfig() is high (> 15) (gocyclo)
    • cmd/faucet/faucet.go
    • Line 316: warning: cyclomatic complexity 42 of function (*faucet).apiHandler() is high (> 15) (gocyclo)
    • Line 104: warning: cyclomatic complexity 17 of function main() is high (> 15) (gocyclo)
    • core/blockchain_test.go
    • Line 734: warning: cyclomatic complexity 33 of function TestFastVsFullChains() is high (> 15) (gocyclo)
    • Line 2486: warning: cyclomatic complexity 27 of function TestTransactionIndices() is high (> 15) (gocyclo)
    • Line 2202: warning: cyclomatic complexity 22 of function testInsertKnownChainDataWithMerging() is high (> 15) (gocyclo)
    • Line 2616: warning: cyclomatic complexity 20 of function TestSkipStaleTxIndicesInSnapSync() is high (> 15) (gocyclo)
    • Line 3139: warning: cyclomatic complexity 19 of function TestDeleteRecreateSlotsAcrossManyBlocks() is high (> 15) (gocyclo)
    • Line 2063: warning: cyclomatic complexity 17 of function testInsertKnownChainData() is high (> 15) (gocyclo)
    • Line 1415: warning: cyclomatic complexity 17 of function TestEIP155Transition() is high (> 15) (gocyclo)
    • Line 982: warning: cyclomatic complexity 17 of function TestChainTxReorgs() is high (> 15) (gocyclo)
    • Line 518: warning: cyclomatic complexity 17 of function testReorg() is high (> 15) (gocyclo)
    • Line 1788: warning: cyclomatic complexity 16 of function TestInsertReceiptChainRollback() is high (> 15) (gocyclo)
    • les/peer.go
    • Line 590: warning: cyclomatic complexity 20 of function (*serverPeer).Handshake() is high (> 15) (gocyclo)
    • ethstats/ethstats.go
    • Line 215: warning: cyclomatic complexity 29 of function (*Service).loop() is high (> 15) (gocyclo)
    • Line 356: warning: cyclomatic complexity 20 of function (*Service).readLoop() is high (> 15) (gocyclo)
    • consensus/ethash/sealer.go
    • Line 267: 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/fetcher.go
    • Line 257: warning: cyclomatic complexity 50 of function (*lightFetcher).mainloop() is high (> 15) (gocyclo)
    • eth/filters/api.go
    • Line 447: warning: cyclomatic complexity 24 of function (*FilterCriteria).UnmarshalJSON() is high (> 15) (gocyclo)
    • consensus/clique/clique.go
    • Line 246: warning: cyclomatic complexity 23 of function (*Clique).verifyHeader() is high (> 15) (gocyclo)
    • Line 369: warning: cyclomatic complexity 21 of function (*Clique).snapshot() is high (> 15) (gocyclo)
    • Line 313: warning: cyclomatic complexity 16 of function (*Clique).verifyCascadingFields() is high (> 15) (gocyclo)
    • eth/downloader/skeleton.go
    • Line 878: warning: cyclomatic complexity 26 of function (*skeleton).processResponse() is high (> 15) (gocyclo)
    • Line 339: warning: cyclomatic complexity 22 of function (*skeleton).sync() is high (> 15) (gocyclo)
    • Line 714: warning: cyclomatic complexity 16 of function (*skeleton).executeTask() is high (> 15) (gocyclo)
    • eth/downloader/queue_test.go
    • Line 94: warning: cyclomatic complexity 22 of function TestBasics() is high (> 15) (gocyclo)
    • Line 266: warning: cyclomatic complexity 19 of function XTestDelivery() is high (> 15) (gocyclo)
    • core/state/snapshot/iterator_test.go
    • Line 402: warning: cyclomatic complexity 17 of function TestStorageIteratorTraversalValues() is high (> 15) (gocyclo)
    • Line 308: warning: cyclomatic complexity 17 of function TestAccountIteratorTraversalValues() is high (> 15) (gocyclo)
    • p2p/simulations/network_test.go
    • Line 38: warning: cyclomatic complexity 49 of function TestSnapshot() is high (> 15) (gocyclo)
    • Line 287: 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)
    • eth/tracers/api.go
    • Line 243: warning: cyclomatic complexity 30 of function (*API).traceChain() is high (> 15) (gocyclo)
    • Line 651: warning: cyclomatic complexity 22 of function (*API).standardTraceBlockToFile() is high (> 15) (gocyclo)
    • cmd/geth/main.go
    • Line 360: warning: cyclomatic complexity 20 of function startNode() is high (> 15) (gocyclo)
    • Line 274: warning: cyclomatic complexity 19 of function prepare() is high (> 15) (gocyclo)
    • log/format.go
    • Line 326: warning: cyclomatic complexity 21 of function formatLogfmtValue() is high (> 15) (gocyclo)
    • core/tx_pool_test.go
    • Line 951: warning: cyclomatic complexity 29 of function testTransactionQueueTimeLimiting() is high (> 15) (gocyclo)
    • Line 649: warning: cyclomatic complexity 28 of function TestTransactionPostponing() is high (> 15) (gocyclo)
    • Line 1446: warning: cyclomatic complexity 24 of function TestTransactionPoolRepricingDynamicFee() is high (> 15) (gocyclo)
    • Line 1322: warning: cyclomatic complexity 24 of function TestTransactionPoolRepricing() is high (> 15) (gocyclo)
    • Line 1643: warning: cyclomatic complexity 20 of function TestTransactionPoolUnderpricing() is high (> 15) (gocyclo)
    • Line 1818: warning: cyclomatic complexity 20 of function TestTransactionPoolUnderpricingDynamicFee() is high (> 15) (gocyclo)
    • Line 2240: warning: cyclomatic complexity 19 of function testTransactionJournaling() is high (> 15) (gocyclo)
    • Line 545: warning: cyclomatic complexity 19 of function TestTransactionDropping() is high (> 15) (gocyclo)
    • Line 2127: warning: cyclomatic complexity 17 of function TestTransactionReplacementDynamicFee() is high (> 15) (gocyclo)
    • Line 2047: warning: cyclomatic complexity 17 of function TestTransactionReplacement() is high (> 15) (gocyclo)
    • Line 1981: warning: cyclomatic complexity 17 of function TestTransactionDeduplication() is high (> 15) (gocyclo)
    • core/state/sync_test.go
    • Line 544: warning: cyclomatic complexity 26 of function TestIncompleteStateSync() is high (> 15) (gocyclo)
    • Line 171: warning: cyclomatic complexity 22 of function testIterativeStateSync() is high (> 15) (gocyclo)
    • Line 454: warning: cyclomatic complexity 19 of function TestIterativeRandomDelayedStateSync() is high (> 15) (gocyclo)
    • Line 374: warning: cyclomatic complexity 17 of function testIterativeRandomStateSync() is high (> 15) (gocyclo)
    • Line 281: warning: cyclomatic complexity 17 of function TestIterativeDelayedStateSync() is high (> 15) (gocyclo)
    • core/vm/evm.go
    • Line 406: warning: cyclomatic complexity 26 of function (*EVM).create() is high (> 15) (gocyclo)
    • Line 168: warning: cyclomatic complexity 16 of function (*EVM).Call() is high (> 15) (gocyclo)
    • les/sync_test.go
    • Line 44: warning: cyclomatic complexity 16 of function testCheckpointSyncing() is high (> 15) (gocyclo)
    • cmd/geth/snapshot.go
    • Line 333: warning: cyclomatic complexity 24 of function traverseRawState() is high (> 15) (gocyclo)
    • Line 244: warning: cyclomatic complexity 16 of function traverseState() is high (> 15) (gocyclo)
    • accounts/abi/bind/bind.go
    • Line 87: warning: cyclomatic complexity 39 of function Bind() is high (> 15) (gocyclo)
    • Line 46: warning: cyclomatic complexity 29 of function isKeyWord() is high (> 15) (gocyclo)
    • trie/proof.go
    • Line 223: warning: cyclomatic complexity 29 of function unsetInternal() is high (> 15) (gocyclo)
    • Line 477: warning: cyclomatic complexity 26 of function VerifyRangeProof() is high (> 15) (gocyclo)
    • Line 141: warning: cyclomatic complexity 16 of function proofToPath() is high (> 15) (gocyclo)
    • eth/catalyst/api.go
    • Line 148: warning: cyclomatic complexity 28 of function (*ConsensusAPI).ForkchoiceUpdatedV1() is high (> 15) (gocyclo)
    • Line 554: warning: cyclomatic complexity 25 of function (*ConsensusAPI).heartbeat() is high (> 15) (gocyclo)
    • trie/trie.go
    • Line 411: warning: cyclomatic complexity 24 of function (*Trie).delete() is high (> 15) (gocyclo)
    • Line 309: warning: cyclomatic complexity 18 of function (*Trie).insert() is high (> 15) (gocyclo)
    • Line 203: warning: cyclomatic complexity 16 of function (*Trie).tryGetNode() is high (> 15) (gocyclo)
    • core/state/snapshot/generate.go
    • Line 316: warning: cyclomatic complexity 28 of function (*diskLayer).generateRange() is high (> 15) (gocyclo)
    • Line 561: warning: cyclomatic complexity 22 of function generateAccounts() is high (> 15) (gocyclo)
    • Line 169: warning: cyclomatic complexity 19 of function (*diskLayer).proveRange() 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)
    • miner/worker_test.go
    • Line 544: warning: cyclomatic complexity 19 of function testGetSealingWork() is high (> 15) (gocyclo)
    • Line 443: warning: cyclomatic complexity 16 of function testAdjustInterval() 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!