docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

Method Scheduler.updateTask has 6 return statements (exceeds 4 allowed).
Open

func (s *Scheduler) updateTask(ctx context.Context, t *api.Task) bool {
    // Ignore all tasks that have not reached PENDING
    // state.
    if t.Status.State < api.TaskStatePending {
        return false
Severity: Major
Found in manager/scheduler/scheduler.go - About 40 mins to fix

    Method Server.ListClusters has 6 return statements (exceeds 4 allowed).
    Open

    func (s *Server) ListClusters(ctx context.Context, request *api.ListClustersRequest) (*api.ListClustersResponse, error) {
        var (
            clusters []*api.Cluster
            err      error
        )
    Severity: Major
    Found in manager/controlapi/cluster.go - About 40 mins to fix

      Function validateRestartPolicy has 6 return statements (exceeds 4 allowed).
      Open

      func validateRestartPolicy(rp *api.RestartPolicy) error {
          if rp == nil {
              return nil
          }
      
      
      Severity: Major
      Found in manager/controlapi/service.go - About 40 mins to fix

        Method Server.validateNetworkSpec has 6 return statements (exceeds 4 allowed).
        Open

        func (s *Server) validateNetworkSpec(spec *api.NetworkSpec) error {
            if spec == nil {
                return status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
            }
        
        
        Severity: Major
        Found in manager/controlapi/network.go - About 40 mins to fix

          Method Server.CreateNetwork has 6 return statements (exceeds 4 allowed).
          Open

          func (s *Server) CreateNetwork(ctx context.Context, request *api.CreateNetworkRequest) (*api.CreateNetworkResponse, error) {
              if err := s.validateNetworkSpec(request.Spec); err != nil {
                  return nil, err
              }
          
          
          Severity: Major
          Found in manager/controlapi/network.go - About 40 mins to fix

            Method Server.ListNetworks has 6 return statements (exceeds 4 allowed).
            Open

            func (s *Server) ListNetworks(ctx context.Context, request *api.ListNetworksRequest) (*api.ListNetworksResponse, error) {
                var (
                    networks []*api.Network
                    err      error
                )
            Severity: Major
            Found in manager/controlapi/network.go - About 40 mins to fix

              Function validateUpdate has 6 return statements (exceeds 4 allowed).
              Open

              func validateUpdate(uc *api.UpdateConfig) error {
                  if uc == nil {
                      return nil
                  }
              
              
              Severity: Major
              Found in manager/controlapi/service.go - About 40 mins to fix

                Method assignmentSet.secret has 6 return statements (exceeds 4 allowed).
                Open

                func (a *assignmentSet) secret(readTx store.ReadTx, task *api.Task, secretID string) (*api.Secret, bool, error) {
                    secret := store.GetSecret(readTx, secretID)
                    if secret == nil {
                        return nil, false, fmt.Errorf("secret not found")
                    }
                Severity: Major
                Found in manager/dispatcher/assignments.go - About 40 mins to fix

                  Method Scheduler.applySchedulingDecisions has 6 return statements (exceeds 4 allowed).
                  Open

                  func (s *Scheduler) applySchedulingDecisions(ctx context.Context, schedulingDecisions map[string]schedulingDecision) (successful, failed []schedulingDecision) {
                      // applySchedulingDecisions is the only place where we make store
                      // transactions in the scheduler. the scheduler is responsible for freeing
                      // volumes that are no longer in use. this means that volumes should be
                      // freed in this function. sometimes, there are no scheduling decisions to
                  Severity: Major
                  Found in manager/scheduler/scheduler.go - About 40 mins to fix

                    Function validateGenericRuntimeSpec has 6 return statements (exceeds 4 allowed).
                    Open

                    func validateGenericRuntimeSpec(taskSpec api.TaskSpec) error {
                        generic := taskSpec.GetGeneric()
                    
                        if len(generic.Kind) < 3 {
                            return status.Errorf(codes.InvalidArgument, "Generic runtime: Invalid name %q", generic.Kind)
                    Severity: Major
                    Found in manager/controlapi/service.go - About 40 mins to fix

                      Method Server.RemoveNetwork has 6 return statements (exceeds 4 allowed).
                      Open

                      func (s *Server) RemoveNetwork(ctx context.Context, request *api.RemoveNetworkRequest) (*api.RemoveNetworkResponse, error) {
                          if request.NetworkID == "" {
                              return nil, status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
                          }
                      
                      
                      Severity: Major
                      Found in manager/controlapi/network.go - About 40 mins to fix

                        Method Server.RemoveVolume has 6 return statements (exceeds 4 allowed).
                        Open

                        func (s *Server) RemoveVolume(ctx context.Context, request *api.RemoveVolumeRequest) (*api.RemoveVolumeResponse, error) {
                            err := s.store.Update(func(tx store.Tx) error {
                                volume := store.GetVolume(tx, request.VolumeID)
                                if volume == nil {
                                    return status.Errorf(codes.NotFound, "volume %s not found", request.VolumeID)
                        Severity: Major
                        Found in manager/controlapi/volume.go - About 40 mins to fix

                          Method Server.RemoveConfig has 6 return statements (exceeds 4 allowed).
                          Open

                          func (s *Server) RemoveConfig(ctx context.Context, request *api.RemoveConfigRequest) (*api.RemoveConfigResponse, error) {
                              if request.ConfigID == "" {
                                  return nil, status.Errorf(codes.InvalidArgument, "config ID must be provided")
                              }
                          
                          
                          Severity: Major
                          Found in manager/controlapi/config.go - About 40 mins to fix

                            Method plugin.init has 6 return statements (exceeds 4 allowed).
                            Open

                            func (p *plugin) init(ctx context.Context) error {
                                probe, err := p.idClient.Probe(ctx, &csi.ProbeRequest{})
                                if err != nil {
                                    return err
                                }
                            Severity: Major
                            Found in manager/csi/plugin.go - About 40 mins to fix

                              Method roleManager.reconcileRole has 6 return statements (exceeds 4 allowed).
                              Open

                              func (rm *roleManager) reconcileRole(ctx context.Context, node *api.Node) {
                                  if node.Role == node.Spec.DesiredRole {
                                      // Nothing to do.
                                      delete(rm.pendingReconciliation, node.ID)
                                      return
                              Severity: Major
                              Found in manager/role_manager.go - About 40 mins to fix

                                Method volumeSet.checkVolume has 6 return statements (exceeds 4 allowed).
                                Open

                                func (vs *volumeSet) checkVolume(id string, info *NodeInfo, readOnly bool) bool {
                                    vi := vs.volumes[id]
                                    // first, check if the volume's availability is even Active. If not. no
                                    // reason to bother with anything further.
                                    if vi.volume != nil && vi.volume.Spec.Availability != api.VolumeAvailabilityActive {
                                Severity: Major
                                Found in manager/scheduler/volumes.go - About 40 mins to fix

                                  Method Server.RemoveSecret has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (s *Server) RemoveSecret(ctx context.Context, request *api.RemoveSecretRequest) (*api.RemoveSecretResponse, error) {
                                      if request.SecretID == "" {
                                          return nil, status.Errorf(codes.InvalidArgument, "secret ID must be provided")
                                      }
                                  
                                  
                                  Severity: Major
                                  Found in manager/controlapi/secret.go - About 40 mins to fix

                                    Method Deallocator.Run has 6 return statements (exceeds 4 allowed).
                                    Open

                                    func (deallocator *Deallocator) Run(ctx context.Context) error {
                                        var (
                                            allServices []*api.Service
                                            allNetworks []*api.Network
                                        )
                                    Severity: Major
                                    Found in manager/deallocator/deallocator.go - About 40 mins to fix

                                      Method Server.UpdateSecret has 6 return statements (exceeds 4 allowed).
                                      Open

                                      func (s *Server) UpdateSecret(ctx context.Context, request *api.UpdateSecretRequest) (*api.UpdateSecretResponse, error) {
                                          if request.SecretID == "" || request.SecretVersion == nil {
                                              return nil, status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
                                          }
                                          var secret *api.Secret
                                      Severity: Major
                                      Found in manager/controlapi/secret.go - About 40 mins to fix

                                        Function validateSecretRefsSpec has 6 return statements (exceeds 4 allowed).
                                        Open

                                        func validateSecretRefsSpec(spec api.TaskSpec) error {
                                            container := spec.GetContainer()
                                            if container == nil {
                                                return nil
                                            }
                                        Severity: Major
                                        Found in manager/controlapi/service.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language