dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

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

func deleteVxlanByVNI(path string, vni uint32) error {
    nlh := ns.NlHandle()
    if path != "" {
        ns, err := netns.GetFromPath(path)
        if err != nil {
Severity: Major
Found in libnetwork/drivers/overlay/ov_utils.go - About 40 mins to fix

    Method driver.DeleteEndpoint has 6 return statements (exceeds 4 allowed).
    Open

    func (d *driver) DeleteEndpoint(nid, eid string) error {
        nlh := ns.NlHandle()
    
        if err := validateID(nid, eid); err != nil {
            return err
    Severity: Major
    Found in libnetwork/drivers/overlay/ov_endpoint.go - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

          if (newKey != nil && newIdx == -1) ||
              (primary != nil && priIdx == -1) ||
              (pruneKey != nil && delIdx == -1) {
      Severity: Major
      Found in libnetwork/drivers/overlay/encryption.go - About 40 mins to fix

        Method driver.DeleteEndpoint has 6 return statements (exceeds 4 allowed).
        Open

        func (d *driver) DeleteEndpoint(nid, eid string) error {
            var err error
        
            // Get the network handler and make sure it exists
            d.Lock()
        Severity: Major
        Found in libnetwork/drivers/bridge/bridge_linux.go - About 40 mins to fix

          Method NetworkDB.bulkSyncNode has 6 return statements (exceeds 4 allowed).
          Open

          func (nDB *NetworkDB) bulkSyncNode(networks []string, node string, unsolicited bool) error {
              var msgs [][]byte
          
              var unsolMsg string
              if unsolicited {
          Severity: Major
          Found in libnetwork/networkdb/cluster.go - About 40 mins to fix

            Method driver.programInput has 6 return statements (exceeds 4 allowed).
            Open

            func (d *driver) programInput(vni uint32, add bool) error {
                var (
                    plainVxlan = matchVXLAN(overlayutils.VXLANUDPPort(), vni)
                    chain      = "INPUT"
                    msg        = "add"
            Severity: Major
            Found in libnetwork/drivers/overlay/encryption.go - About 40 mins to fix

              Method driver.DiscoverNew has 6 return statements (exceeds 4 allowed).
              Open

              func (d *driver) DiscoverNew(dType discoverapi.DiscoveryType, data interface{}) error {
                  switch dType {
                  case discoverapi.NodeDiscovery:
                      nodeData, ok := data.(discoverapi.NodeDiscoveryData)
                      if !ok {
              Severity: Major
              Found in libnetwork/drivers/overlay/overlay.go - About 40 mins to fix

                Method cnmNetworkAllocator.IsTaskAllocated has 6 return statements (exceeds 4 allowed).
                Open

                func (na *cnmNetworkAllocator) IsTaskAllocated(t *api.Task) bool {
                    // If the task is not found in the allocated set, then it is
                    // not allocated.
                    if _, ok := na.tasks[t.ID]; !ok {
                        return false
                Severity: Major
                Found in libnetwork/cnmallocator/networkallocator.go - About 40 mins to fix

                  Method cnmNetworkAllocator.deallocateVIP has 6 return statements (exceeds 4 allowed).
                  Open

                  func (na *cnmNetworkAllocator) deallocateVIP(vip *api.Endpoint_VirtualIP) error {
                      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 40 mins to fix

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

                    func createIPVlan(containerIfName, parent, ipvlanMode, ipvlanFlag string) (string, error) {
                        // Set the ipvlan mode and flag. Default is L2 bridge
                        mode, err := setIPVlanMode(ipvlanMode)
                        if err != nil {
                            return "", fmt.Errorf("Unsupported %s ipvlan mode: %v", ipvlanMode, err)
                    Severity: Major
                    Found in libnetwork/drivers/ipvlan/ipvlan_setup.go - About 40 mins to fix

                      Method cnmNetworkAllocator.allocateNetworkIPs has 6 return statements (exceeds 4 allowed).
                      Open

                      func (na *cnmNetworkAllocator) allocateNetworkIPs(nAttach *api.NetworkAttachment) error {
                          var ip *net.IPNet
                          var opts map[string]string
                      
                          ipam, _, _, err := na.resolveIPAM(nAttach.Network)
                      Severity: Major
                      Found in libnetwork/cnmallocator/networkallocator.go - About 40 mins to fix

                        Method driver.parseNetworkOptions has 6 return statements (exceeds 4 allowed).
                        Open

                        func (d *driver) parseNetworkOptions(id string, genericOptions map[string]string) (*networkConfiguration, error) {
                            config := &networkConfiguration{Type: d.name}
                        
                            for label, value := range genericOptions {
                                switch label {
                        Severity: Major
                        Found in libnetwork/drivers/windows/windows.go - About 40 mins to fix

                          Method linuxParser.ParseVolumesFrom has 6 return statements (exceeds 4 allowed).
                          Open

                          func (p *linuxParser) ParseVolumesFrom(spec string) (string, string, error) {
                              if len(spec) == 0 {
                                  return "", "", fmt.Errorf("volumes-from specification cannot be an empty string")
                              }
                          
                          
                          Severity: Major
                          Found in volume/mounts/linux_parser.go - About 40 mins to fix

                            Method Client.checkResponseErr has 6 return statements (exceeds 4 allowed).
                            Open

                            func (cli *Client) checkResponseErr(serverResp serverResponse) error {
                                if serverResp.statusCode >= 200 && serverResp.statusCode < 400 {
                                    return nil
                                }
                            
                            
                            Severity: Major
                            Found in client/request.go - About 40 mins to fix

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

                              func setupIPTablesInternal(ipVer iptables.IPVersion, config *networkConfiguration, addr *net.IPNet, hairpin, enable bool) error {
                                  var (
                                      address   = addr.String()
                                      skipDNAT  = iptRule{ipv: ipVer, table: iptables.Nat, chain: DockerChain, args: []string{"-i", config.BridgeName, "-j", "RETURN"}}
                                      outRule   = iptRule{ipv: ipVer, table: iptables.Filter, chain: "FORWARD", args: []string{"-i", config.BridgeName, "!", "-o", config.BridgeName, "-j", "ACCEPT"}}
                              Severity: Major
                              Found in libnetwork/drivers/bridge/setup_ip_tables_linux.go - About 40 mins to fix

                                Method Client.checkPluginPermissions has 6 return statements (exceeds 4 allowed).
                                Open

                                func (cli *Client) checkPluginPermissions(ctx context.Context, query url.Values, options types.PluginInstallOptions) (types.PluginPrivileges, error) {
                                    resp, err := cli.tryPluginPrivileges(ctx, query, options.RegistryAuth)
                                    if errdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil {
                                        // todo: do inspect before to check existing name before checking privileges
                                        newAuthHeader, privilegeErr := options.PrivilegeFunc(ctx)
                                Severity: Major
                                Found in client/plugin_install.go - About 40 mins to fix

                                  Method Client.Events has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (cli *Client) Events(ctx context.Context, options events.ListOptions) (<-chan events.Message, <-chan error) {
                                      messages := make(chan events.Message)
                                      errs := make(chan error, 1)
                                  
                                      started := make(chan struct{})
                                  Severity: Major
                                  Found in client/events.go - About 40 mins to fix

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

                                    func getMountOptions(opts *optsConfig, resolveIP func(string, string) (*net.IPAddr, error)) (mountDevice string, mountOpts string, _ error) {
                                        if opts.MountDevice == "" {
                                            return "", "", fmt.Errorf("missing device in volume options")
                                        }
                                    
                                    
                                    Severity: Major
                                    Found in volume/local/local_unix.go - About 40 mins to fix

                                      Method cnmNetworkAllocator.allocatePools has 6 return statements (exceeds 4 allowed).
                                      Open

                                      func (na *cnmNetworkAllocator) allocatePools(n *api.Network) (map[string]string, error) {
                                          ipam, dName, dOptions, err := na.resolveIPAM(n)
                                          if err != nil {
                                              return nil, err
                                          }
                                      Severity: Major
                                      Found in libnetwork/cnmallocator/networkallocator.go - About 40 mins to fix

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

                                        func withDockerfileFromContext(c modifiableContext, dockerfilePath string) (builder.Source, *parser.Result, error) {
                                            df, err := openAt(c, dockerfilePath)
                                            if err != nil {
                                                if errors.Is(err, os.ErrNotExist) {
                                                    if dockerfilePath == builder.DefaultDockerfileName {
                                        Severity: Major
                                        Found in builder/remotecontext/detect.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language