dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

Method Store.Get has 8 return statements (exceeds 4 allowed).
Open

func (ps *Store) Get(name, capability string, mode int) (plugingetter.CompatPlugin, error) {
    // Lookup using new model.
    if ps != nil {
        p, err := ps.GetV2Plugin(name)
        if err == nil {
Severity: Major
Found in plugin/store.go - About 50 mins to fix

    Method store.Create has 8 return statements (exceeds 4 allowed).
    Open

    func (is *store) Create(config []byte) (ID, error) {
        var img *Image
        img, err := NewFromJSON(config)
        if err != nil {
            return "", err
    Severity: Major
    Found in image/store.go - About 50 mins to fix

      Function calcSize has 8 return statements (exceeds 4 allowed).
      Open

      func calcSize(ctx context.Context, dir string) (int64, error) {
          var size int64
          data := make(map[uint64]struct{})
          err := filepath.Walk(dir, func(d string, fileInfo os.FileInfo, err error) error {
              if err != nil {
      Severity: Major
      Found in internal/directory/directory_unix.go - About 50 mins to fix

        Method Executor.Restore has 8 return statements (exceeds 4 allowed).
        Open

        func (e *Executor) Restore(id string, stdout, stderr io.WriteCloser) (bool, error) {
            ctx := context.Background()
            p := c8dPlugin{log: log.G(ctx).WithField("plugin", id)}
            ctr, err := e.client.LoadContainer(ctx, id)
            if err != nil {
        Severity: Major
        Found in plugin/executor/containerd/containerd.go - About 50 mins to fix

          Method pushDescriptor.Upload has 8 return statements (exceeds 4 allowed).
          Open

          func (pd *pushDescriptor) Upload(ctx context.Context, progressOutput progress.Output) (distribution.Descriptor, error) {
              // Skip foreign layers unless this registry allows nondistributable artifacts.
              if !pd.endpoint.AllowNondistributableArtifacts {
                  if fs, ok := pd.layer.(distribution.Describable); ok {
                      if d := fs.Descriptor(); len(d.URLs) > 0 {
          Severity: Major
          Found in distribution/push_v2.go - About 50 mins to fix

            Method Sandbox.populateNetworkResources has 8 return statements (exceeds 4 allowed).
            Open

            func (sb *Sandbox) populateNetworkResources(ctx context.Context, ep *Endpoint) error {
                ctx, span := otel.Tracer("").Start(ctx, "libnetwork.Sandbox.populateNetworkResources", trace.WithAttributes(
                    attribute.String("endpoint.Name", ep.Name())))
                defer span.End()
            
            
            Severity: Major
            Found in libnetwork/sandbox_linux.go - About 50 mins to fix

              Method Endpoint.addServiceInfoToCluster has 8 return statements (exceeds 4 allowed).
              Open

              func (ep *Endpoint) addServiceInfoToCluster(sb *Sandbox) error {
                  if len(ep.dnsNames) == 0 || ep.Iface() == nil || ep.Iface().Address() == nil {
                      return nil
                  }
              
              
              Severity: Major
              Found in libnetwork/agent.go - About 50 mins to fix

                Method NetworkDB.handleNodeEvent has 8 return statements (exceeds 4 allowed).
                Open

                func (nDB *NetworkDB) handleNodeEvent(nEvent *NodeEvent) bool {
                    // Update our local clock if the received messages has newer
                    // time.
                    nDB.networkClock.Witness(nEvent.LTime)
                
                
                Severity: Major
                Found in libnetwork/networkdb/delegate.go - About 50 mins to fix

                  Method driver.CreateNetwork has 8 return statements (exceeds 4 allowed).
                  Open

                  func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
                      if len(ipV4Data) == 0 || ipV4Data[0].Pool.String() == "0.0.0.0/0" {
                          return types.InvalidParameterErrorf("ipv4 pool is empty")
                      }
                      // Sanity checks
                  Severity: Major
                  Found in libnetwork/drivers/bridge/bridge_linux.go - About 50 mins to fix

                    Function cmpPortBinding has 8 return statements (exceeds 4 allowed).
                    Open

                    func cmpPortBinding(a, b types.PortBinding) int {
                        // Exact host port < host port range.
                        aIsRange := a.HostPort == 0 || a.HostPort != a.HostPortEnd
                        bIsRange := b.HostPort == 0 || b.HostPort != b.HostPortEnd
                        if aIsRange != bIsRange {
                    Severity: Major
                    Found in libnetwork/drivers/bridge/port_mapping_linux.go - About 50 mins to fix

                      Method driver.ProgramExternalConnectivity has 8 return statements (exceeds 4 allowed).
                      Open

                      func (d *driver) ProgramExternalConnectivity(ctx context.Context, nid, eid string, options map[string]interface{}) error {
                          ctx, span := otel.Tracer("").Start(ctx, "libnetwork.drivers.bridge.ProgramExternalConnectivity", trace.WithAttributes(
                              attribute.String("nid", nid),
                              attribute.String("eid", eid)))
                          defer span.End()
                      Severity: Major
                      Found in libnetwork/drivers/bridge/bridge_linux.go - About 50 mins to fix

                        Method driver.Join has 8 return statements (exceeds 4 allowed).
                        Open

                        func (d *driver) Join(ctx context.Context, nid, eid string, sboxKey string, jinfo driverapi.JoinInfo, options map[string]interface{}) error {
                            ctx, span := otel.Tracer("").Start(ctx, "libnetwork.drivers.bridge.Join", trace.WithAttributes(
                                attribute.String("nid", nid),
                                attribute.String("eid", eid),
                                attribute.String("sboxKey", sboxKey)))
                        Severity: Major
                        Found in libnetwork/drivers/bridge/bridge_linux.go - About 50 mins to fix

                          Method driver.CreateEndpoint has 8 return statements (exceeds 4 allowed).
                          Open

                          func (d *driver) CreateEndpoint(_ context.Context, nid, eid string, ifInfo driverapi.InterfaceInfo, epOptions map[string]interface{}) (retErr error) {
                              if ifInfo == nil {
                                  return errors.New("must not be called with nil InterfaceInfo")
                              }
                          
                          
                          Severity: Major
                          Found in libnetwork/drivers/remote/driver.go - About 50 mins to fix

                            Method cnmNetworkAllocator.allocateVIP has 8 return statements (exceeds 4 allowed).
                            Open

                            func (na *cnmNetworkAllocator) allocateVIP(vip *api.Endpoint_VirtualIP) error {
                                var opts map[string]string
                                localNet := na.getNetwork(vip.NetworkID)
                                if localNet == nil {
                                    return errors.New("networkallocator: could not find local network state")
                            Severity: Major
                            Found in libnetwork/cnmallocator/networkallocator.go - About 50 mins to fix

                              Method Client.imageBuildOptionsToQuery has 8 return statements (exceeds 4 allowed).
                              Open

                              func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options types.ImageBuildOptions) (url.Values, error) {
                                  query := url.Values{}
                                  if len(options.Tags) > 0 {
                                      query["t"] = options.Tags
                                  }
                              Severity: Major
                              Found in client/image_build.go - About 50 mins to fix

                                Method Client.doRequest has 8 return statements (exceeds 4 allowed).
                                Open

                                func (cli *Client) doRequest(req *http.Request) (serverResponse, error) {
                                    serverResp := serverResponse{statusCode: -1, reqURL: req.URL}
                                
                                    resp, err := cli.client.Do(req)
                                    if err != nil {
                                Severity: Major
                                Found in client/request.go - About 50 mins to fix

                                  Method cnmNetworkAllocator.IsAttachmentAllocated has 8 return statements (exceeds 4 allowed).
                                  Open

                                  func (na *cnmNetworkAllocator) IsAttachmentAllocated(node *api.Node, networkAttachment *api.NetworkAttachment) bool {
                                      if node == nil {
                                          return false
                                      }
                                  
                                  
                                  Severity: Major
                                  Found in libnetwork/cnmallocator/networkallocator.go - About 50 mins to fix

                                    Method driver.EventNotify has 8 return statements (exceeds 4 allowed).
                                    Open

                                    func (d *driver) EventNotify(etype driverapi.EventType, nid, tableName, key string, value []byte) {
                                        if tableName != ovPeerTable {
                                            log.G(context.TODO()).Errorf("Unexpected table notification for table %s received", tableName)
                                            return
                                        }
                                    Severity: Major
                                    Found in libnetwork/drivers/windows/overlay/joinleave_windows.go - About 50 mins to fix

                                      Method driver.CreateNetwork has 8 return statements (exceeds 4 allowed).
                                      Open

                                      func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
                                          var (
                                              networkName   string
                                              interfaceName string
                                              staleNetworks []string
                                      Severity: Major
                                      Found in libnetwork/drivers/windows/overlay/ov_network_windows.go - About 50 mins to fix

                                        Method Root.validateOpts has 8 return statements (exceeds 4 allowed).
                                        Open

                                        func (r *Root) validateOpts(opts map[string]string) error {
                                            if len(opts) == 0 {
                                                return nil
                                            }
                                            for opt := range opts {
                                        Severity: Major
                                        Found in volume/local/local_unix.go - About 50 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language