Report for github.com/Focinfi/ckb-sdk-go

A+    Excellent!    Found 88 issues across 126 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo99%

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.

    • ckb-sdk-go/utils/sgin.go
    • Line 101: warning: cyclomatic complexity 18 of function MultiSignTransaction() is high (> 15) (gocyclo)
    • Line 16: warning: cyclomatic complexity 17 of function SignTransaction() is high (> 15) (gocyclo)

golint30%

Golint is a linter for Go source code.

    • ckb-sdk-go/types/ckbtypes/cell.go
    • Line 3: warning: exported type CellInfo should have comment or be unexported (golint)
    • Line 9: warning: exported type CellOutputWithOutPoint should have comment or be unexported (golint)
    • Line 16: warning: exported type LiveCell should have comment or be unexported (golint)
    • ckb-sdk-go/types/constants.go
    • Line 3: warning: exported const BlockAssemblerCodeHash should have comment or be unexported (golint)
    • Line 5: warning: exported const OneCKBShannon should have comment or be unexported (golint)
    • ckb-sdk-go/rpc/client.go
    • Line 3: warning: exported const DefaultURL should have comment or be unexported (golint)
    • Line 5: warning: exported type Client should have comment or be unexported (golint)
    • Line 9: warning: exported function NewClient should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/witness.go
    • Line 5: warning: exported type Witness should have comment or be unexported (golint)
    • Line 7: warning: exported type Witnesses should have comment or be unexported (golint)
    • Line 9: warning: exported function NewWitnessesByHexes should have comment or be unexported (golint)
    • Line 13: warning: exported function NewWitnessesByInterfaces should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/witness_args.go
    • Line 8: warning: exported type WitnessArgs should have comment or be unexported (golint)
    • Line 15: warning: exported method WitnessArgs.Serialize should have comment or be unexported (golint)
    • Line 22: warning: exported function NewWitnessArgs should have comment or be unexported (golint)
    • Line 48: warning: exported function NewWitnessArgsDynVec should have comment or be unexported (golint)
    • ckb-sdk-go/types/ckbtypes/output.go
    • Line 5: warning: exported type Output should have comment or be unexported (golint)
    • Line 11: warning: exported method Output.Clone should have comment or be unexported (golint)
    • Line 30: warning: exported method Output.ByteSize should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/interface.go
    • Line 9: warning: exported const Uint32Capacity should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported type Capacity should have comment or be unexported (golint)
    • Line 20: warning: exported type Since should have comment or be unexported (golint)
    • Line 21: warning: exported type CodeHash should have comment or be unexported (golint)
    • Line 22: warning: exported type DepType should have comment or be unexported (golint)
    • Line 23: warning: exported type HashType should have comment or be unexported (golint)
    • Line 24: warning: exported type HeaderDep should have comment or be unexported (golint)
    • Line 25: warning: exported type OutPointTxHash should have comment or be unexported (golint)
    • Line 26: warning: exported type OutPointIndex should have comment or be unexported (golint)
    • Line 27: warning: exported type Arg should have comment or be unexported (golint)
    • Line 28: warning: exported type OutputData should have comment or be unexported (golint)
    • Line 29: warning: exported type Version should have comment or be unexported (golint)
    • Line 33: warning: exported var DepTypeCode should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/script.go
    • Line 8: warning: exported type Script should have comment or be unexported (golint)
    • Line 15: warning: exported method Script.Serialize should have comment or be unexported (golint)
    • Line 22: warning: exported function NewScript should have comment or be unexported (golint)
    • ckb-sdk-go/rpc/net.go
    • Line 12: warning: exported method Client.LockNodeInfo should have comment or be unexported (golint)
    • Line 26: warning: exported method Client.GetPeers should have comment or be unexported (golint)
    • Line 40: warning: exported method Client.GetBannedAddresses should have comment or be unexported (golint)
    • Line 54: warning: exported method Client.SetBan should have comment or be unexported (golint)
    • ckb-sdk-go/types/hex_number.go
    • Line 13: warning: exported const Hex0 should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported type HexUint64 should have comment or be unexported (golint)
    • Line 21: warning: exported method HexUint64.Uint64 should have comment or be unexported (golint)
    • Line 25: warning: exported method HexUint64.UnmarshalJSON should have comment or be unexported (golint)
    • Line 42: warning: exported method HexUint64.Hex should have comment or be unexported (golint)
    • Line 46: warning: exported method HexUint64.LittleEndianString should have comment or be unexported (golint)
    • Line 51: warning: exported method HexUint64.LittleEndianBytes should have comment or be unexported (golint)
    • Line 69: warning: exported method HexUint64.BigEndianBytes should have comment or be unexported (golint)
    • Line 87: warning: exported function ParseHexUint64 should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/dyn_vec.go
    • Line 5: warning: exported type DynVec should have comment or be unexported (golint)
    • Line 11: warning: exported method DynVec.Serialize should have comment or be unexported (golint)
    • Line 15: warning: exported method DynVec.Header should have comment or be unexported (golint)
    • Line 24: warning: exported function NewDynVec should have comment or be unexported (golint)
    • Line 51: warning: exported function NewHexDynVec should have comment or be unexported (golint)
    • Line 68: warning: exported method ByteDynVec.Serialize should have comment or be unexported (golint)
    • Line 72: warning: exported function NewByteDynVecByHexes should have comment or be unexported (golint)
    • ckb-sdk-go/types/hex_str.go
    • Line 11: warning: exported const HexStrPrefix should have comment or be unexported (golint)
    • Line 13: warning: exported type HexStr should have comment or be unexported (golint)
    • Line 18: warning: exported function ParseHexStr should have comment or be unexported (golint)
    • Line 44: warning: exported function NewHexStr should have comment or be unexported (golint)
    • Line 51: warning: exported method HexStr.ToHexUint64 should have comment or be unexported (golint)
    • Line 62: warning: exported method HexStr.Bytes should have comment or be unexported (golint)
    • Line 66: warning: exported method HexStr.Hex should have comment or be unexported (golint)
    • Line 70: warning: exported method HexStr.Len should have comment or be unexported (golint)
    • Line 74: warning: exported method HexStr.Append should have comment or be unexported (golint)
    • Line 78: warning: exported method HexStr.AppendBytes should have comment or be unexported (golint)
    • ckb-sdk-go/types/addrtypes/hash.go
    • Line 9: warning: exported type CodeHashIndex should have comment or be unexported (golint)
    • Line 20: warning: exported function IsAllowedHashType should have comment or be unexported (golint)
    • Line 29: warning: exported type HashInfo should have comment or be unexported (golint)
    • Line 34: warning: exported function NewHashInfo should have comment or be unexported (golint)
    • ckb-sdk-go/address/parsers.go
    • Line 43: warning: comment on exported function ParseShortPayloadAddress should be of the form "ParseShortPayloadAddress ..." (golint)
    • Line 61: warning: exported function ParseShortPayloadAddressArg should have comment or be unexported (golint)
    • Line 84: warning: comment on exported function ParseFullPayloadAddress should be of the form "ParseFullPayloadAddress ..." (golint)
    • ckb-sdk-go/serializers/option.go
    • Line 3: warning: exported type ByteFixVecOption should have comment or be unexported (golint)
    • Line 7: warning: exported method ByteFixVecOption.Serialize should have comment or be unexported (golint)
    • Line 14: warning: exported function NewByteFixVecOption should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/out_point.go
    • Line 8: warning: exported type OutPoint should have comment or be unexported (golint)
    • Line 14: warning: exported method OutPoint.Serialize should have comment or be unexported (golint)
    • Line 21: warning: exported function NewOutPoint should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/transaction.go
    • Line 8: warning: exported type Transaction should have comment or be unexported (golint)
    • Line 14: warning: exported method Transaction.Serialize should have comment or be unexported (golint)
    • Line 21: warning: exported function NewTransaction should have comment or be unexported (golint)
    • ckb-sdk-go/utils/sgin.go
    • Line 16: warning: exported function SignTransaction should have comment or be unexported (golint)
    • Line 101: warning: exported function MultiSignTransaction should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/cell_dep.go
    • Line 10: warning: exported type CellDep should have comment or be unexported (golint)
    • Line 16: warning: exported method CellDep.Serialize should have comment or be unexported (golint)
    • Line 23: warning: exported function NewCellDepFixVec should have comment or be unexported (golint)
    • Line 47: warning: exported function NewDepType should have comment or be unexported (golint)
    • ckb-sdk-go/rpc/stats.go
    • Line 11: warning: exported method Client.GetBlockchainInfo should have comment or be unexported (golint)
    • Line 25: warning: exported method Client.GetPeersState should have comment or be unexported (golint)
    • ckb-sdk-go/rpc/chain.go
    • Line 12: warning: exported method Client.GetTipBlockNumber should have comment or be unexported (golint)
    • Line 26: warning: exported method Client.GetTipHeader should have comment or be unexported (golint)
    • Line 40: warning: exported method Client.GetCurrentEpoch should have comment or be unexported (golint)
    • Line 54: warning: exported method Client.GetEpochByNumber should have comment or be unexported (golint)
    • Line 68: warning: exported method Client.GetBlockHash should have comment or be unexported (golint)
    • Line 82: warning: exported method Client.GetBlock should have comment or be unexported (golint)
    • Line 96: warning: exported method Client.GetBlockByNumber should have comment or be unexported (golint)
    • Line 110: warning: exported method Client.GetHeader should have comment or be unexported (golint)
    • Line 124: warning: exported method Client.GetHeaderByNumber should have comment or be unexported (golint)
    • Line 138: warning: exported method Client.GetCellsByLockHash should have comment or be unexported (golint)
    • Line 153: warning: exported method Client.GetLiveCell should have comment or be unexported (golint)
    • Line 168: warning: exported method Client.GetTransaction should have comment or be unexported (golint)
    • Line 183: warning: exported method Client.GetCellBaseOutputCapacityDetails should have comment or be unexported (golint)
    • ckb-sdk-go/address/address.go
    • Line 44: warning: comment on exported method Address.GenerateShortPayloadFormatAddress should be of the form "GenerateShortPayloadFormatAddress ..." (golint)
    • ckb-sdk-go/serializers/byte32.go
    • Line 10: warning: exported type Byte32 should have comment or be unexported (golint)
    • Line 12: warning: exported method Byte32.Serialize should have comment or be unexported (golint)
    • Line 19: warning: exported function NewByte32 should have comment or be unexported (golint)
    • ckb-sdk-go/types/errtypes/errors.go
    • Line 5: warning: exported type ErrType should have comment or be unexported (golint)
    • Line 101: warning: exported type Error should have comment or be unexported (golint)
    • Line 106: warning: exported function WrapErr should have comment or be unexported (golint)
    • Line 117: warning: exported method Error.IsA should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/raw_transaction.go
    • Line 8: warning: exported type RawTransaction should have comment or be unexported (golint)
    • Line 18: warning: exported method RawTransaction.Serialize should have comment or be unexported (golint)
    • Line 25: warning: exported function NewRawTransaction should have comment or be unexported (golint)
    • ckb-sdk-go/types/addrtypes/format.go
    • Line 3: warning: exported type FormatType should have comment or be unexported (golint)
    • Line 16: warning: exported function IsAllowdedFormatType should have comment or be unexported (golint)
    • Line 25: warning: exported function IsFullPayloadFormatType should have comment or be unexported (golint)
    • ckb-sdk-go/types/ckbtypes/transaction.go
    • Line 3: warning: exported type Transaction should have comment or be unexported (golint)
    • Line 14: warning: exported method Transaction.ToRaw should have comment or be unexported (golint)
    • Line 26: warning: exported type RawTransaction should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/input.go
    • Line 8: warning: exported type Input should have comment or be unexported (golint)
    • Line 14: warning: exported method Input.Serialize should have comment or be unexported (golint)
    • Line 21: warning: exported function NewInput should have comment or be unexported (golint)
    • Line 40: warning: exported function NewInputsFixVec should have comment or be unexported (golint)
    • ckb-sdk-go/wallet/multi_sign_wallet.go
    • Line 18: warning: exported type MultiSignWalletConfig should have comment or be unexported (golint)
    • Line 25: warning: exported function NewMultiSignWalletConfig should have comment or be unexported (golint)
    • Line 37: warning: exported method MultiSignWalletConfig.Serialize should have comment or be unexported (golint)
    • Line 54: warning: exported method MultiSignWalletConfig.Blake160 should have comment or be unexported (golint)
    • Line 62: warning: exported method MultiSignWalletConfig.LockArgs should have comment or be unexported (golint)
    • Line 71: warning: exported type MultiSignWallet should have comment or be unexported (golint)
    • Line 81: warning: exported function NewMultiSignWallet should have comment or be unexported (golint)
    • Line 111: warning: exported method MultiSignWallet.Address should have comment or be unexported (golint)
    • Line 122: warning: exported method MultiSignWallet.GetBalance should have comment or be unexported (golint)
    • Line 128: warning: exported method MultiSignWallet.Lock should have comment or be unexported (golint)
    • Line 132: warning: exported method MultiSignWallet.GenerateTx should have comment or be unexported (golint)
    • Line 196: warning: exported method MultiSignWallet.SendCapacity should have comment or be unexported (golint)
    • ckb-sdk-go/rpc/pool.go
    • Line 11: warning: exported method Client.SendTransaction should have comment or be unexported (golint)
    • Line 26: warning: exported method Client.TxPoolInfo should have comment or be unexported (golint)
    • ckb-sdk-go/version.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 3: warning: exported const Version should have comment or be unexported (golint)
    • ckb-sdk-go/utils/hash.go
    • Line 11: warning: exported function ScriptHash should have comment or be unexported (golint)
    • Line 23: warning: exported function NewLockScript should have comment or be unexported (golint)
    • Line 35: warning: exported function LockScriptHash should have comment or be unexported (golint)
    • Line 43: warning: exported function RawTransactionHash should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/table.go
    • Line 3: warning: exported type Table should have comment or be unexported (golint)
    • Line 7: warning: exported method Table.Serialize should have comment or be unexported (golint)
    • Line 11: warning: exported function NewTable should have comment or be unexported (golint)
    • ckb-sdk-go/rpc/indexer.go
    • Line 12: warning: exported method Client.IndexLockHash should have comment or be unexported (golint)
    • Line 27: warning: exported method Client.GetLockHashIndexStats should have comment or be unexported (golint)
    • Line 41: warning: exported method Client.GetLiveCellsByLockHash should have comment or be unexported (golint)
    • Line 56: warning: exported method Client.GetTransactionByLockHash should have comment or be unexported (golint)
    • Line 71: warning: exported method Client.DeindexLockHash should have comment or be unexported (golint)
    • ckb-sdk-go/types/addrtypes/prefix.go
    • Line 8: warning: exported const PrefixTestNet should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: exported function IsAllowedPrefix should have comment or be unexported (golint)
    • Line 23: warning: exported function PrefixForMode should have comment or be unexported (golint)
    • ckb-sdk-go/rpc/experiment.go
    • Line 12: warning: exported method Client.DryRunTransaction should have comment or be unexported (golint)
    • Line 26: warning: exported method Client.CalculateDAOMaximumWithdraw should have comment or be unexported (golint)
    • Line 41: warning: exported method Client.EstimateFeeRate should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/fix_vec.go
    • Line 8: warning: exported type FixVec should have comment or be unexported (golint)
    • Line 14: warning: exported method FixVec.Serialize should have comment or be unexported (golint)
    • Line 18: warning: exported method FixVec.Header should have comment or be unexported (golint)
    • Line 22: warning: exported function NewFixVec should have comment or be unexported (golint)
    • Line 39: warning: exported type ByteFixVec should have comment or be unexported (golint)
    • Line 43: warning: exported method ByteFixVec.Serialize should have comment or be unexported (golint)
    • Line 47: warning: exported function NewByteFixVec should have comment or be unexported (golint)
    • Line 57: warning: exported function NewByteFixVecByHex should have comment or be unexported (golint)
    • Line 65: warning: exported type Byte32FixVec should have comment or be unexported (golint)
    • Line 69: warning: exported function NewByte32FixVec should have comment or be unexported (golint)
    • Line 83: warning: exported function NewByte32FixVecByHexes should have comment or be unexported (golint)
    • ckb-sdk-go/serializers/output.go
    • Line 8: warning: exported type Output should have comment or be unexported (golint)
    • Line 15: warning: exported method Output.InitSerializer should have comment or be unexported (golint)
    • Line 28: warning: exported method Output.Serialize should have comment or be unexported (golint)
    • Line 35: warning: exported function NewOutput should have comment or be unexported (golint)
    • Line 60: warning: exported function NewOutputsDynVec should have comment or be unexported (golint)
    • ckb-sdk-go/rpc/common.go
    • Line 19: warning: exported type ReqBody should have comment or be unexported (golint)
    • Line 26: warning: exported type RespBody should have comment or be unexported (golint)
    • Line 33: warning: exported function RawHTTPPost should have comment or be unexported (golint)
    • ckb-sdk-go/types/mode.go
    • Line 3: warning: exported type Mode should have comment or be unexported (golint)
    • Line 6: warning: exported const ModeTestNet should have comment (or a comment on this block) or be unexported (golint)
    • ckb-sdk-go/rpc/miner.go
    • Line 14: warning: exported method Client.GetBlockTemplate should have comment or be unexported (golint)
    • Line 29: warning: exported method Client.SubmitBlock should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!