Showing 299 of 400 total issues
Function waku_add_peer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func waku_add_peer(ctx unsafe.Pointer, address *C.char, protocolID *C.char, cb C.WakuCallBack, userData unsafe.Pointer) C.int {
Function waku_encode_asymmetric
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func waku_encode_asymmetric(messageJSON *C.char, publicKey *C.char, optionalSigningKey *C.char, cb C.WakuCallBack, userData unsafe.Pointer) C.int {
Function NewContentTopic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewContentTopic(applicationName string, applicationVersion string,
contentTopicName string, encoding string, opts ...ContentTopicOption) (ContentTopic, error) {
Method WakuFilterFullNode.reply
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (wf *WakuFilterFullNode) reply(ctx context.Context, stream network.Stream, request *pb.FilterSubscribeRequest, statusCode int, description ...string) {
Function NewWakuLightPush
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewWakuLightPush(relay *relay.WakuRelay, pm *peermanager.PeerManager, reg prometheus.Registerer, log *zap.Logger, opts ...Option) *WakuLightPush {
Function waku_connect_peerid
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func waku_connect_peerid(ctx unsafe.Pointer, peerID *C.char, ms C.int, cb C.WakuCallBack, userData unsafe.Pointer) C.int {
Function LightpushPublish
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func LightpushPublish(instanceID uint, messageJSON string, topic string, peerID string, ms int) string {
Function NewWakuStore
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewWakuStore(p MessageProvider, pm *peermanager.PeerManager, timesource timesource.Timesource, reg prometheus.Registerer, log *zap.Logger) *WakuStore {
Method MessageSender.Send
has 5 return statements (exceeds 4 allowed). Open
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),
Function MakeHost
has 5 return statements (exceeds 4 allowed). Open
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())
Function RetrieveNodes
has 5 return statements (exceeds 4 allowed). Open
Open
func RetrieveNodes(ctx context.Context, url string, opts ...DNSDiscoveryOption) ([]DiscoveredNode, error) {
var discoveredNodes []DiscoveredNode
params := new(dnsDiscoveryParameters)
for _, opt := range opts {
Method DB.Register
has 5 return statements (exceeds 4 allowed). Open
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()
Method MembershipFetcher.HandleGroupUpdates
has 5 return statements (exceeds 4 allowed). Open
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))
Function main
has 5 return statements (exceeds 4 allowed). Open
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))
Function Migrations
has 5 return statements (exceeds 4 allowed). Open
Open
func Migrations(db *sql.DB, logger *zap.Logger) error {
migrationDriver, err := migrationDriver(db)
if err != nil {
return err
}
Method PeerManager.SelectRandom
has 5 return statements (exceeds 4 allowed). Open
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
Method DB.Discover
has 5 return statements (exceeds 4 allowed). Open
Open
func (db *DB) Discover(ns string, cookie []byte, limit int) ([]dbi.RegistrationRecord, []byte, error) {
now := time.Now().Unix()
var (
counter int64
Method WakuNode.startRlnRelay
has 5 return statements (exceeds 4 allowed). Open
Open
func (w *WakuNode) startRlnRelay(ctx context.Context) error {
rlnRelay := w.rlnRelay.(*rln.WakuRLNRelay)
err := rlnRelay.Start(ctx)
if err != nil {
Method Chat._doRequestMissingMessageFromStore
has 5 return statements (exceeds 4 allowed). Open
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)
Function TestNetworkPartition
has 5 return statements (exceeds 4 allowed). Open
Open
func TestNetworkPartition(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
defer cancel()
t.Log("Starting TestMessageRecovery")