aergoio/aergo

View on GitHub

Showing 1,051 of 1,052 total issues

Method V032Handshaker.DoForInbound has 6 return statements (exceeds 4 allowed).
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)
Severity: Major
Found in p2p/v030/v032handshake.go - About 40 mins to fix

    Method BlockHashesReceiver.handleInWaiting has 6 return statements (exceeds 4 allowed).
    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
    Severity: Major
    Found in p2p/hashreceiver.go - About 40 mins to fix

      Method BlockGenerator.GatherTXs has 6 return statements (exceeds 4 allowed).
      Open

      func (g *BlockGenerator) GatherTXs() ([]types.Transaction, error) {
          var (
              bState = g.bState
      
              nCollected int
      Severity: Major
      Found in consensus/chain/tx.go - About 40 mins to fix

        Method Web3APIv1.QueryContract has 6 return statements (exceeds 4 allowed).
        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
            }
        Severity: Major
        Found in rpc/web3/v1.go - About 40 mins to fix

          Method ChainDB.HasWal has 6 return statements (exceeds 4 allowed).
          Open

          func (cdb *ChainDB) HasWal(identity consensus.RaftIdentity) (bool, error) {
              var (
                  id   *consensus.RaftIdentity
                  last uint64
                  hs   *raftpb.HardState
          Severity: Major
          Found in chain/chaindbForRaft.go - About 40 mins to fix

            Method Web3APIv1.GetNameInfo has 6 return statements (exceeds 4 allowed).
            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
                }
            Severity: Major
            Found in rpc/web3/v1.go - About 40 mins to fix

              Method deployContract.readDefFile has 6 return statements (exceeds 4 allowed).
              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 {
              Severity: Major
              Found in cmd/brick/exec/deployContract.go - About 40 mins to fix

                Function newChainProcessor has 6 return statements (exceeds 4 allowed).
                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 {
                Severity: Major
                Found in chain/chainhandle.go - About 40 mins to fix

                  Function execVoteStat has 6 return statements (exceeds 4 allowed).
                  Open

                  func execVoteStat(cmd *cobra.Command, args []string) {
                      fflags := cmd.Flags()
                      if fflags.Changed("address") == true {
                          rawAddr, err := types.DecodeAddress(address)
                          if err != nil {
                  Severity: Major
                  Found in cmd/aergocli/cmd/vote.go - About 40 mins to fix

                    Function InitGenesisBPs has 6 return statements (exceeds 4 allowed).
                    Open

                    func InitGenesisBPs(states *statedb.StateDB, genesis *types.Genesis) error {
                        scs, err := statedb.GetSystemAccountState(states)
                        if err != nil {
                            return err
                        }
                    Severity: Major
                    Found in chain/governance.go - About 40 mins to fix

                      Method Web3APIv1.GetTX has 6 return statements (exceeds 4 allowed).
                      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
                          }
                      Severity: Major
                      Found in rpc/web3/v1.go - About 40 mins to fix

                        Function DumpFromStdin has 6 return statements (exceeds 4 allowed).
                        Open

                        func DumpFromStdin() error {
                            fi, err := os.Stdin.Stat()
                            if err != nil {
                                return err
                            }
                        Severity: Major
                        Found in cmd/aergoluac/util/luac_util.go - About 40 mins to fix

                          Method Web3APIv1.GetStateAndProof has 6 return statements (exceeds 4 allowed).
                          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
                              }
                          Severity: Major
                          Found in rpc/web3/v1.go - About 40 mins to fix

                            Function search has 6 return statements (exceeds 4 allowed).
                            Open

                            func search(cmd string, chunks []context.Chunk, current int, symbol string) map[string]string {
                                if keywords, ok := index[symbol]; ok {
                                    return keywords
                                }
                            
                            
                            Severity: Major
                            Found in cmd/brick/exec/search.go - About 40 mins to fix

                              Function isEqualMeta has 6 return statements (exceeds 4 allowed).
                              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
                                  }
                              Severity: Major
                              Found in cmd/polaris/server/mapservice.go - About 40 mins to fix

                                Method batch.readBatchFile has 6 return statements (exceeds 4 allowed).
                                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 {
                                Severity: Major
                                Found in cmd/brick/exec/batch.go - About 40 mins to fix

                                  Function getPasswd has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func getPasswd(cmd *cobra.Command, isNew bool) (string, error) {
                                      screen, fd := getTerminalReaderWriter()
                                      oldState, err := terminal.MakeRaw(fd)
                                      if err != nil {
                                          return "", err
                                  Severity: Major
                                  Found in cmd/aergocli/cmd/accounts.go - About 40 mins to fix

                                    Method Web3APIv1.QueryContractState has 6 return statements (exceeds 4 allowed).
                                    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
                                        }
                                    Severity: Major
                                    Found in rpc/web3/v1.go - About 40 mins to fix

                                      Method ReorgMarker.RecoverChainMapping has 6 return statements (exceeds 4 allowed).
                                      Open

                                      func (rm *ReorgMarker) RecoverChainMapping(cdb *ChainDB) error {
                                          best, err := cdb.GetBestBlock()
                                          if err != nil {
                                              return err
                                          }
                                      Severity: Major
                                      Found in chain/recover.go - About 40 mins to fix

                                        Method Trie.get has 6 return statements (exceeds 4 allowed).
                                        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
                                            }
                                        Severity: Major
                                        Found in pkg/trie/trie_tools.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language