Preparing report...

Report for github.com/SwingbyProtocol/tx-indexer

A+    Excellent!    Found 34 issues across 41 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!


gocyclo100%

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.

No problems detected. Good job!


golint17%

Golint is a linter for Go source code.

    • tx-indexer/chains/bnb/client.go
    • Line 16: warning: exported type Client should have comment or be unexported (golint)
    • Line 20: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 28: warning: exported method Client.GetLatestBlockHeight should have comment or be unexported (golint)
    • Line 37: warning: exported method Client.GetBlockTimeStamp should have comment or be unexported (golint)
    • Line 45: warning: exported method Client.GetBlockTransactions should have comment or be unexported (golint)
    • Line 56: warning: exported method Client.ResultBlockToComTxs should have comment or be unexported (golint)
    • tx-indexer/chains/eth/keeper.go
    • Line 21: warning: exported type Keeper should have comment or be unexported (golint)
    • Line 33: warning: exported function NewKeeper should have comment or be unexported (golint)
    • Line 45: warning: exported method Keeper.SetToken should have comment or be unexported (golint)
    • Line 51: warning: exported method Keeper.GetTxs should have comment or be unexported (golint)
    • Line 103: warning: exported method Keeper.UpdateTxs should have comment or be unexported (golint)
    • Line 113: warning: exported method Keeper.Start should have comment or be unexported (golint)
    • Line 156: warning: exported method Keeper.BroadcastTx should have comment or be unexported (golint)
    • Line 188: warning: exported method Keeper.Stop should have comment or be unexported (golint)
    • tx-indexer/common/amount.go
    • Line 12: warning: exported type Amount should have comment or be unexported (golint)
    • Line 35: warning: exported type DynamicAmount should have comment or be unexported (golint)
    • Line 41: warning: exported type AmountUnit should have comment or be unexported (golint)
    • Line 47: warning: exported function NewAmountFromFloat64 should have comment or be unexported (golint)
    • Line 61: warning: exported function NewAmountFromString should have comment or be unexported (golint)
    • Line 78: warning: exported function NewAmountFromInt64 should have comment or be unexported (golint)
    • Line 90: warning: exported function NewAmountFromBigIntDirect should have comment or be unexported (golint)
    • Line 98: warning: exported function NewAmountFromBigInt should have comment or be unexported (golint)
    • Line 102: warning: exported method DynamicAmount.Add should have comment or be unexported (golint)
    • Line 106: warning: exported method DynamicAmount.Sub should have comment or be unexported (golint)
    • Line 110: warning: exported method DynamicAmount.Equals should have comment or be unexported (golint)
    • Line 115: warning: exported method DynamicAmount.Int should have comment or be unexported (golint)
    • Line 119: warning: exported method DynamicAmount.Uint should have comment or be unexported (golint)
    • Line 123: warning: exported method DynamicAmount.DecimalCount should have comment or be unexported (golint)
    • Line 127: warning: exported method DynamicAmount.BigInt should have comment or be unexported (golint)
    • Line 131: warning: exported method DynamicAmount.FloorDecimals should have comment or be unexported (golint)
    • Line 164: warning: exported method DynamicAmount.StringFixedDecs should have comment or be unexported (golint)
    • tx-indexer/common/index.go
    • Line 3: warning: exported type Index should have comment or be unexported (golint)
    • Line 9: warning: exported type Idxs should have comment or be unexported (golint)
    • Line 11: warning: exported method Idxs.GetRangeTxs should have comment or be unexported (golint)
    • tx-indexer/chains/btc/types/block.go
    • Line 3: warning: exported type ChainInfo should have comment or be unexported (golint)
    • Line 10: warning: exported type BlockHash should have comment or be unexported (golint)
    • Line 14: warning: exported type Block should have comment or be unexported (golint)
    • Line 25: warning: exported method Block.GetTxIDs should have comment or be unexported (golint)
    • tx-indexer/chains/btc/client_rest.go
    • Line 10: warning: exported type Rest should have comment or be unexported (golint)
    • Line 14: warning: exported function NewRest should have comment or be unexported (golint)
    • Line 19: warning: exported method Rest.GetBlockChainInfo should have comment or be unexported (golint)
    • Line 28: warning: exported method Rest.GetBlockHash should have comment or be unexported (golint)
    • Line 37: warning: exported method Rest.GetBlock should have comment or be unexported (golint)
    • tx-indexer/api/client.go
    • Line 12: warning: exported type Client should have comment or be unexported (golint)
    • Line 18: warning: exported method Client.SendJSON should have comment or be unexported (golint)
    • Line 27: warning: exported method Client.Send should have comment or be unexported (golint)
    • Line 34: warning: exported method Client.Ping should have comment or be unexported (golint)
    • Line 43: warning: exported method Client.SetMsgHandlers should have comment or be unexported (golint)
    • Line 56: warning: exported method Client.ID should have comment or be unexported (golint)
    • Line 60: warning: exported method Client.Conn should have comment or be unexported (golint)
    • tx-indexer/api/resolver.go
    • Line 19: warning: exported type Resolver should have comment or be unexported (golint)
    • Line 25: warning: exported function NewResolver should have comment or be unexported (golint)
    • Line 38: warning: exported method Resolver.SetTimeout should have comment or be unexported (golint)
    • Line 43: warning: exported method Resolver.GetRequest should have comment or be unexported (golint)
    • Line 75: warning: exported method Resolver.PostRequest should have comment or be unexported (golint)
    • tx-indexer/chains/bnb/keeper.go
    • Line 24: warning: exported type Keeper should have comment or be unexported (golint)
    • Line 34: warning: exported function NewKeeper should have comment or be unexported (golint)
    • Line 59: warning: exported method Keeper.StartReScanAddr should have comment or be unexported (golint)
    • Line 64: warning: exported method Keeper.GetTxs should have comment or be unexported (golint)
    • Line 117: warning: exported method Keeper.GetTx should have comment or be unexported (golint)
    • Line 132: warning: exported method Keeper.GetMemoTxs should have comment or be unexported (golint)
    • Line 151: warning: exported method Keeper.Start should have comment or be unexported (golint)
    • Line 192: warning: exported method Keeper.StoreTxs should have comment or be unexported (golint)
    • Line 223: warning: exported method Keeper.GetBlockTimeStampWithCache should have comment or be unexported (golint)
    • Line 237: warning: exported method Keeper.Stop should have comment or be unexported (golint)
    • Line 241: warning: exported method Keeper.BroadcastTx should have comment or be unexported (golint)
    • tx-indexer/config/config.go
    • Line 12: warning: exported const DefaultBTCNode should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported type BTCConfig should have comment or be unexported (golint)
    • Line 36: warning: exported type ETHConfig should have comment or be unexported (golint)
    • Line 42: warning: exported type BNCConfig should have comment or be unexported (golint)
    • Line 47: warning: exported type LogConfig should have comment or be unexported (golint)
    • Line 51: warning: exported type P2PConfig should have comment or be unexported (golint)
    • Line 56: warning: exported type RESTConfig should have comment or be unexported (golint)
    • Line 61: warning: exported type WSConfig should have comment or be unexported (golint)
    • tx-indexer/api/rest.go
    • Line 10: warning: exported type Rest should have comment or be unexported (golint)
    • Line 16: warning: exported function NewREST should have comment or be unexported (golint)
    • Line 30: warning: exported method Rest.Start should have comment or be unexported (golint)
    • tx-indexer/chains/btc/types/tx.go
    • Line 7: warning: exported type Tx should have comment or be unexported (golint)
    • Line 21: warning: exported type Vin should have comment or be unexported (golint)
    • Line 29: warning: exported type Vout should have comment or be unexported (golint)
    • Line 38: warning: exported method Tx.GetTxID should have comment or be unexported (golint)
    • Line 42: warning: exported method Tx.GetWitnessID should have comment or be unexported (golint)
    • Line 46: warning: exported method Tx.AddBlockData should have comment or be unexported (golint)
    • Line 53: warning: exported method Tx.GetOutsAddrs should have comment or be unexported (golint)
    • tx-indexer/common/broadcast.go
    • Line 3: warning: exported type BroadcastParams should have comment or be unexported (golint)
    • Line 7: warning: exported type BroadcastResponse should have comment or be unexported (golint)
    • tx-indexer/chains/btc/client.go
    • Line 19: warning: exported const TxTypeReceived should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported type Client should have comment or be unexported (golint)
    • Line 29: warning: exported function NewBtcClient should have comment or be unexported (golint)
    • Line 50: warning: exported method Client.GetBlockTxs should have comment or be unexported (golint)
    • Line 81: warning: exported method Client.TxtoCommonTx should have comment or be unexported (golint)
    • Line 166: warning: exported method Client.GetTxByTxID should have comment or be unexported (golint)
    • tx-indexer/api/pubsub.go
    • Line 12: warning: exported type PubSub should have comment or be unexported (golint)
    • Line 19: warning: exported type Subscription should have comment or be unexported (golint)
    • Line 24: warning: exported function NewPubSub should have comment or be unexported (golint)
    • Line 36: warning: exported method PubSub.AddClient should have comment or be unexported (golint)
    • Line 42: warning: exported method PubSub.RemoveClient should have comment or be unexported (golint)
    • Line 54: warning: exported method PubSub.GetClientSubs should have comment or be unexported (golint)
    • Line 64: warning: exported method PubSub.Subscribe should have comment or be unexported (golint)
    • Line 78: warning: exported method PubSub.Unsubscribe should have comment or be unexported (golint)
    • Line 89: warning: exported method PubSub.Publish should have comment or be unexported (golint)
    • Line 98: warning: exported method PubSub.PublishJSON should have comment or be unexported (golint)
    • Line 119: warning: exported method PubSub.PublishPing should have comment or be unexported (golint)
    • tx-indexer/common/db.go
    • Line 10: warning: exported type Db should have comment or be unexported (golint)
    • Line 15: warning: exported function NewDB should have comment or be unexported (golint)
    • Line 19: warning: exported method Db.Start should have comment or be unexported (golint)
    • Line 29: warning: exported method Db.GetIdxs should have comment or be unexported (golint)
    • Line 43: warning: exported method Db.StoreIdx should have comment or be unexported (golint)
    • Line 74: warning: exported method Db.GetTx should have comment or be unexported (golint)
    • Line 88: warning: exported method Db.StoreTx should have comment or be unexported (golint)
    • Line 119: warning: exported method Db.GetMempoolTxs should have comment or be unexported (golint)
    • Line 134: warning: exported method Db.AddMempoolTxs should have comment or be unexported (golint)
    • Line 152: warning: exported method Db.StoreMempoolTxs should have comment or be unexported (golint)
    • Line 164: warning: exported method Db.GetMemoTxs should have comment or be unexported (golint)
    • Line 174: warning: exported method Db.StoreMemoTxs should have comment or be unexported (golint)
    • tx-indexer/common/response.go
    • Line 3: warning: exported type Response should have comment or be unexported (golint)
    • Line 8: warning: exported type TxResponse should have comment or be unexported (golint)
    • tx-indexer/chains/btc/keeper.go
    • Line 24: warning: exported type Keeper should have comment or be unexported (golint)
    • Line 36: warning: exported type MempoolTx should have comment or be unexported (golint)
    • Line 41: warning: exported function NewKeeper should have comment or be unexported (golint)
    • Line 66: warning: exported method Keeper.GetTxs should have comment or be unexported (golint)
    • Line 116: warning: exported method Keeper.GetTx should have comment or be unexported (golint)
    • Line 139: warning: exported method Keeper.Start should have comment or be unexported (golint)
    • Line 211: warning: exported method Keeper.GetPendings should have comment or be unexported (golint)
    • Line 221: warning: exported method Keeper.UpdateMemPoolTxs should have comment or be unexported (golint)
    • Line 232: warning: exported method Keeper.UpdateTx should have comment or be unexported (golint)
    • Line 268: warning: exported method Keeper.BroadcastTx should have comment or be unexported (golint)
    • Line 298: warning: exported method Keeper.StartNode should have comment or be unexported (golint)
    • tx-indexer/api/api.go
    • Line 3: warning: exported type API should have comment or be unexported (golint)
    • Line 8: warning: exported type APIConfig should have comment or be unexported (golint)
    • Line 14: warning: exported method APIConfig.AddAction should have comment or be unexported (golint)
    • Line 18: warning: exported function NewAPI should have comment or be unexported (golint)
    • Line 26: warning: exported method API.Start should have comment or be unexported (golint)
    • tx-indexer/chains/eth/client.go
    • Line 21: warning: exported type Client should have comment or be unexported (golint)
    • Line 28: warning: exported function NewClinet should have comment or be unexported (golint)
    • Line 36: warning: exported method Client.GetMempoolTxs should have comment or be unexported (golint)
    • Line 101: warning: exported method Client.GetEthereumTxs should have comment or be unexported (golint)
    • Line 122: warning: exported method Client.SyncLatestBlocks should have comment or be unexported (golint)
    • Line 131: warning: exported method Client.GetTxs should have comment or be unexported (golint)
    • tx-indexer/chains/btc/node/node.go
    • Line 20: warning: exported var DefualtNodeBootstrapCount should have comment or be unexported (golint)
    • Line 27: warning: exported type NodeConfig should have comment or be unexported (golint)
    • Line 44: warning: exported type Node should have comment or be unexported (golint)
    • Line 57: warning: exported function NewNode should have comment or be unexported (golint)
    • Line 94: warning: exported method Node.Start should have comment or be unexported (golint)
    • Line 108: warning: exported method Node.Stop should have comment or be unexported (golint)
    • Line 122: warning: exported method Node.GetConnectedPeer should have comment or be unexported (golint)
    • Line 129: warning: exported method Node.GetConnectedPeers should have comment or be unexported (golint)
    • Line 176: warning: exported method Node.AddPeer should have comment or be unexported (golint)
    • Line 209: warning: exported method Node.AddInvMsgTx should have comment or be unexported (golint)
    • Line 215: warning: exported method Node.GetInvMsgTx should have comment or be unexported (golint)
    • Line 222: warning: exported method Node.RemoveInvTx should have comment or be unexported (golint)
    • Line 232: warning: exported method Node.BroadcastTxInv should have comment or be unexported (golint)
    • tx-indexer/common/tx.go
    • Line 12: warning: exported type Txs should have comment or be unexported (golint)
    • Line 14: warning: exported method Txs.SendMempool should have comment or be unexported (golint)
    • Line 28: warning: exported method Txs.ReceiveMempool should have comment or be unexported (golint)
    • Line 42: warning: exported method Txs.Sort should have comment or be unexported (golint)
    • Line 48: warning: exported method Txs.Page should have comment or be unexported (golint)
    • Line 72: warning: exported type Transaction should have comment or be unexported (golint)
    • Line 85: warning: exported type TxJSON should have comment or be unexported (golint)
    • Line 99: warning: exported method Transaction.Serialize should have comment or be unexported (golint)
    • Line 103: warning: exported method Transaction.MarshalJSON should have comment or be unexported (golint)
    • Line 120: warning: exported method TxJSON.ToCommTx should have comment or be unexported (golint)
    • tx-indexer/api/action.go
    • Line 7: warning: exported type Action should have comment or be unexported (golint)
    • Line 14: warning: exported function NewWatch should have comment or be unexported (golint)
    • Line 23: warning: exported function NewPOST should have comment or be unexported (golint)
    • Line 32: warning: exported function NewGet should have comment or be unexported (golint)
    • tx-indexer/api/message.go
    • Line 3: warning: exported type MsgWsRequest should have comment or be unexported (golint)
    • Line 9: warning: exported type MsgWSResponse should have comment or be unexported (golint)
    • Line 17: warning: exported type Params should have comment or be unexported (golint)
    • Line 28: warning: exported type Response should have comment or be unexported (golint)
    • Line 36: warning: exported function NewSuccessResponse should have comment or be unexported (golint)
    • Line 46: warning: exported function NewErrorResponse should have comment or be unexported (golint)
    • tx-indexer/api/ws.go
    • Line 12: warning: exported type Websocket should have comment or be unexported (golint)
    • Line 18: warning: exported function NewWebsocket should have comment or be unexported (golint)
    • Line 27: warning: exported method Websocket.Publish should have comment or be unexported (golint)
    • Line 31: warning: exported method Websocket.Start should have comment or be unexported (golint)
    • tx-indexer/utils/utils.go
    • Line 20: warning: exported const WitnessScaleFactor should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported function RandRange should have comment or be unexported (golint)
    • Line 28: warning: exported function SortTx should have comment or be unexported (golint)
    • Line 33: warning: exported function GetMaxMin should have comment or be unexported (golint)
    • Line 57: warning: exported function GetTransactionWeight should have comment or be unexported (golint)
    • Line 64: warning: exported function ValueSat should have comment or be unexported (golint)
    • Line 71: warning: exported function MsgTxToTx should have comment or be unexported (golint)
    • Line 107: warning: exported function ScriptToPubkeyInfo should have comment or be unexported (golint)
    • Line 130: warning: exported function MsgBlockToBlock should have comment or be unexported (golint)
    • Line 141: warning: exported function DecodeToTx should have comment or be unexported (golint)
    • tx-indexer/common/symbol.go
    • Line 6: warning: exported var BTC should have comment or be unexported (golint)
    • Line 13: warning: comment on exported var Symbols should be of the form "Symbols ..." (golint)
    • Line 16: warning: exported type Symbol should have comment or be unexported (golint)
    • Line 21: warning: exported function NewSymbol should have comment or be unexported (golint)
    • Line 25: warning: exported method Symbol.Decimlas should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell97%

Misspell Finds commonly misspelled English words