waku-org/go-waku

View on GitHub
waku/v2/protocol/lightpush/waku_lightpush.go

Summary

Maintainability
B
4 hrs
Test Coverage
C
76%

Method WakuLightPush.onRequest has 57 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (wakuLP *WakuLightPush) onRequest(ctx context.Context) func(network.Stream) {
    return func(stream network.Stream) {
        logger := wakuLP.log.With(logging.HostID("peer", stream.Conn().RemotePeer()))
        requestPushRPC := &pb.PushRpc{}

Severity: Minor
Found in waku/v2/protocol/lightpush/waku_lightpush.go - About 1 hr to fix

    Method WakuLightPush.handleOpts has 51 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (wakuLP *WakuLightPush) handleOpts(ctx context.Context, message *wpb.WakuMessage, opts ...RequestOption) (*lightPushRequestParameters, error) {
        params := new(lightPushRequestParameters)
        params.host = wakuLP.h
        params.log = wakuLP.log
        params.pm = wakuLP.pm
    Severity: Minor
    Found in waku/v2/protocol/lightpush/waku_lightpush.go - About 1 hr to fix

      Method WakuLightPush.request has 6 return statements (exceeds 4 allowed).
      Open

      func (wakuLP *WakuLightPush) request(ctx context.Context, req *pb.PushRequest, params *lightPushRequestParameters, peerID peer.ID) (*pb.PushResponse, error) {
      
          logger := wakuLP.log.With(logging.HostID("peer", peerID))
      
          stream, err := wakuLP.h.NewStream(ctx, peerID, LightPushID_v20beta1)
      Severity: Major
      Found in waku/v2/protocol/lightpush/waku_lightpush.go - About 40 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

          Method WakuLightPush.handleOpts has 5 return statements (exceeds 4 allowed).
          Open

          func (wakuLP *WakuLightPush) handleOpts(ctx context.Context, message *wpb.WakuMessage, opts ...RequestOption) (*lightPushRequestParameters, error) {
              params := new(lightPushRequestParameters)
              params.host = wakuLP.h
              params.log = wakuLP.log
              params.pm = wakuLP.pm
          Severity: Major
          Found in waku/v2/protocol/lightpush/waku_lightpush.go - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status