docker/swarmkit

View on GitHub

Showing 1,008 of 1,820 total issues

Avoid deeply nested control flow statements.
Open

                } else if fieldNum == 2 {
                    var stringLenmapvalue uint64
                    for shift := uint(0); ; shift += 7 {
                        if shift >= 64 {
                            return ErrIntOverflowSpecs
Severity: Major
Found in api/specs.pb.go - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        for shift := uint(0); ; shift += 7 {
                            if shift >= 64 {
                                return ErrIntOverflowSpecs
                            }
                            if iNdEx >= l {
    Severity: Major
    Found in api/specs.pb.go - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if postStringIndexmapkey < 0 {
                              return ErrInvalidLengthSpecs
                          }
      Severity: Major
      Found in api/specs.pb.go - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if iNdEx >= l {
                                return io.ErrUnexpectedEOF
                            }
        Severity: Major
        Found in api/specs.pb.go - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if intStringLenmapkey < 0 {
                                  return ErrInvalidLengthSpecs
                              }
          Severity: Major
          Found in api/specs.pb.go - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if intStringLenmapkey < 0 {
                                    return ErrInvalidLengthSpecs
                                }
            Severity: Major
            Found in api/specs.pb.go - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if postStringIndexmapkey < 0 {
                                      return ErrInvalidLengthSpecs
                                  }
              Severity: Major
              Found in api/specs.pb.go - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if postStringIndexmapkey > l {
                                        return io.ErrUnexpectedEOF
                                    }
                Severity: Major
                Found in api/specs.pb.go - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                  } else if fieldNum == 2 {
                                      var stringLenmapvalue uint64
                                      for shift := uint(0); ; shift += 7 {
                                          if shift >= 64 {
                                              return ErrIntOverflowSpecs
                  Severity: Major
                  Found in api/specs.pb.go - About 45 mins to fix

                    Method VolumeSpec.MarshalToSizedBuffer has 7 return statements (exceeds 4 allowed).
                    Open

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

                      Avoid deeply nested control flow statements.
                      Open

                                          if b < 0x80 {
                                              break
                                          }
                      Severity: Major
                      Found in api/raft.pb.go - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if integer < 128 {
                                                count++
                                            }
                        Severity: Major
                        Found in api/raft.pb.go - About 45 mins to fix

                          Method Supervisor.Restart has 7 return statements (exceeds 4 allowed).
                          Open

                          func (r *Supervisor) Restart(ctx context.Context, tx store.Tx, cluster *api.Cluster, service *api.Service, t api.Task) error {
                              // TODO(aluzzardi): This function should not depend on `service`.
                          
                              // Is the old task still in the process of restarting? If so, wait for
                              // its restart delay to elapse, to avoid tight restart loops (for
                          Severity: Major
                          Found in manager/orchestrator/restart/restart.go - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if iNdEx >= l {
                                                    return io.ErrUnexpectedEOF
                                                }
                            Severity: Major
                            Found in api/raft.pb.go - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                              for shift := uint(0); ; shift += 7 {
                                                  if shift >= 64 {
                                                      return ErrIntOverflowRaft
                                                  }
                                                  if iNdEx >= l {
                              Severity: Major
                              Found in api/raft.pb.go - About 45 mins to fix

                                Method signHandler.ServeHTTP has 7 return statements (exceeds 4 allowed).
                                Open

                                func (h *signHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
                                    if atomic.LoadUint32(h.flaky) == 1 {
                                        w.WriteHeader(http.StatusInternalServerError)
                                    }
                                
                                
                                Severity: Major
                                Found in ca/testutils/externalutils.go - About 45 mins to fix

                                  Function AuthorizeForwardedRoleAndOrg has 7 return statements (exceeds 4 allowed).
                                  Open

                                  func AuthorizeForwardedRoleAndOrg(ctx context.Context, authorizedRoles, forwarderRoles []string, org string, blacklistedCerts map[string]*api.BlacklistedCertificate) (string, error) {
                                      if isForwardedRequest(ctx) {
                                          _, err := AuthorizeOrgAndRole(ctx, org, blacklistedCerts, forwarderRoles...)
                                          if err != nil {
                                              return "", status.Errorf(codes.PermissionDenied, "Permission denied: unauthorized forwarder role: %v", err)
                                  Severity: Major
                                  Found in ca/auth.go - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                    if postIndex < 0 {
                                                        return ErrInvalidLengthRaft
                                                    }
                                    Severity: Major
                                    Found in api/raft.pb.go - About 45 mins to fix

                                      Method Supervisor.DelayStart has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      func (r *Supervisor) DelayStart(ctx context.Context, _ store.Tx, oldTask *api.Task, newTaskID string, delay time.Duration, waitStop bool) <-chan struct{} {
                                      Severity: Minor
                                      Found in manager/orchestrator/restart/restart.go - About 45 mins to fix

                                        Function DecryptPEMBlock has 7 return statements (exceeds 4 allowed).
                                        Open

                                        func DecryptPEMBlock(block *pem.Block, password []byte) ([]byte, error) {
                                            der := block.Bytes
                                        
                                            var privKey encryptedPrivateKeyInfo
                                            if _, err := asn1.Unmarshal(der, &privKey); err != nil {
                                        Severity: Major
                                        Found in ca/pkcs8/pkcs8.go - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language