docker/swarmkit

View on GitHub

Showing 1,008 of 1,820 total issues

Function ConvertResourceWatch has 60 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func ConvertResourceWatch(action WatchActionKind, filters []*SelectBy, kind string) ([]Event, error) {
    var (
        m          Resource
        checkFuncs []ResourceCheckFunc
    )
Severity: Minor
Found in api/objects.pb.go - About 1 hr to fix

    Method raftProxyGen.genClientServerStreamingMethod has 60 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (g *raftProxyGen) genClientServerStreamingMethod(s *descriptor.ServiceDescriptorProto, m *descriptor.MethodDescriptorProto) {
        streamType := s.GetName() + "_" + m.GetName() + "Server"
    
        g.genStreamWrapper(streamType)
    
    
    Severity: Minor
    Found in protobuf/plugin/raftproxy/raftproxy.go - About 1 hr to fix

      Method Cluster.Size has 59 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (m *Cluster) Size() (n int) {
          if m == nil {
              return 0
          }
          var l int
      Severity: Minor
      Found in api/objects.pb.go - About 1 hr to fix

        Method SessionMessage.MarshalToSizedBuffer has 59 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (m *SessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) {
            i := len(dAtA)
            _ = i
            var l int
            _ = l
        Severity: Minor
        Found in api/dispatcher.pb.go - About 1 hr to fix

          Method Node.processInternalRaftRequest has 59 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (n *Node) processInternalRaftRequest(ctx context.Context, r *api.InternalRaftRequest, cb func()) (proto.Message, error) {
              n.stopMu.RLock()
              if !n.IsMember() {
                  n.stopMu.RUnlock()
                  return nil, ErrStopped
          Severity: Minor
          Found in manager/state/raft/raft.go - About 1 hr to fix

            Method controller.Logs has 58 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (r *controller) Logs(ctx context.Context, publisher exec.LogPublisher, options api.LogSubscriptionOptions) error {
                if err := r.checkClosed(); err != nil {
                    return err
                }
            
            
            Severity: Minor
            Found in swarmd/dockerexec/controller.go - About 1 hr to fix

              Function convertMount has 58 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func convertMount(m api.Mount) enginemount.Mount {
                  mount := enginemount.Mount{
                      Source:   m.Source,
                      Target:   m.Target,
                      ReadOnly: m.ReadOnly,
              Severity: Minor
              Found in swarmd/dockerexec/container.go - About 1 hr to fix

                Function ConvertExtensionWatch has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func ConvertExtensionWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                    var (
                        m          Extension
                        checkFuncs []ExtensionCheckFunc
                    )
                Severity: Minor
                Found in api/objects.pb.go - About 1 hr to fix

                  Function ConvertSecretWatch has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func ConvertSecretWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                      var (
                          m          Secret
                          checkFuncs []SecretCheckFunc
                      )
                  Severity: Minor
                  Found in api/objects.pb.go - About 1 hr to fix

                    Function ConvertVolumeWatch has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func ConvertVolumeWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                        var (
                            m          Volume
                            checkFuncs []VolumeCheckFunc
                        )
                    Severity: Minor
                    Found in api/objects.pb.go - About 1 hr to fix

                      Function ConvertClusterWatch has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func ConvertClusterWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                          var (
                              m          Cluster
                              checkFuncs []ClusterCheckFunc
                          )
                      Severity: Minor
                      Found in api/objects.pb.go - About 1 hr to fix

                        Function ConvertConfigWatch has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func ConvertConfigWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                            var (
                                m          Config
                                checkFuncs []ConfigCheckFunc
                            )
                        Severity: Minor
                        Found in api/objects.pb.go - About 1 hr to fix

                          Function ConvertNetworkWatch has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func ConvertNetworkWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                              var (
                                  m          Network
                                  checkFuncs []NetworkCheckFunc
                              )
                          Severity: Minor
                          Found in api/objects.pb.go - About 1 hr to fix

                            Function ConvertServiceWatch has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func ConvertServiceWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                                var (
                                    m          Service
                                    checkFuncs []ServiceCheckFunc
                                )
                            Severity: Minor
                            Found in api/objects.pb.go - About 1 hr to fix

                              Method testSuite.TestIPAMNotNil has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func (suite *testSuite) TestIPAMNotNil() {
                                  s := store.NewMemoryStore(nil)
                                  suite.NotNil(s)
                                  defer s.Close()
                              
                              
                              Severity: Minor
                              Found in manager/allocator/allocator_test_suite_linux.go - About 1 hr to fix

                                Method Node.JoinAndStart has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func (n *Node) JoinAndStart(ctx context.Context) (err error) {
                                    ctx, cancel := n.WithContext(ctx)
                                    defer func() {
                                        cancel()
                                        if err != nil {
                                Severity: Minor
                                Found in manager/state/raft/raft.go - About 1 hr to fix

                                  Method LogBroker.ListenSubscriptions has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func (lb *LogBroker) ListenSubscriptions(request *api.ListenSubscriptionsRequest, stream api.LogBroker_ListenSubscriptionsServer) error {
                                      remote, err := ca.RemoteNode(stream.Context())
                                      if err != nil {
                                          return err
                                      }
                                  Severity: Minor
                                  Found in manager/logbroker/broker.go - About 1 hr to fix

                                    Method Collector.Run has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                                    Open

                                    func (c *Collector) Run(ctx context.Context) error {
                                        defer close(c.doneChan)
                                    
                                        watcher, cancel, err := store.ViewAndWatch(c.store, func(readTx store.ReadTx) error {
                                            nodes, err := store.FindNodes(readTx, store.All)
                                    Severity: Minor
                                    Found in manager/metrics/collector.go - About 1 hr to fix

                                      Function printNetworkSummary has 57 lines of code (exceeds 50 allowed). Consider refactoring.
                                      Open

                                      func printNetworkSummary(network *api.Network) {
                                          w := tabwriter.NewWriter(os.Stdout, 8, 8, 8, ' ', 0)
                                          defer func() {
                                              // Ignore flushing errors - there's nothing we can do.
                                              _ = w.Flush()
                                      Severity: Minor
                                      Found in swarmd/cmd/swarmctl/network/inspect.go - About 1 hr to fix

                                        Method signHandler.ServeHTTP has 57 lines of code (exceeds 50 allowed). Consider refactoring.
                                        Open

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