Preparing report...

Report for gitlab.com/thorchain/thornode

(v1.96.2)

A+    Excellent!    Found 132 issues across 729 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!


gofmt100%

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

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo81%

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.

    • x/thorchain/handler_unbond.go
    • Line 127: warning: cyclomatic complexity 35 of function (UnBondHandler).handleV92() is high (> 15) (gocyclo)
    • Line 60: warning: cyclomatic complexity 16 of function (UnBondHandler).validateV88() is high (> 15) (gocyclo)
    • x/thorchain/handler_withdraw_archive.go
    • Line 417: warning: cyclomatic complexity 25 of function (WithdrawLiquidityHandler).handleV75() is high (> 15) (gocyclo)
    • Line 172: warning: cyclomatic complexity 23 of function (WithdrawLiquidityHandler).handleV93() is high (> 15) (gocyclo)
    • Line 14: warning: cyclomatic complexity 23 of function (WithdrawLiquidityHandler).handleV94() is high (> 15) (gocyclo)
    • Line 297: warning: cyclomatic complexity 20 of function (WithdrawLiquidityHandler).handleV88() is high (> 15) (gocyclo)
    • x/thorchain/swap_v91.go
    • Line 36: warning: cyclomatic complexity 26 of function (*SwapperV91).Swap() is high (> 15) (gocyclo)
    • Line 169: warning: cyclomatic complexity 22 of function (*SwapperV91).swapOne() is high (> 15) (gocyclo)
    • x/thorchain/handler_yggdrasil.go
    • Line 108: warning: cyclomatic complexity 30 of function (YggdrasilHandler).handleV96() is high (> 15) (gocyclo)
    • Line 222: warning: cyclomatic complexity 19 of function (YggdrasilHandler).handleYggdrasilReturnV1() is high (> 15) (gocyclo)
    • x/thorchain/manager_network_v92.go
    • Line 77: warning: cyclomatic complexity 45 of function (*NetworkMgrV92).EndBlock() is high (> 15) (gocyclo)
    • Line 663: warning: cyclomatic complexity 22 of function (*NetworkMgrV92).UpdateNetwork() is high (> 15) (gocyclo)
    • x/thorchain/manager_network_v87.go
    • Line 81: warning: cyclomatic complexity 44 of function (*NetworkMgrV87).EndBlock() is high (> 15) (gocyclo)
    • Line 611: warning: cyclomatic complexity 22 of function (*NetworkMgrV87).UpdateNetwork() is high (> 15) (gocyclo)
    • x/thorchain/genesis.go
    • Line 121: warning: cyclomatic complexity 37 of function InitGenesis() is high (> 15) (gocyclo)
    • Line 298: warning: cyclomatic complexity 30 of function ExportGenesis() is high (> 15) (gocyclo)
    • Line 22: warning: cyclomatic complexity 25 of function ValidateGenesis() is high (> 15) (gocyclo)
    • x/thorchain/manager_network_current.go
    • Line 193: warning: cyclomatic complexity 49 of function (*NetworkMgrV96).EndBlock() is high (> 15) (gocyclo)
    • Line 1022: warning: cyclomatic complexity 22 of function (*NetworkMgrV96).UpdateNetwork() is high (> 15) (gocyclo)
    • Line 407: warning: cyclomatic complexity 16 of function (*NetworkMgrV96).POLCycle() is high (> 15) (gocyclo)
    • x/thorchain/manager_validator_current.go
    • Line 38: warning: cyclomatic complexity 36 of function (*validatorMgrV95).BeginBlock() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 35 of function (*validatorMgrV95).EndBlock() is high (> 15) (gocyclo)
    • Line 760: warning: cyclomatic complexity 28 of function (*validatorMgrV95).ragnarokPools() is high (> 15) (gocyclo)
    • Line 1387: warning: cyclomatic complexity 21 of function (*validatorMgrV95).nextVaultNodeAccounts() is high (> 15) (gocyclo)
    • Line 1316: warning: cyclomatic complexity 17 of function (*validatorMgrV95).NodeAccountPreflightCheck() is high (> 15) (gocyclo)
    • common/pubkey.go
    • Line 99: warning: cyclomatic complexity 30 of function (PubKey).GetAddress() is high (> 15) (gocyclo)
    • common/address.go
    • Line 329: warning: cyclomatic complexity 34 of function (Address).GetNetwork() is high (> 15) (gocyclo)
    • Line 230: warning: cyclomatic complexity 30 of function (Address).IsChain() is high (> 15) (gocyclo)
    • x/thorchain/handler_swap_archive.go
    • Line 108: warning: cyclomatic complexity 26 of function (SwapHandler).validateV93() is high (> 15) (gocyclo)
    • Line 12: warning: cyclomatic complexity 26 of function (SwapHandler).validateV92() is high (> 15) (gocyclo)
    • Line 343: warning: cyclomatic complexity 20 of function (SwapHandler).validateV88() is high (> 15) (gocyclo)
    • Line 418: warning: cyclomatic complexity 19 of function (SwapHandler).validateV65() is high (> 15) (gocyclo)
    • x/thorchain/manager_txout_v85.go
    • Line 220: warning: cyclomatic complexity 66 of function (*TxOutStorageV85).prepareTxOutItem() is high (> 15) (gocyclo)
    • Line 533: warning: cyclomatic complexity 25 of function (*TxOutStorageV85).calcTxOutHeight() is high (> 15) (gocyclo)
    • x/thorchain/manager_network_v95.go
    • Line 78: warning: cyclomatic complexity 46 of function (*NetworkMgrV95).EndBlock() is high (> 15) (gocyclo)
    • Line 891: warning: cyclomatic complexity 22 of function (*NetworkMgrV95).UpdateNetwork() is high (> 15) (gocyclo)
    • Line 284: warning: cyclomatic complexity 16 of function (*NetworkMgrV95).POLCycle() is high (> 15) (gocyclo)
    • x/thorchain/manager_network_v90.go
    • Line 75: warning: cyclomatic complexity 44 of function (*NetworkMgrV90).EndBlock() is high (> 15) (gocyclo)
    • Line 604: warning: cyclomatic complexity 22 of function (*NetworkMgrV90).UpdateNetwork() is high (> 15) (gocyclo)
    • x/thorchain/swap_current.go
    • Line 76: warning: cyclomatic complexity 30 of function (*SwapperV95).Swap() is high (> 15) (gocyclo)
    • Line 224: warning: cyclomatic complexity 23 of function (*SwapperV95).swapOne() is high (> 15) (gocyclo)
    • x/thorchain/memo/memo.go
    • Line 275: warning: cyclomatic complexity 21 of function ParseMemoWithTHORNames() is high (> 15) (gocyclo)
    • Line 221: warning: cyclomatic complexity 20 of function ParseMemo() is high (> 15) (gocyclo)
    • x/thorchain/manager_txout_v88.go
    • Line 226: warning: cyclomatic complexity 68 of function (*TxOutStorageV88).prepareTxOutItem() is high (> 15) (gocyclo)
    • Line 548: warning: cyclomatic complexity 25 of function (*TxOutStorageV88).calcTxOutHeight() is high (> 15) (gocyclo)
    • x/thorchain/manager_network_v93.go
    • Line 77: warning: cyclomatic complexity 45 of function (*NetworkMgrV93).EndBlock() is high (> 15) (gocyclo)
    • Line 664: warning: cyclomatic complexity 22 of function (*NetworkMgrV93).UpdateNetwork() is high (> 15) (gocyclo)
    • x/thorchain/swap_v90.go
    • Line 63: warning: cyclomatic complexity 36 of function (*SwapperV90).Swap() is high (> 15) (gocyclo)
    • Line 216: warning: cyclomatic complexity 19 of function (*SwapperV90).swapOne() is high (> 15) (gocyclo)
    • x/thorchain/swap_v94.go
    • Line 36: warning: cyclomatic complexity 30 of function (*SwapperV94).Swap() is high (> 15) (gocyclo)
    • Line 181: warning: cyclomatic complexity 22 of function (*SwapperV94).swapOne() is high (> 15) (gocyclo)
    • x/thorchain/handler_add_liquidity_archive.go
    • Line 231: warning: cyclomatic complexity 39 of function (AddLiquidityHandler).addLiquidityV95() is high (> 15) (gocyclo)
    • Line 707: warning: cyclomatic complexity 35 of function (AddLiquidityHandler).addLiquidityV79() is high (> 15) (gocyclo)
    • Line 423: warning: cyclomatic complexity 35 of function (AddLiquidityHandler).addLiquidityV90() is high (> 15) (gocyclo)
    • Line 157: warning: cyclomatic complexity 20 of function (AddLiquidityHandler).validateV95() is high (> 15) (gocyclo)
    • Line 83: warning: cyclomatic complexity 20 of function (AddLiquidityHandler).validateV93() is high (> 15) (gocyclo)
    • Line 13: warning: cyclomatic complexity 19 of function (AddLiquidityHandler).validateV76() is high (> 15) (gocyclo)
    • Line 606: warning: cyclomatic complexity 16 of function (AddLiquidityHandler).handleV63() is high (> 15) (gocyclo)
    • Line 875: warning: cyclomatic complexity 16 of function (AddLiquidityHandler).handleV93() is high (> 15) (gocyclo)
    • x/thorchain/manager_slasher_v86.go
    • Line 196: warning: cyclomatic complexity 37 of function (*SlasherV86).LackSigning() is high (> 15) (gocyclo)
    • Line 379: warning: cyclomatic complexity 35 of function (*SlasherV86).SlashVault() is high (> 15) (gocyclo)
    • x/thorchain/handler_tss_archive.go
    • Line 16: warning: cyclomatic complexity 39 of function (TssHandler).handleV92() is high (> 15) (gocyclo)
    • Line 216: warning: cyclomatic complexity 39 of function (TssHandler).handleV73() is high (> 15) (gocyclo)
    • x/thorchain/swap_v81.go
    • Line 63: warning: cyclomatic complexity 36 of function (*SwapperV81).Swap() is high (> 15) (gocyclo)
    • Line 217: warning: cyclomatic complexity 19 of function (*SwapperV81).swapOne() is high (> 15) (gocyclo)
    • x/thorchain/handler_bond.go
    • Line 151: warning: cyclomatic complexity 23 of function (BondHandler).handleV95() is high (> 15) (gocyclo)
    • Line 65: warning: cyclomatic complexity 18 of function (BondHandler).validateV96() is high (> 15) (gocyclo)
    • x/thorchain/manager_txout_v83.go
    • Line 220: warning: cyclomatic complexity 64 of function (*TxOutStorageV83).prepareTxOutItem() is high (> 15) (gocyclo)
    • Line 531: warning: cyclomatic complexity 25 of function (*TxOutStorageV83).calcTxOutHeight() is high (> 15) (gocyclo)
    • x/thorchain/manager_network_v94.go
    • Line 77: warning: cyclomatic complexity 45 of function (*NetworkMgrV94).EndBlock() is high (> 15) (gocyclo)
    • Line 668: warning: cyclomatic complexity 22 of function (*NetworkMgrV94).UpdateNetwork() is high (> 15) (gocyclo)
    • x/thorchain/handler_add_liquidity.go
    • Line 407: warning: cyclomatic complexity 43 of function (AddLiquidityHandler).addLiquidityV96() is high (> 15) (gocyclo)
    • Line 68: warning: cyclomatic complexity 25 of function (AddLiquidityHandler).validateV96() is high (> 15) (gocyclo)
    • Line 168: warning: cyclomatic complexity 17 of function (AddLiquidityHandler).handleV96() is high (> 15) (gocyclo)
    • x/thorchain/manager_network_v91.go
    • Line 76: warning: cyclomatic complexity 45 of function (*NetworkMgrV91).EndBlock() is high (> 15) (gocyclo)
    • Line 638: warning: cyclomatic complexity 22 of function (*NetworkMgrV91).UpdateNetwork() is high (> 15) (gocyclo)
    • x/thorchain/querier.go
    • Line 25: warning: cyclomatic complexity 42 of function NewQuerier() is high (> 15) (gocyclo)
    • Line 657: warning: cyclomatic complexity 19 of function queryNodes() is high (> 15) (gocyclo)
    • Line 487: warning: cyclomatic complexity 19 of function queryNode() is high (> 15) (gocyclo)
    • Line 1170: warning: cyclomatic complexity 18 of function queryQueue() is high (> 15) (gocyclo)
    • x/thorchain/manager_validator_v84.go
    • Line 38: warning: cyclomatic complexity 36 of function (*validatorMgrV84).BeginBlock() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 34 of function (*validatorMgrV84).EndBlock() is high (> 15) (gocyclo)
    • Line 759: warning: cyclomatic complexity 28 of function (*validatorMgrV84).ragnarokPools() is high (> 15) (gocyclo)
    • Line 1374: warning: cyclomatic complexity 21 of function (*validatorMgrV84).nextVaultNodeAccounts() is high (> 15) (gocyclo)
    • Line 1303: warning: cyclomatic complexity 17 of function (*validatorMgrV84).NodeAccountPreflightCheck() is high (> 15) (gocyclo)
    • x/thorchain/types/msg_add_liquidity.go
    • Line 68: warning: cyclomatic complexity 19 of function (*MsgAddLiquidity).ValidateBasicV63() is high (> 15) (gocyclo)
    • Line 108: warning: cyclomatic complexity 17 of function (*MsgAddLiquidity).ValidateBasicV93() is high (> 15) (gocyclo)
    • x/thorchain/manager_txout_v94.go
    • Line 234: warning: cyclomatic complexity 70 of function (*TxOutStorageV94).prepareTxOutItem() is high (> 15) (gocyclo)
    • Line 566: warning: cyclomatic complexity 25 of function (*TxOutStorageV94).calcTxOutHeight() is high (> 15) (gocyclo)
    • Line 113: warning: cyclomatic complexity 16 of function (*TxOutStorageV94).TryAddTxOutItem() is high (> 15) (gocyclo)
    • x/thorchain/helpers.go
    • Line 787: warning: cyclomatic complexity 40 of function emitEndBlockTelemetry() is high (> 15) (gocyclo)
    • Line 289: warning: cyclomatic complexity 28 of function refundBondV92() is high (> 15) (gocyclo)
    • x/thorchain/handler_bond_archive.go
    • Line 85: warning: cyclomatic complexity 27 of function (BondHandler).validateV88() is high (> 15) (gocyclo)
    • Line 186: warning: cyclomatic complexity 24 of function (BondHandler).validateV95() is high (> 15) (gocyclo)
    • Line 575: warning: cyclomatic complexity 22 of function (BondHandler).handleV88() is high (> 15) (gocyclo)
    • Line 274: warning: cyclomatic complexity 21 of function (BondHandler).handleV81() is high (> 15) (gocyclo)
    • Line 372: warning: cyclomatic complexity 21 of function (BondHandler).handleV86() is high (> 15) (gocyclo)
    • Line 473: warning: cyclomatic complexity 21 of function (BondHandler).handleV87() is high (> 15) (gocyclo)
    • Line 13: warning: cyclomatic complexity 19 of function (BondHandler).validateV81() is high (> 15) (gocyclo)
    • x/thorchain/manager_slasher_v87.go
    • Line 381: warning: cyclomatic complexity 37 of function (*SlasherV87).SlashVault() is high (> 15) (gocyclo)
    • Line 198: warning: cyclomatic complexity 37 of function (*SlasherV87).LackSigning() is high (> 15) (gocyclo)
    • x/thorchain/manager_validator_v92.go
    • Line 38: warning: cyclomatic complexity 36 of function (*validatorMgrV92).BeginBlock() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 35 of function (*validatorMgrV92).EndBlock() is high (> 15) (gocyclo)
    • Line 772: warning: cyclomatic complexity 28 of function (*validatorMgrV92).ragnarokPools() is high (> 15) (gocyclo)
    • Line 1399: warning: cyclomatic complexity 21 of function (*validatorMgrV92).nextVaultNodeAccounts() is high (> 15) (gocyclo)
    • Line 1328: warning: cyclomatic complexity 17 of function (*validatorMgrV92).NodeAccountPreflightCheck() is high (> 15) (gocyclo)
    • x/thorchain/manager_network_v76.go
    • Line 75: warning: cyclomatic complexity 44 of function (*NetworkMgrV76).EndBlock() is high (> 15) (gocyclo)
    • Line 607: warning: cyclomatic complexity 31 of function (*NetworkMgrV76).UpdateNetwork() is high (> 15) (gocyclo)
    • common/chain.go
    • Line 166: warning: cyclomatic complexity 26 of function (Chain).AddressPrefix() is high (> 15) (gocyclo)
    • x/thorchain/manager_slasher_v88.go
    • Line 198: warning: cyclomatic complexity 37 of function (*SlasherV88).LackSigning() is high (> 15) (gocyclo)
    • Line 387: warning: cyclomatic complexity 33 of function (*SlasherV88).SlashVault() is high (> 15) (gocyclo)
    • bifrost/pkg/chainclients/avalanche/avalanche.go
    • Line 366: warning: cyclomatic complexity 27 of function (*AvalancheClient).getOutboundTxData() is high (> 15) (gocyclo)
    • Line 67: warning: cyclomatic complexity 22 of function NewAvalancheClient() is high (> 15) (gocyclo)
    • Line 473: warning: cyclomatic complexity 20 of function (*AvalancheClient).buildOutboundTx() is high (> 15) (gocyclo)
    • x/thorchain/manager_network_v89.go
    • Line 75: warning: cyclomatic complexity 44 of function (*NetworkMgrV89).EndBlock() is high (> 15) (gocyclo)
    • Line 605: warning: cyclomatic complexity 22 of function (*NetworkMgrV89).UpdateNetwork() is high (> 15) (gocyclo)
    • x/thorchain/manager_slasher_v75.go
    • Line 196: warning: cyclomatic complexity 35 of function (*SlasherV75).LackSigning() is high (> 15) (gocyclo)
    • Line 369: warning: cyclomatic complexity 33 of function (*SlasherV75).SlashVault() is high (> 15) (gocyclo)
    • x/thorchain/types/msg_swap.go
    • Line 79: warning: cyclomatic complexity 22 of function (*MsgSwap).ValidateBasicV63() is high (> 15) (gocyclo)
    • Line 39: warning: cyclomatic complexity 16 of function (*MsgSwap).ValidateBasic() is high (> 15) (gocyclo)
    • x/thorchain/manager_txout_v84.go
    • Line 220: warning: cyclomatic complexity 65 of function (*TxOutStorageV84).prepareTxOutItem() is high (> 15) (gocyclo)
    • Line 523: warning: cyclomatic complexity 25 of function (*TxOutStorageV84).calcTxOutHeight() is high (> 15) (gocyclo)
    • x/thorchain/manager_txout_current.go
    • Line 237: warning: cyclomatic complexity 70 of function (*TxOutStorageV95).prepareTxOutItem() is high (> 15) (gocyclo)
    • Line 569: warning: cyclomatic complexity 25 of function (*TxOutStorageV95).calcTxOutHeight() is high (> 15) (gocyclo)
    • Line 113: warning: cyclomatic complexity 16 of function (*TxOutStorageV95).TryAddTxOutItem() is high (> 15) (gocyclo)
    • Line 668: warning: cyclomatic complexity 16 of function (*TxOutStorageV95).nativeTxOut() is high (> 15) (gocyclo)
    • x/thorchain/manager_slasher_v89.go
    • Line 199: warning: cyclomatic complexity 39 of function (*SlasherV89).LackSigning() is high (> 15) (gocyclo)
    • Line 394: warning: cyclomatic complexity 35 of function (*SlasherV89).SlashVault() is high (> 15) (gocyclo)
    • x/thorchain/swap_v92.go
    • Line 36: warning: cyclomatic complexity 28 of function (*SwapperV92).Swap() is high (> 15) (gocyclo)
    • Line 174: warning: cyclomatic complexity 22 of function (*SwapperV92).swapOne() is high (> 15) (gocyclo)
    • x/thorchain/manager_validator_v80.go
    • Line 38: warning: cyclomatic complexity 36 of function (*validatorMgrV80).BeginBlock() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 34 of function (*validatorMgrV80).EndBlock() is high (> 15) (gocyclo)
    • Line 761: warning: cyclomatic complexity 28 of function (*validatorMgrV80).ragnarokPools() is high (> 15) (gocyclo)
    • Line 1378: warning: cyclomatic complexity 21 of function (*validatorMgrV80).nextVaultNodeAccounts() is high (> 15) (gocyclo)
    • Line 1307: warning: cyclomatic complexity 17 of function (*validatorMgrV80).NodeAccountPreflightCheck() is high (> 15) (gocyclo)
    • x/thorchain/handler_errata_tx.go
    • Line 231: warning: cyclomatic complexity 33 of function (ErrataTxHandler).processErrataOutboundTxV65() is high (> 15) (gocyclo)
    • Line 71: warning: cyclomatic complexity 28 of function (ErrataTxHandler).handleV58() is high (> 15) (gocyclo)
    • x/thorchain/manager_validator_v87.go
    • Line 38: warning: cyclomatic complexity 36 of function (*validatorMgrV87).BeginBlock() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 34 of function (*validatorMgrV87).EndBlock() is high (> 15) (gocyclo)
    • Line 768: warning: cyclomatic complexity 28 of function (*validatorMgrV87).ragnarokPools() is high (> 15) (gocyclo)
    • Line 1395: warning: cyclomatic complexity 21 of function (*validatorMgrV87).nextVaultNodeAccounts() is high (> 15) (gocyclo)
    • Line 1324: warning: cyclomatic complexity 17 of function (*validatorMgrV87).NodeAccountPreflightCheck() is high (> 15) (gocyclo)
    • x/thorchain/manager_txout_v93.go
    • Line 234: warning: cyclomatic complexity 68 of function (*TxOutStorageV93).prepareTxOutItem() is high (> 15) (gocyclo)
    • Line 556: warning: cyclomatic complexity 25 of function (*TxOutStorageV93).calcTxOutHeight() is high (> 15) (gocyclo)
    • Line 113: warning: cyclomatic complexity 16 of function (*TxOutStorageV93).TryAddTxOutItem() is high (> 15) (gocyclo)
    • x/thorchain/manager_txout_v78.go
    • Line 220: warning: cyclomatic complexity 64 of function (*TxOutStorageV78).prepareTxOutItem() is high (> 15) (gocyclo)
    • Line 528: warning: cyclomatic complexity 25 of function (*TxOutStorageV78).calcTxOutHeight() is high (> 15) (gocyclo)
    • x/thorchain/handler_common_outbound_archive.go
    • Line 173: warning: cyclomatic complexity 38 of function (CommonOutboundTxHandler).handleV92() is high (> 15) (gocyclo)
    • Line 17: warning: cyclomatic complexity 37 of function (CommonOutboundTxHandler).handleV94() is high (> 15) (gocyclo)
    • Line 731: warning: cyclomatic complexity 36 of function (CommonOutboundTxHandler).handleV88() is high (> 15) (gocyclo)
    • Line 585: warning: cyclomatic complexity 35 of function (CommonOutboundTxHandler).handleV87() is high (> 15) (gocyclo)
    • Line 448: warning: cyclomatic complexity 31 of function (CommonOutboundTxHandler).handleV85() is high (> 15) (gocyclo)
    • Line 323: warning: cyclomatic complexity 28 of function (CommonOutboundTxHandler).handleV69() 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!