Showing 300 of 401 total issues
Function waku_store_query
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func waku_store_query(ctx unsafe.Pointer, queryJSON *C.char, peerID *C.char, ms C.int, cb C.WakuCallBack, userData unsafe.Pointer) C.int {
Function FilterUnsubscribe
has 7 return statements (exceeds 4 allowed). Open
Open
func FilterUnsubscribe(instance *WakuInstance, filterJSON string, peerID string, ms int) error {
cf, err := toContentFilter(filterJSON)
if err != nil {
return err
}
Function DecodeAsymmetric
has 7 return statements (exceeds 4 allowed). Open
Open
func DecodeAsymmetric(messageJSON string, privateKey string) (string, error) {
var msg pb.WakuMessage
err := json.Unmarshal([]byte(messageJSON), &msg)
if err != nil {
return "", err
Function StringToQR
has 7 return statements (exceeds 4 allowed). Open
Open
func StringToQR(qrString string) (QR, error) {
values := strings.Split(qrString, ":")
if len(values) != 5 {
return QR{}, errors.New("invalid qr string")
}
Method DynamicGroupManager.loadCredential
has 6 return statements (exceeds 4 allowed). Open
Open
func (gm *DynamicGroupManager) loadCredential(ctx context.Context) error {
if gm.appKeystore == nil {
gm.log.Warn("no credentials were loaded. Node will only validate messages, but wont be able to generate proofs and attach them to messages")
return nil
}
Function main
has 6 return statements (exceeds 4 allowed). Open
Open
func main() {
// Removing noisy logs
lvl, err := logging.LevelFromString("error")
if err != nil {
panic(err)
Method AppKeystore.AddMembershipCredentials
has 6 return statements (exceeds 4 allowed). Open
Open
func (k *AppKeystore) AddMembershipCredentials(newCredential MembershipCredentials, password string) error {
credentials, err := k.GetMembershipCredentials(password, &newCredential.TreeIndex, newCredential.MembershipContractInfo)
if err != nil {
return err
}
Method DynamicGroupManager.Start
has 6 return statements (exceeds 4 allowed). Open
Open
func (gm *DynamicGroupManager) Start(ctx context.Context) error {
if gm.cancel != nil {
return errors.New("already started")
}
Function Execute
has 6 return statements (exceeds 4 allowed). Open
Open
func Execute() error {
var cTopic, err = protocol.NewContentTopic("basic-relay", "1", "test", "proto")
if err != nil {
fmt.Println("Invalid contentTopic")
Function Execute
has 6 return statements (exceeds 4 allowed). Open
Open
func Execute() error {
var cTopic, err = protocol.NewContentTopic("basic-light-client", "1", "test", "proto")
if err != nil {
return errors.New("invalid contentTopic")
Method WakuStore.queryFrom
has 6 return statements (exceeds 4 allowed). Open
Open
func (store *WakuStore) queryFrom(ctx context.Context, historyRequest *pb.HistoryRPC, selectedPeer peer.ID) (*pb.HistoryResponse, error) {
logger := store.log.With(logging.HostID("peer", selectedPeer))
logger.Info("querying message history")
stream, err := store.h.NewStream(ctx, selectedPeer, StoreID_v20beta4)
Method WakuFilterLightNode.incorrectSubscribeRequest
has 6 return statements (exceeds 4 allowed). Open
Open
func (wf *WakuFilterLightNode) incorrectSubscribeRequest(ctx context.Context, params *FilterSubscribeParameters,
reqType pb.FilterSubscribeRequest_FilterSubscribeType, contentFilter protocol.ContentFilter) error {
const FilterSubscribeID_Incorrect1 = libp2pProtocol.ID("/vac/waku/filter-subscribe/abcd")
Function validateAndParse
has 6 return statements (exceeds 4 allowed). Open
Open
func validateAndParse(input []byte) (*DecodedPayload, error) {
end := len(input)
if end < 1 {
return nil, errors.New("invalid message length")
}
Method WakuStore.Find
has 6 return statements (exceeds 4 allowed). Open
Open
func (store *WakuStore) Find(ctx context.Context, query Query, cb CriteriaFN, opts ...HistoryRequestOption) (*wpb.WakuMessage, error) {
if cb == nil {
return nil, errors.New("callback can't be null")
}
Function DecodeSymmetric
has 6 return statements (exceeds 4 allowed). Open
Open
func DecodeSymmetric(messageJSON string, symmetricKey string) (string, error) {
var msg pb.WakuMessage
err := json.Unmarshal([]byte(messageJSON), &msg)
if err != nil {
return "", err
Method WakuMetadata.Connected
has 6 return statements (exceeds 4 allowed). Open
Open
func (wakuM *WakuMetadata) Connected(n network.Network, cc network.Conn) {
go func() {
defer utils.LogOnPanic()
wakuM.log.Debug("peer connected", zap.Stringer("peer", cc.RemotePeer()))
// Metadata verification is done only if a clusterID is specified
Function execute
has 6 return statements (exceeds 4 allowed). Open
Open
func execute(ctx context.Context) error {
rlnInstance, err := rln.NewRLN()
if err != nil {
return err
}
Function StringToContentTopic
has 6 return statements (exceeds 4 allowed). Open
Open
func StringToContentTopic(s string) (ContentTopic, error) {
p := strings.Split(s, "/")
switch len(p) {
case 5:
if len(p[1]) == 0 || len(p[2]) == 0 || len(p[3]) == 0 || len(p[4]) == 0 {
Function generateSecureRandomData
has 6 return statements (exceeds 4 allowed). Open
Open
func generateSecureRandomData(length int) ([]byte, error) {
x := make([]byte, length)
y := make([]byte, length)
res := make([]byte, length)
Function SetBootnodes
has 6 return statements (exceeds 4 allowed). Open
Open
func SetBootnodes(instance *WakuInstance, bootnodes string) error {
if err := validateInstance(instance, MustBeStarted); err != nil {
return err
}