docker/swarmkit

View on GitHub

Showing 1,008 of 1,820 total issues

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

        Method Node.LeaderConn has 6 return statements (exceeds 4 allowed).
        Open

        func (n *Node) LeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
            cc, err := n.getLeaderConn()
            if err == nil {
                return cc, nil
            }
        Severity: Major
        Found in manager/state/raft/raft.go - About 40 mins to fix

          Method LogBroker.SubscribeLogs has 6 return statements (exceeds 4 allowed).
          Open

          func (lb *LogBroker) SubscribeLogs(request *api.SubscribeLogsRequest, stream api.Logs_SubscribeLogsServer) error {
              ctx := stream.Context()
          
              if err := validateSelector(request.Selector); err != nil {
                  return err
          Severity: Major
          Found in manager/logbroker/broker.go - About 40 mins to fix

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

            func RestoreTable(tx Tx, table string, newObjects []api.StoreObject) error {
                checkType := func(by By) error {
                    return nil
                }
                var oldObjects []api.StoreObject
            Severity: Major
            Found in manager/state/store/object.go - About 40 mins to fix

              Method ResourceAllocator.AttachNetwork has 6 return statements (exceeds 4 allowed).
              Open

              func (ra *ResourceAllocator) AttachNetwork(ctx context.Context, request *api.AttachNetworkRequest) (*api.AttachNetworkResponse, error) {
                  nodeInfo, err := ca.RemoteNode(ctx)
                  if err != nil {
                      return nil, err
                  }
              Severity: Major
              Found in manager/resourceapi/allocator.go - About 40 mins to fix

                Method Node.ChangesBetween has 6 return statements (exceeds 4 allowed).
                Open

                func (n *Node) ChangesBetween(from, to api.Version) ([]state.Change, error) {
                    n.stopMu.RLock()
                    defer n.stopMu.RUnlock()
                
                    if from.Index > to.Index {
                Severity: Major
                Found in manager/state/raft/raft.go - About 40 mins to fix

                  Method Cluster.ValidateConfigurationChange has 6 return statements (exceeds 4 allowed).
                  Open

                  func (c *Cluster) ValidateConfigurationChange(cc raftpb.ConfChange) error {
                      c.mu.Lock()
                      defer c.mu.Unlock()
                  
                      if c.removed[cc.NodeID] {
                  Severity: Major
                  Found in manager/state/raft/membership/cluster.go - About 40 mins to fix

                    Function newSession has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    func newSession(ctx context.Context, agent *Agent, delay time.Duration, sessionID string, description *api.NodeDescription) *session {
                    Severity: Minor
                    Found in agent/session.go - About 35 mins to fix

                      Function updateRootThenUpdateCert has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      func updateRootThenUpdateCert(ctx context.Context, s *SecurityConfig, connBroker *connectionbroker.Broker, rootPaths CertPaths, failedCert *x509.Certificate) (*tls.Certificate, *IssuerInfo, error) {
                      Severity: Minor
                      Found in ca/config.go - About 35 mins to fix

                        Method Supervisor.Restart has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        func (r *Supervisor) Restart(ctx context.Context, tx store.Tx, cluster *api.Cluster, service *api.Service, t api.Task) error {
                        Severity: Minor
                        Found in manager/orchestrator/restart/restart.go - About 35 mins to fix

                          Function CheckTasks has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          func CheckTasks(ctx context.Context, s *store.MemoryStore, readTx store.ReadTx, initHandler InitHandler, startSupervisor restart.SupervisorInterface) error {
                          Severity: Minor
                          Found in manager/orchestrator/taskinit/init.go - About 35 mins to fix

                            Function validateHasAtLeastOneExternalCA has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            func validateHasAtLeastOneExternalCA(ctx context.Context, externalCAs map[string][]*api.ExternalCA, securityConfig *ca.SecurityConfig,
                                wantedCert []byte, desc string) ([]*api.ExternalCA, error) {
                            Severity: Minor
                            Found in manager/controlapi/ca_rotation.go - About 35 mins to fix

                              Function watchTask has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              func watchTask(t *testing.T, s *store.MemoryStore, watch chan events.Event, expectTimeout bool, fn func(t assert.TestingT, s *store.MemoryStore, n *api.Task) bool) {
                              Severity: Minor
                              Found in manager/allocator/allocator_test_suite.go - About 35 mins to fix

                                Method nodeSet.tree has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                func (ns *nodeSet) tree(serviceID string, preferences []*api.PlacementPreference, maxAssignments int, meetsConstraints func(*NodeInfo) bool, nodeLess func(*NodeInfo, *NodeInfo) bool) decisionTree {
                                Severity: Minor
                                Found in manager/scheduler/nodeset.go - About 35 mins to fix

                                  Function NewServer has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  func NewServer(store *store.MemoryStore, raft *raft.Node, securityConfig *ca.SecurityConfig, nv networkallocator.DriverValidator, dr *drivers.DriverProvider) *Server {
                                  Severity: Minor
                                  Found in manager/controlapi/server.go - About 35 mins to fix

                                    Function NewJoinNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    func NewJoinNode(t *testing.T, clockSource *fakeclock.FakeClock, join string, tc *cautils.TestCA, opts ...raft.NodeOptions) *TestNode {
                                    Severity: Minor
                                    Found in manager/state/raft/testutils/testutils.go - About 35 mins to fix

                                      Function CheckValuesOnNodes has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      func CheckValuesOnNodes(t *testing.T, clockSource *fakeclock.FakeClock, checkNodes map[uint64]*TestNode, ids []string, values []*api.Node) {
                                      Severity: Minor
                                      Found in manager/state/raft/testutils/testutils.go - About 35 mins to fix

                                        Function CopyNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                        func CopyNode(t *testing.T, clockSource *fakeclock.FakeClock, oldNode *TestNode, forceNewCluster bool, kr *SimpleKeyRotator) (*TestNode, context.Context) {
                                        Severity: Minor
                                        Found in manager/state/raft/testutils/testutils.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language