docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

Method AttachNetworkRequest.Unmarshal has 22 return statements (exceeds 4 allowed).
Open

func (m *AttachNetworkRequest) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/resource.pb.go - About 2 hrs to fix

    Method GetUnlockKeyResponse.Unmarshal has 22 return statements (exceeds 4 allowed).
    Open

    func (m *GetUnlockKeyResponse) Unmarshal(dAtA []byte) error {
        l := len(dAtA)
        iNdEx := 0
        for iNdEx < l {
            preIndex := iNdEx
    Severity: Major
    Found in api/ca.pb.go - About 2 hrs to fix

      Method UpdateVolumeStatusRequest.Unmarshal has 22 return statements (exceeds 4 allowed).
      Open

      func (m *UpdateVolumeStatusRequest) Unmarshal(dAtA []byte) error {
          l := len(dAtA)
          iNdEx := 0
          for iNdEx < l {
              preIndex := iNdEx
      Severity: Major
      Found in api/dispatcher.pb.go - About 2 hrs to fix

        Method SessionRequest.Unmarshal has 22 return statements (exceeds 4 allowed).
        Open

        func (m *SessionRequest) Unmarshal(dAtA []byte) error {
            l := len(dAtA)
            iNdEx := 0
            for iNdEx < l {
                preIndex := iNdEx
        Severity: Major
        Found in api/dispatcher.pb.go - About 2 hrs to fix

          Method UpdateTaskStatusRequest.Unmarshal has 22 return statements (exceeds 4 allowed).
          Open

          func (m *UpdateTaskStatusRequest) Unmarshal(dAtA []byte) error {
              l := len(dAtA)
              iNdEx := 0
              for iNdEx < l {
                  preIndex := iNdEx
          Severity: Major
          Found in api/dispatcher.pb.go - About 2 hrs to fix

            Method UpdateTaskStatusRequest_TaskStatusUpdate.Unmarshal has 22 return statements (exceeds 4 allowed).
            Open

            func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Unmarshal(dAtA []byte) error {
                l := len(dAtA)
                iNdEx := 0
                for iNdEx < l {
                    preIndex := iNdEx
            Severity: Major
            Found in api/dispatcher.pb.go - About 2 hrs to fix

              Method GenericRuntimeSpec.Unmarshal has 22 return statements (exceeds 4 allowed).
              Open

              func (m *GenericRuntimeSpec) Unmarshal(dAtA []byte) error {
                  l := len(dAtA)
                  iNdEx := 0
                  for iNdEx < l {
                      preIndex := iNdEx
              Severity: Major
              Found in api/specs.pb.go - About 2 hrs to fix

                Method testSuite.TestAllocator has 22 return statements (exceeds 4 allowed).
                Open

                func (suite *testSuite) TestAllocator() {
                    s := store.NewMemoryStore(nil)
                    suite.NotNil(s)
                    defer s.Close()
                    a := suite.newAllocator(s)
                Severity: Major
                Found in manager/allocator/allocator_test_suite.go - About 2 hrs to fix

                  Method Node.Join has 75 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (n *Node) Join(ctx context.Context, req *api.JoinRequest) (*api.JoinResponse, error) {
                      nodeInfo, err := ca.RemoteNode(ctx)
                      if err != nil {
                          return nil, err
                      }
                  Severity: Minor
                  Found in manager/state/raft/raft.go - About 2 hrs to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    func (m *SelectByCustom) Size() (n int) {
                        if m == nil {
                            return 0
                        }
                        var l int
                    Severity: Major
                    Found in api/watch.pb.go and 1 other location - About 2 hrs to fix
                    api/logbroker.pb.go on lines 2070..2089

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 190.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    func (m *LogContext) Size() (n int) {
                        if m == nil {
                            return 0
                        }
                        var l int
                    Severity: Major
                    Found in api/logbroker.pb.go and 1 other location - About 2 hrs to fix
                    api/watch.pb.go on lines 2420..2439

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 190.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

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

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      var (
                          inspectCmd = &cobra.Command{
                              Use:   "inspect <cluster name>",
                              Short: "Inspect a cluster",
                              RunE: func(cmd *cobra.Command, args []string) error {
                      Severity: Major
                      Found in swarmd/cmd/swarmctl/cluster/inspect.go and 1 other location - About 1 hr to fix
                      swarmd/cmd/swarmctl/network/inspect.go on lines 14..41

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 187.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      var (
                          inspectCmd = &cobra.Command{
                              Use:   "inspect <network ID>",
                              Short: "Inspect a network",
                              RunE: func(cmd *cobra.Command, args []string) error {
                      Severity: Major
                      Found in swarmd/cmd/swarmctl/network/inspect.go and 1 other location - About 1 hr to fix
                      swarmd/cmd/swarmctl/cluster/inspect.go on lines 73..101

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 187.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Function Merge has 73 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func Merge(cmd *cobra.Command, spec *api.ServiceSpec, c api.ControlClient) error {
                          flags := cmd.Flags()
                      
                          if flags.Changed("force") {
                              force, err := flags.GetBool("force")
                      Severity: Minor
                      Found in swarmd/cmd/swarmctl/service/flagparser/flags.go - About 1 hr to fix

                        Method testSuite.TestAllocateServiceConflictingUserDefinedPorts has 73 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

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

                          Method testSuite.TestNodeAttachmentOnLeadershipChange has 73 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

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

                            Function EventFromStoreAction has 21 return statements (exceeds 4 allowed).
                            Open

                            func EventFromStoreAction(sa StoreAction, oldObject StoreObject) (Event, error) {
                                switch v := sa.Target.(type) {
                                case *StoreAction_Node:
                                    switch sa.Action {
                                    case StoreActionKindCreate:
                            Severity: Major
                            Found in api/objects.pb.go - About 1 hr to fix

                              Method Endpoint_VirtualIP.Unmarshal has 21 return statements (exceeds 4 allowed).
                              Open

                              func (m *Endpoint_VirtualIP) Unmarshal(dAtA []byte) error {
                                  l := len(dAtA)
                                  iNdEx := 0
                                  for iNdEx < l {
                                      preIndex := iNdEx
                              Severity: Major
                              Found in api/objects.pb.go - About 1 hr to fix

                                Function WatchMessageEvent has 21 return statements (exceeds 4 allowed).
                                Open

                                func WatchMessageEvent(c Event) *WatchMessage_Event {
                                    switch v := c.(type) {
                                    case EventCreateNode:
                                        return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Node{Node: v.Node}}}
                                    case EventUpdateNode:
                                Severity: Major
                                Found in api/objects.pb.go - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language