waku-org/go-waku

View on GitHub

Showing 299 of 400 total issues

Function waku_add_peer has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

func waku_add_peer(ctx unsafe.Pointer, address *C.char, protocolID *C.char, cb C.WakuCallBack, userData unsafe.Pointer) C.int {
Severity: Minor
Found in library/c/api.go - About 35 mins to fix

    Function waku_encode_asymmetric has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func waku_encode_asymmetric(messageJSON *C.char, publicKey *C.char, optionalSigningKey *C.char, cb C.WakuCallBack, userData unsafe.Pointer) C.int {
    Severity: Minor
    Found in library/c/api_encoding.go - About 35 mins to fix

      Function NewContentTopic has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func NewContentTopic(applicationName string, applicationVersion string,
          contentTopicName string, encoding string, opts ...ContentTopicOption) (ContentTopic, error) {
      Severity: Minor
      Found in waku/v2/protocol/content_topic.go - About 35 mins to fix

        Method WakuFilterFullNode.reply has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func (wf *WakuFilterFullNode) reply(ctx context.Context, stream network.Stream, request *pb.FilterSubscribeRequest, statusCode int, description ...string) {
        Severity: Minor
        Found in waku/v2/protocol/filter/server.go - About 35 mins to fix

          Function NewWakuLightPush has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func NewWakuLightPush(relay *relay.WakuRelay, pm *peermanager.PeerManager, reg prometheus.Registerer, log *zap.Logger, opts ...Option) *WakuLightPush {
          Severity: Minor
          Found in waku/v2/protocol/lightpush/waku_lightpush.go - About 35 mins to fix

            Function waku_connect_peerid has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func waku_connect_peerid(ctx unsafe.Pointer, peerID *C.char, ms C.int, cb C.WakuCallBack, userData unsafe.Pointer) C.int {
            Severity: Minor
            Found in library/c/api.go - About 35 mins to fix

              Function LightpushPublish has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func LightpushPublish(instanceID uint, messageJSON string, topic string, peerID string, ms int) string {
              Severity: Minor
              Found in library/mobile/api_lightpush.go - About 35 mins to fix

                Function NewWakuStore has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func NewWakuStore(p MessageProvider, pm *peermanager.PeerManager, timesource timesource.Timesource, reg prometheus.Registerer, log *zap.Logger) *WakuStore {
                Severity: Minor
                Found in waku/v2/protocol/legacy_store/waku_store_common.go - About 35 mins to fix

                  Method MessageSender.Send has 5 return statements (exceeds 4 allowed).
                  Open

                  func (ms *MessageSender) Send(req *Request) error {
                      logger := ms.logger.With(
                          zap.Stringer("envelopeHash", req.envelope.Hash()),
                          zap.String("pubsubTopic", req.envelope.PubsubTopic()),
                          zap.String("contentTopic", req.envelope.Message().ContentTopic),
                  Severity: Major
                  Found in waku/v2/api/publish/message_sender.go - About 35 mins to fix

                    Function MakeHost has 5 return statements (exceeds 4 allowed).
                    Open

                    func MakeHost(ctx context.Context, port int, randomness io.Reader) (host.Host, error) {
                        // Creates a new RSA key pair for this host.
                        prvKey, _, err := crypto.GenerateKeyPairWithReader(crypto.RSA, 2048, randomness)
                        if err != nil {
                            log.Error(err.Error())
                    Severity: Major
                    Found in tests/utils.go - About 35 mins to fix

                      Function RetrieveNodes has 5 return statements (exceeds 4 allowed).
                      Open

                      func RetrieveNodes(ctx context.Context, url string, opts ...DNSDiscoveryOption) ([]DiscoveredNode, error) {
                          var discoveredNodes []DiscoveredNode
                      
                          params := new(dnsDiscoveryParameters)
                          for _, opt := range opts {
                      Severity: Major
                      Found in waku/v2/dnsdisc/enr.go - About 35 mins to fix

                        Method DB.Register has 5 return statements (exceeds 4 allowed).
                        Open

                        func (db *DB) Register(p peer.ID, ns string, signedPeerRecord []byte, ttl int) (uint64, error) {
                            pid := p.String()
                            expire := time.Now().Unix() + int64(ttl)
                        
                            tx, err := db.db.Begin()
                        Severity: Major
                        Found in waku/v2/rendezvous/db.go - About 35 mins to fix

                          Method MembershipFetcher.HandleGroupUpdates has 5 return statements (exceeds 4 allowed).
                          Open

                          func (mf *MembershipFetcher) HandleGroupUpdates(ctx context.Context, handler RegistrationEventHandler) error {
                              fromBlock := mf.web3Config.RLNContract.DeployedBlockNumber
                              metadata, err := mf.GetMetadata()
                              if err != nil {
                                  mf.log.Warn("could not load last processed block from metadata. Starting onchain sync from deployment block", zap.Error(err), zap.Uint64("deploymentBlock", mf.web3Config.RLNContract.DeployedBlockNumber))
                          Severity: Major
                          Found in waku/v2/protocol/rln/group_manager/dynamic/membership_fetcher.go - About 35 mins to fix

                            Function main has 5 return statements (exceeds 4 allowed).
                            Open

                            func main() {
                                hostAddr, _ := net.ResolveTCPAddr("tcp", "0.0.0.0:0")
                                key, err := randomHex(32)
                                if err != nil {
                                    log.Error("Could not generate random key", zap.Error(err))
                            Severity: Major
                            Found in examples/rln/main.go - About 35 mins to fix

                              Function Migrations has 5 return statements (exceeds 4 allowed).
                              Open

                              func Migrations(db *sql.DB, logger *zap.Logger) error {
                                  migrationDriver, err := migrationDriver(db)
                                  if err != nil {
                                      return err
                                  }
                              Severity: Major
                              Found in waku/persistence/sqlite/sqlite.go - About 35 mins to fix

                                Method PeerManager.SelectRandom has 5 return statements (exceeds 4 allowed).
                                Open

                                func (pm *PeerManager) SelectRandom(criteria PeerSelectionCriteria) (peer.IDSlice, error) {
                                    // @TODO We need to be more strategic about which peers we dial. Right now we just set one on the service.
                                    // Ideally depending on the query and our set  of peers we take a subset of ideal peers.
                                    // This will require us to check for various factors such as:
                                    //  - which topics they track
                                Severity: Major
                                Found in waku/v2/peermanager/peer_selection.go - About 35 mins to fix

                                  Method DB.Discover has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (db *DB) Discover(ns string, cookie []byte, limit int) ([]dbi.RegistrationRecord, []byte, error) {
                                      now := time.Now().Unix()
                                  
                                      var (
                                          counter int64
                                  Severity: Major
                                  Found in waku/v2/rendezvous/db.go - About 35 mins to fix

                                    Method WakuNode.startRlnRelay has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (w *WakuNode) startRlnRelay(ctx context.Context) error {
                                        rlnRelay := w.rlnRelay.(*rln.WakuRLNRelay)
                                    
                                        err := rlnRelay.Start(ctx)
                                        if err != nil {
                                    Severity: Major
                                    Found in waku/v2/node/wakunode2_rln.go - About 35 mins to fix

                                      Method Chat._doRequestMissingMessageFromStore has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (c *Chat) _doRequestMissingMessageFromStore(messageID string) error {
                                          ctx, cancel := context.WithTimeout(c.ctx, 10*time.Second)
                                          defer cancel()
                                      
                                          hash, err := base64.URLEncoding.DecodeString(messageID)
                                      Severity: Major
                                      Found in examples/chat2-reliable/peer_retrieval.go - About 35 mins to fix

                                        Function TestNetworkPartition has 5 return statements (exceeds 4 allowed).
                                        Open

                                        func TestNetworkPartition(t *testing.T) {
                                            ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
                                            defer cancel()
                                        
                                            t.Log("Starting TestMessageRecovery")
                                        Severity: Major
                                        Found in examples/chat2-reliable/chat_reliability_test.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language