dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

Method Controller.handleEpTableEvent has 76 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (c *Controller) handleEpTableEvent(ev events.Event) {
    var (
        nid   string
        eid   string
        value []byte
Severity: Major
Found in libnetwork/agent.go - About 2 hrs to fix

    Function skipAgent has 76 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func skipAgent(dAtA []byte) (n int, err error) {
        l := len(dAtA)
        iNdEx := 0
        depth := 0
        for iNdEx < l {
    Severity: Major
    Found in libnetwork/agent.pb.go - About 2 hrs to fix

      Function skipNetworkdb has 76 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func skipNetworkdb(dAtA []byte) (n int, err error) {
          l := len(dAtA)
          iNdEx := 0
          depth := 0
          for iNdEx < l {
      Severity: Major
      Found in libnetwork/networkdb/networkdb.pb.go - About 2 hrs to fix

        Function skipOverlay has 76 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func skipOverlay(dAtA []byte) (n int, err error) {
            l := len(dAtA)
            iNdEx := 0
            depth := 0
            for iNdEx < l {
        Severity: Major
        Found in libnetwork/drivers/overlay/overlay.pb.go - About 2 hrs to fix

          Method networkRouter.getNetwork has 76 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (n *networkRouter) getNetwork(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
              if err := httputils.ParseForm(r); err != nil {
                  return err
              }
          
          
          Severity: Major
          Found in api/server/router/network/network_routes.go - About 2 hrs to fix

            Function skipPlugin has 76 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func skipPlugin(dAtA []byte) (n int, err error) {
                l := len(dAtA)
                iNdEx := 0
                depth := 0
                for iNdEx < l {
            Severity: Major
            Found in api/types/swarm/runtime/plugin.pb.go - About 2 hrs to fix

              Function skipEntry has 76 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func skipEntry(dAtA []byte) (n int, err error) {
                  l := len(dAtA)
                  iNdEx := 0
                  depth := 0
                  for iNdEx < l {
              Severity: Major
              Found in api/types/plugins/logdriver/entry.pb.go - About 2 hrs to fix

                Method tarexporter.Load has 22 return statements (exceeds 4 allowed).
                Open

                func (l *tarexporter) Load(ctx context.Context, inTar io.ReadCloser, outStream io.Writer, quiet bool) (outErr error) {
                    ctx, span := tracing.StartSpan(ctx, "tarexport.Load")
                    defer span.End()
                    defer func() {
                        span.SetStatus(outErr)
                Severity: Major
                Found in image/tarexport/load.go - About 2 hrs to fix

                  Method NetworkDB.bulkSyncNode has 75 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

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

                    Method windowsParser.validateMountConfigReg has 75 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (p *windowsParser) validateMountConfigReg(mnt *mount.Mount, additionalValidators ...mountValidator) error {
                        if len(mnt.Target) == 0 {
                            return &errMountConfig{mnt, errMissingField("Target")}
                        }
                        for _, v := range additionalValidators {
                    Severity: Minor
                    Found in volume/mounts/windows_parser.go - About 2 hrs to fix

                      Method executor.Describe has 75 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func (e *executor) Describe(ctx context.Context) (*api.NodeDescription, error) {
                          info, err := e.backend.SystemInfo(ctx)
                          if err != nil {
                              return nil, err
                          }
                      Severity: Minor
                      Found in daemon/cluster/executor/container/executor.go - About 2 hrs to fix

                        Method Daemon.killWithSignal has 75 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (daemon *Daemon) killWithSignal(container *containerpkg.Container, stopSignal syscall.Signal) error {
                            log.G(context.TODO()).WithFields(log.Fields{
                                "signal":    int(stopSignal),
                                "container": container.ID,
                            }).Debugf("sending signal %[1]d (%[1]s) to container", stopSignal)
                        Severity: Minor
                        Found in daemon/kill.go - About 2 hrs to fix

                          Function volumeSpecToGRPC has 75 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func volumeSpecToGRPC(spec volumetypes.ClusterVolumeSpec) *swarmapi.VolumeSpec {
                              swarmSpec := &swarmapi.VolumeSpec{
                                  Group: spec.Group,
                              }
                          
                          
                          Severity: Minor
                          Found in daemon/cluster/convert/volume.go - About 2 hrs to fix

                            Method tarSum.Read has 75 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func (ts *tarSum) Read(buf []byte) (int, error) {
                                if ts.finished {
                                    return ts.bufWriter.Read(buf)
                                }
                                if len(ts.bufData) < len(buf) {
                            Severity: Minor
                            Found in pkg/tarsum/tarsum.go - About 2 hrs to fix

                              Method Daemon.fillRootlessVersion has 75 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func (daemon *Daemon) fillRootlessVersion(ctx context.Context, v *types.Version) error {
                                  if !rootless.RunningWithRootlessKit() {
                                      return nil
                                  }
                                  rlc, err := getRootlessKitClient()
                              Severity: Minor
                              Found in daemon/info_unix.go - About 2 hrs to fix

                                Function withFetchProgress has 74 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func withFetchProgress(cs content.Store, out progress.Output, ref reference.Named) images.HandlerFunc {
                                    return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
                                        switch desc.MediaType {
                                        case ocispec.MediaTypeImageManifest, images.MediaTypeDockerSchema2Manifest:
                                            tn := reference.TagNameOnly(ref)
                                Severity: Minor
                                Found in plugin/fetch_linux.go - About 1 hr to fix

                                  Method Resolver.serveDNS has 74 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func (r *Resolver) serveDNS(w dns.ResponseWriter, query *dns.Msg) {
                                      var (
                                          resp *dns.Msg
                                          err  error
                                      )
                                  Severity: Minor
                                  Found in libnetwork/resolver.go - About 1 hr to fix

                                    Function newProxy has 74 lines of code (exceeds 50 allowed). Consider refactoring.
                                    Open

                                    func newProxy(config ProxyConfig) (p Proxy, err error) {
                                        ipv := ip4
                                        if config.HostIP.To4() == nil {
                                            ipv = ip6
                                        }
                                    Severity: Minor
                                    Found in cmd/docker-proxy/main_linux.go - About 1 hr to fix

                                      Method Daemon.getInspectData has 73 lines of code (exceeds 50 allowed). Consider refactoring.
                                      Open

                                      func (daemon *Daemon) getInspectData(daemonCfg *config.Config, container *container.Container) (*containertypes.ContainerJSONBase, error) {
                                          // make a copy to play with
                                          hostConfig := *container.HostConfig
                                      
                                          children := daemon.children(container)
                                      Severity: Minor
                                      Found in daemon/inspect.go - About 1 hr to fix

                                        Method puller.pullManifestList has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
                                        Open

                                        func (p *puller) pullManifestList(ctx context.Context, ref reference.Named, mfstList *manifestlist.DeserializedManifestList, pp *ocispec.Platform) (id digest.Digest, manifestListDigest digest.Digest, err error) {
                                            manifestListDigest, err = schema2ManifestDigest(ref, mfstList)
                                            if err != nil {
                                                return "", "", err
                                            }
                                        Severity: Minor
                                        Found in distribution/pull_v2.go - About 1 hr to fix

                                        Cognitive Complexity

                                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                        A method's cognitive complexity is based on a few simple rules:

                                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                        • Code is considered more complex for each "break in the linear flow of the code"
                                        • Code is considered more complex when "flow breaking structures are nested"

                                        Further reading

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language