Showing 1,051 of 1,052 total issues
Method V032Handshaker.DoForInbound
has 6 return statements (exceeds 4 allowed). Open
Open
func (h *V032Handshaker) DoForInbound(ctx context.Context) (*p2pcommon.HandshakeResult, error) {
h.logger.Debug().Stringer(p2putil.LogPeerID, types.LogPeerShort(h.peerID)).Msg("Starting versioned handshake for inbound peer connection")
// inbound: receive, check and send
remotePeerStatus, err := h.receiveRemoteStatus(ctx)
Method BlockHashesReceiver.handleInWaiting
has 6 return statements (exceeds 4 allowed). Open
Open
func (br *BlockHashesReceiver) handleInWaiting(msg p2pcommon.Message, msgBody p2pcommon.MessageBody) {
// consuming request id when timeout, no more resp expected (i.e. hasNext == false ) or malformed body.
// timeout
if br.timeout.Before(time.Now()) {
// silently ignore already status job
Method BlockGenerator.GatherTXs
has 6 return statements (exceeds 4 allowed). Open
Open
func (g *BlockGenerator) GatherTXs() ([]types.Transaction, error) {
var (
bState = g.bState
nCollected int
Method Web3APIv1.QueryContract
has 6 return statements (exceeds 4 allowed). Open
Open
func (api *Web3APIv1) QueryContract() (handler http.Handler, ok bool) {
values, err := url.ParseQuery(api.request.URL.RawQuery)
if err != nil {
return commonResponseHandler(&types.Empty{}, err), true
}
Method ChainDB.HasWal
has 6 return statements (exceeds 4 allowed). Open
Open
func (cdb *ChainDB) HasWal(identity consensus.RaftIdentity) (bool, error) {
var (
id *consensus.RaftIdentity
last uint64
hs *raftpb.HardState
Method Web3APIv1.GetNameInfo
has 6 return statements (exceeds 4 allowed). Open
Open
func (api *Web3APIv1) GetNameInfo() (handler http.Handler, ok bool) {
values, err := url.ParseQuery(api.request.URL.RawQuery)
if err != nil {
return commonResponseHandler(&types.Empty{}, err), true
}
Method deployContract.readDefFile
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *deployContract) readDefFile(defPath string) ([]byte, error) {
if strings.HasPrefix(defPath, "http") {
// search in the web
req, err := http.NewRequest("GET", defPath, nil)
if err != nil {
Function newChainProcessor
has 6 return statements (exceeds 4 allowed). Open
Open
func newChainProcessor(block *types.Block, state *state.BlockState, cs *ChainService) (*chainProcessor, error) {
var isMainChain bool
var err error
if isMainChain, err = cs.cdb.isMainChain(block); err != nil {
Function execVoteStat
has 6 return statements (exceeds 4 allowed). Open
Open
func execVoteStat(cmd *cobra.Command, args []string) {
fflags := cmd.Flags()
if fflags.Changed("address") == true {
rawAddr, err := types.DecodeAddress(address)
if err != nil {
Function InitGenesisBPs
has 6 return statements (exceeds 4 allowed). Open
Open
func InitGenesisBPs(states *statedb.StateDB, genesis *types.Genesis) error {
scs, err := statedb.GetSystemAccountState(states)
if err != nil {
return err
}
Method Web3APIv1.GetTX
has 6 return statements (exceeds 4 allowed). Open
Open
func (api *Web3APIv1) GetTX() (handler http.Handler, ok bool) {
values, err := url.ParseQuery(api.request.URL.RawQuery)
if err != nil {
return commonResponseHandler(&types.Empty{}, err), true
}
Function DumpFromStdin
has 6 return statements (exceeds 4 allowed). Open
Open
func DumpFromStdin() error {
fi, err := os.Stdin.Stat()
if err != nil {
return err
}
Method Web3APIv1.GetStateAndProof
has 6 return statements (exceeds 4 allowed). Open
Open
func (api *Web3APIv1) GetStateAndProof() (handler http.Handler, ok bool) {
values, err := url.ParseQuery(api.request.URL.RawQuery)
if err != nil {
return commonResponseHandler(&types.Empty{}, err), true
}
Function search
has 6 return statements (exceeds 4 allowed). Open
Open
func search(cmd string, chunks []context.Chunk, current int, symbol string) map[string]string {
if keywords, ok := index[symbol]; ok {
return keywords
}
Function isEqualMeta
has 6 return statements (exceeds 4 allowed). Open
Open
func isEqualMeta(m1, m2 p2pcommon.PeerMeta) (eq bool) {
eq = false
if m1.ID != m2.ID || m1.Role != m2.Role || m1.Version != m2.Version {
return
}
Method batch.readBatchFile
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *batch) readBatchFile(batchFilePath string) ([]string, error) {
if strings.HasPrefix(batchFilePath, "http") {
// search in the web
req, err := http.NewRequest("GET", batchFilePath, nil)
if err != nil {
Function getPasswd
has 6 return statements (exceeds 4 allowed). Open
Open
func getPasswd(cmd *cobra.Command, isNew bool) (string, error) {
screen, fd := getTerminalReaderWriter()
oldState, err := terminal.MakeRaw(fd)
if err != nil {
return "", err
Method Web3APIv1.QueryContractState
has 6 return statements (exceeds 4 allowed). Open
Open
func (api *Web3APIv1) QueryContractState() (handler http.Handler, ok bool) {
values, err := url.ParseQuery(api.request.URL.RawQuery)
if err != nil {
return commonResponseHandler(&types.Empty{}, err), true
}
Method ReorgMarker.RecoverChainMapping
has 6 return statements (exceeds 4 allowed). Open
Open
func (rm *ReorgMarker) RecoverChainMapping(cdb *ChainDB) error {
best, err := cdb.GetBestBlock()
if err != nil {
return err
}
Method Trie.get
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Trie) get(root, key []byte, batch [][]byte, iBatch, height int) ([]byte, error) {
if len(root) == 0 {
// the trie does not contain the key
return nil, nil
}