docker/swarmkit

View on GitHub

Showing 1,008 of 1,820 total issues

Method raftProxyDispatcherServer.Heartbeat has 9 return statements (exceeds 4 allowed).
Open

func (p *raftProxyDispatcherServer) Heartbeat(ctx context.Context, r *HeartbeatRequest) (*HeartbeatResponse, error) {

    conn, err := p.connSelector.LeaderConn(ctx)
    if err != nil {
        if err == raftselector.ErrIsLeader {
Severity: Major
Found in api/dispatcher.pb.go - About 55 mins to fix

    Method PublishLogsResponse.Unmarshal has 9 return statements (exceeds 4 allowed).
    Open

    func (m *PublishLogsResponse) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Major
    Found in api/logbroker.pb.go - About 55 mins to fix

      Method raftProxyDispatcherServer.UpdateVolumeStatus has 9 return statements (exceeds 4 allowed).
      Open

      func (p *raftProxyDispatcherServer) UpdateVolumeStatus(ctx context.Context, r *UpdateVolumeStatusRequest) (*UpdateVolumeStatusResponse, error) {
      
          conn, err := p.connSelector.LeaderConn(ctx)
          if err != nil {
              if err == raftselector.ErrIsLeader {
      Severity: Major
      Found in api/dispatcher.pb.go - About 55 mins to fix

        Method raftProxyLogBrokerServer.PublishLogs has 9 return statements (exceeds 4 allowed).
        Open

        func (p *raftProxyLogBrokerServer) PublishLogs(stream LogBroker_PublishLogsServer) error {
            ctx := stream.Context()
            conn, err := p.connSelector.LeaderConn(ctx)
            if err != nil {
                if err == raftselector.ErrIsLeader {
        Severity: Major
        Found in api/logbroker.pb.go - About 55 mins to fix

          Method UpdateTaskStatusResponse.Unmarshal has 9 return statements (exceeds 4 allowed).
          Open

          func (m *UpdateTaskStatusResponse) Unmarshal(dAtA []byte) error {
              l := len(dAtA)
              iNdEx := 0
              for iNdEx < l {
                  preIndex := iNdEx
          Severity: Major
          Found in api/dispatcher.pb.go - About 55 mins to fix

            Method ListenSubscriptionsRequest.Unmarshal has 9 return statements (exceeds 4 allowed).
            Open

            func (m *ListenSubscriptionsRequest) Unmarshal(dAtA []byte) error {
                l := len(dAtA)
                iNdEx := 0
                for iNdEx < l {
                    preIndex := iNdEx
            Severity: Major
            Found in api/logbroker.pb.go - About 55 mins to fix

              Method UpdateVolumeStatusResponse.Unmarshal has 9 return statements (exceeds 4 allowed).
              Open

              func (m *UpdateVolumeStatusResponse) Unmarshal(dAtA []byte) error {
                  l := len(dAtA)
                  iNdEx := 0
                  for iNdEx < l {
                      preIndex := iNdEx
              Severity: Major
              Found in api/dispatcher.pb.go - About 55 mins to fix

                Method raftProxyDispatcherServer.UpdateTaskStatus has 9 return statements (exceeds 4 allowed).
                Open

                func (p *raftProxyDispatcherServer) UpdateTaskStatus(ctx context.Context, r *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error) {
                
                    conn, err := p.connSelector.LeaderConn(ctx)
                    if err != nil {
                        if err == raftselector.ErrIsLeader {
                Severity: Major
                Found in api/dispatcher.pb.go - About 55 mins to fix

                  Method GlobalJob.Unmarshal has 9 return statements (exceeds 4 allowed).
                  Open

                  func (m *GlobalJob) Unmarshal(dAtA []byte) error {
                      l := len(dAtA)
                      iNdEx := 0
                      for iNdEx < l {
                          preIndex := iNdEx
                  Severity: Major
                  Found in api/specs.pb.go - About 55 mins to fix

                    Method ClusterSpec.MarshalToSizedBuffer has 9 return statements (exceeds 4 allowed).
                    Open

                    func (m *ClusterSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                        i := len(dAtA)
                        _ = i
                        var l int
                        _ = l
                    Severity: Major
                    Found in api/specs.pb.go - About 55 mins to fix

                      Method GlobalService.Unmarshal has 9 return statements (exceeds 4 allowed).
                      Open

                      func (m *GlobalService) Unmarshal(dAtA []byte) error {
                          l := len(dAtA)
                          iNdEx := 0
                          for iNdEx < l {
                              preIndex := iNdEx
                      Severity: Major
                      Found in api/specs.pb.go - About 55 mins to fix

                        Method raftProxyRaftServer.ResolveAddress has 9 return statements (exceeds 4 allowed).
                        Open

                        func (p *raftProxyRaftServer) ResolveAddress(ctx context.Context, r *ResolveAddressRequest) (*ResolveAddressResponse, error) {
                        
                            conn, err := p.connSelector.LeaderConn(ctx)
                            if err != nil {
                                if err == raftselector.ErrIsLeader {
                        Severity: Major
                        Found in api/raft.pb.go - About 55 mins to fix

                          Method ProcessRaftMessageResponse.Unmarshal has 9 return statements (exceeds 4 allowed).
                          Open

                          func (m *ProcessRaftMessageResponse) Unmarshal(dAtA []byte) error {
                              l := len(dAtA)
                              iNdEx := 0
                              for iNdEx < l {
                                  preIndex := iNdEx
                          Severity: Major
                          Found in api/raft.pb.go - About 55 mins to fix

                            Method raftProxyRaftMembershipServer.Join has 9 return statements (exceeds 4 allowed).
                            Open

                            func (p *raftProxyRaftMembershipServer) Join(ctx context.Context, r *JoinRequest) (*JoinResponse, error) {
                            
                                conn, err := p.connSelector.LeaderConn(ctx)
                                if err != nil {
                                    if err == raftselector.ErrIsLeader {
                            Severity: Major
                            Found in api/raft.pb.go - About 55 mins to fix

                              Method Server.signNodeCert has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
                              Open

                              func (s *Server) signNodeCert(ctx context.Context, node *api.Node) error {
                                  s.signingMu.Lock()
                                  rootCA := s.localRootCA
                                  externalCA := s.externalCA
                                  s.signingMu.Unlock()
                              Severity: Minor
                              Found in ca/server.go - About 55 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Method Server.NodeCertificateStatus has 9 return statements (exceeds 4 allowed).
                              Open

                              func (s *Server) NodeCertificateStatus(ctx context.Context, request *api.NodeCertificateStatusRequest) (*api.NodeCertificateStatusResponse, error) {
                                  if request.NodeID == "" {
                                      return nil, status.Errorf(codes.InvalidArgument, codes.InvalidArgument.String())
                                  }
                              
                              
                              Severity: Major
                              Found in ca/server.go - About 55 mins to fix

                                Function makeExternalSignRequest has 9 return statements (exceeds 4 allowed).
                                Open

                                func makeExternalSignRequest(ctx context.Context, client *http.Client, url string, csrJSON []byte) (cert []byte, err error) {
                                    resp, err := ctxhttp.Post(ctx, client, url, "application/json", bytes.NewReader(csrJSON))
                                    if err != nil {
                                        return nil, recoverableErr{err: errors.Wrap(err, "unable to perform certificate signing request")}
                                    }
                                Severity: Major
                                Found in ca/external.go - About 55 mins to fix

                                  Method raftProxyRaftServer.StreamRaftMessage has 9 return statements (exceeds 4 allowed).
                                  Open

                                  func (p *raftProxyRaftServer) StreamRaftMessage(stream Raft_StreamRaftMessageServer) error {
                                      ctx := stream.Context()
                                      conn, err := p.connSelector.LeaderConn(ctx)
                                      if err != nil {
                                          if err == raftselector.ErrIsLeader {
                                  Severity: Major
                                  Found in api/raft.pb.go - About 55 mins to fix

                                    Method raftProxyRaftMembershipServer.Leave has 9 return statements (exceeds 4 allowed).
                                    Open

                                    func (p *raftProxyRaftMembershipServer) Leave(ctx context.Context, r *LeaveRequest) (*LeaveResponse, error) {
                                    
                                        conn, err := p.connSelector.LeaderConn(ctx)
                                        if err != nil {
                                            if err == raftselector.ErrIsLeader {
                                    Severity: Major
                                    Found in api/raft.pb.go - About 55 mins to fix

                                      Method Server.signNodeCert has 9 return statements (exceeds 4 allowed).
                                      Open

                                      func (s *Server) signNodeCert(ctx context.Context, node *api.Node) error {
                                          s.signingMu.Lock()
                                          rootCA := s.localRootCA
                                          externalCA := s.externalCA
                                          s.signingMu.Unlock()
                                      Severity: Major
                                      Found in ca/server.go - About 55 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language