docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

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

func (m *LeaveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    _ = i
    var l int
    _ = l
Severity: Major
Found in api/raft.pb.go and 2 other locations - About 1 hr to fix
api/raft.pb.go on lines 1626..1644
api/raft.pb.go on lines 1684..1702

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 161.

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 3 locations. Consider refactoring.
Open

func (m *StreamRaftMessageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    i := len(dAtA)
    _ = i
    var l int
    _ = l
Severity: Major
Found in api/raft.pb.go and 2 other locations - About 1 hr to fix
api/raft.pb.go on lines 1568..1586
api/raft.pb.go on lines 1626..1644

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 161.

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

Method HeartbeatResponse.Unmarshal has 16 return statements (exceeds 4 allowed).
Open

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

    Method TasksMessage.Unmarshal has 16 return statements (exceeds 4 allowed).
    Open

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

      Method SubscribeLogsMessage.Unmarshal has 16 return statements (exceeds 4 allowed).
      Open

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

        Method StreamRaftMessageRequest.Unmarshal has 16 return statements (exceeds 4 allowed).
        Open

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

          Method LeaveRequest.Unmarshal has 16 return statements (exceeds 4 allowed).
          Open

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

            Method ProcessRaftMessageRequest.Unmarshal has 16 return statements (exceeds 4 allowed).
            Open

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

              Method Server.UpdateService has 16 return statements (exceeds 4 allowed).
              Open

              func (s *Server) UpdateService(ctx context.Context, request *api.UpdateServiceRequest) (*api.UpdateServiceResponse, error) {
                  if request.ServiceID == "" || request.ServiceVersion == nil {
                      return nil, status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
                  }
                  if err := validateServiceSpec(request.Spec); err != nil {
              Severity: Major
              Found in manager/controlapi/service.go - About 1 hr to fix

                Function NodeMatches has 16 return statements (exceeds 4 allowed).
                Open

                func NodeMatches(constraints []Constraint, n *api.Node) bool {
                    for _, constraint := range constraints {
                        switch {
                        case strings.EqualFold(constraint.key, "node.id"):
                            if !constraint.Match(n.ID) {
                Severity: Major
                Found in manager/constraint/constraint.go - About 1 hr to fix

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

                  func (m *TasksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                      i := len(dAtA)
                      _ = i
                      var l int
                      _ = l
                  Severity: Major
                  Found in api/dispatcher.pb.go and 10 other locations - About 1 hr to fix
                  api/ca.pb.go on lines 816..829
                  api/ca.pb.go on lines 998..1011
                  api/dispatcher.pb.go on lines 1860..1873
                  api/dispatcher.pb.go on lines 2204..2217
                  api/health.pb.go on lines 317..330
                  api/raft.pb.go on lines 1489..1502
                  api/raft.pb.go on lines 1770..1783
                  api/resource.pb.go on lines 484..497
                  api/resource.pb.go on lines 514..527
                  api/specs.pb.go on lines 2809..2822

                  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 159.

                  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 11 locations. Consider refactoring.
                  Open

                  func (m *AttachNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                      i := len(dAtA)
                      _ = i
                      var l int
                      _ = l
                  Severity: Major
                  Found in api/resource.pb.go and 10 other locations - About 1 hr to fix
                  api/ca.pb.go on lines 816..829
                  api/ca.pb.go on lines 998..1011
                  api/dispatcher.pb.go on lines 1860..1873
                  api/dispatcher.pb.go on lines 2137..2150
                  api/dispatcher.pb.go on lines 2204..2217
                  api/health.pb.go on lines 317..330
                  api/raft.pb.go on lines 1489..1502
                  api/raft.pb.go on lines 1770..1783
                  api/resource.pb.go on lines 514..527
                  api/specs.pb.go on lines 2809..2822

                  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 159.

                  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 11 locations. Consider refactoring.
                  Open

                  func (m *HealthCheckRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                      i := len(dAtA)
                      _ = i
                      var l int
                      _ = l
                  Severity: Major
                  Found in api/health.pb.go and 10 other locations - About 1 hr to fix
                  api/ca.pb.go on lines 816..829
                  api/ca.pb.go on lines 998..1011
                  api/dispatcher.pb.go on lines 1860..1873
                  api/dispatcher.pb.go on lines 2137..2150
                  api/dispatcher.pb.go on lines 2204..2217
                  api/raft.pb.go on lines 1489..1502
                  api/raft.pb.go on lines 1770..1783
                  api/resource.pb.go on lines 484..497
                  api/resource.pb.go on lines 514..527
                  api/specs.pb.go on lines 2809..2822

                  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 159.

                  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 11 locations. Consider refactoring.
                  Open

                  func (m *GetRootCACertificateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                      i := len(dAtA)
                      _ = i
                      var l int
                      _ = l
                  Severity: Major
                  Found in api/ca.pb.go and 10 other locations - About 1 hr to fix
                  api/ca.pb.go on lines 816..829
                  api/dispatcher.pb.go on lines 1860..1873
                  api/dispatcher.pb.go on lines 2137..2150
                  api/dispatcher.pb.go on lines 2204..2217
                  api/health.pb.go on lines 317..330
                  api/raft.pb.go on lines 1489..1502
                  api/raft.pb.go on lines 1770..1783
                  api/resource.pb.go on lines 484..497
                  api/resource.pb.go on lines 514..527
                  api/specs.pb.go on lines 2809..2822

                  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 159.

                  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 11 locations. Consider refactoring.
                  Open

                  func (m *AssignmentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                      i := len(dAtA)
                      _ = i
                      var l int
                      _ = l
                  Severity: Major
                  Found in api/dispatcher.pb.go and 10 other locations - About 1 hr to fix
                  api/ca.pb.go on lines 816..829
                  api/ca.pb.go on lines 998..1011
                  api/dispatcher.pb.go on lines 1860..1873
                  api/dispatcher.pb.go on lines 2137..2150
                  api/health.pb.go on lines 317..330
                  api/raft.pb.go on lines 1489..1502
                  api/raft.pb.go on lines 1770..1783
                  api/resource.pb.go on lines 484..497
                  api/resource.pb.go on lines 514..527
                  api/specs.pb.go on lines 2809..2822

                  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 159.

                  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 11 locations. Consider refactoring.
                  Open

                  func (m *JoinRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                      i := len(dAtA)
                      _ = i
                      var l int
                      _ = l
                  Severity: Major
                  Found in api/raft.pb.go and 10 other locations - About 1 hr to fix
                  api/ca.pb.go on lines 816..829
                  api/ca.pb.go on lines 998..1011
                  api/dispatcher.pb.go on lines 1860..1873
                  api/dispatcher.pb.go on lines 2137..2150
                  api/dispatcher.pb.go on lines 2204..2217
                  api/health.pb.go on lines 317..330
                  api/raft.pb.go on lines 1770..1783
                  api/resource.pb.go on lines 484..497
                  api/resource.pb.go on lines 514..527
                  api/specs.pb.go on lines 2809..2822

                  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 159.

                  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 11 locations. Consider refactoring.
                  Open

                  func (m *NodeCertificateStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                      i := len(dAtA)
                      _ = i
                      var l int
                      _ = l
                  Severity: Major
                  Found in api/ca.pb.go and 10 other locations - About 1 hr to fix
                  api/ca.pb.go on lines 998..1011
                  api/dispatcher.pb.go on lines 1860..1873
                  api/dispatcher.pb.go on lines 2137..2150
                  api/dispatcher.pb.go on lines 2204..2217
                  api/health.pb.go on lines 317..330
                  api/raft.pb.go on lines 1489..1502
                  api/raft.pb.go on lines 1770..1783
                  api/resource.pb.go on lines 484..497
                  api/resource.pb.go on lines 514..527
                  api/specs.pb.go on lines 2809..2822

                  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 159.

                  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 11 locations. Consider refactoring.
                  Open

                  func (m *HeartbeatRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                      i := len(dAtA)
                      _ = i
                      var l int
                      _ = l
                  Severity: Major
                  Found in api/dispatcher.pb.go and 10 other locations - About 1 hr to fix
                  api/ca.pb.go on lines 816..829
                  api/ca.pb.go on lines 998..1011
                  api/dispatcher.pb.go on lines 2137..2150
                  api/dispatcher.pb.go on lines 2204..2217
                  api/health.pb.go on lines 317..330
                  api/raft.pb.go on lines 1489..1502
                  api/raft.pb.go on lines 1770..1783
                  api/resource.pb.go on lines 484..497
                  api/resource.pb.go on lines 514..527
                  api/specs.pb.go on lines 2809..2822

                  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 159.

                  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 11 locations. Consider refactoring.
                  Open

                  func (m *NetworkAttachmentSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                      i := len(dAtA)
                      _ = i
                      var l int
                      _ = l
                  Severity: Major
                  Found in api/specs.pb.go and 10 other locations - About 1 hr to fix
                  api/ca.pb.go on lines 816..829
                  api/ca.pb.go on lines 998..1011
                  api/dispatcher.pb.go on lines 1860..1873
                  api/dispatcher.pb.go on lines 2137..2150
                  api/dispatcher.pb.go on lines 2204..2217
                  api/health.pb.go on lines 317..330
                  api/raft.pb.go on lines 1489..1502
                  api/raft.pb.go on lines 1770..1783
                  api/resource.pb.go on lines 484..497
                  api/resource.pb.go on lines 514..527

                  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 159.

                  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 11 locations. Consider refactoring.
                  Open

                  func (m *ResolveAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                      i := len(dAtA)
                      _ = i
                      var l int
                      _ = l
                  Severity: Major
                  Found in api/raft.pb.go and 10 other locations - About 1 hr to fix
                  api/ca.pb.go on lines 816..829
                  api/ca.pb.go on lines 998..1011
                  api/dispatcher.pb.go on lines 1860..1873
                  api/dispatcher.pb.go on lines 2137..2150
                  api/dispatcher.pb.go on lines 2204..2217
                  api/health.pb.go on lines 317..330
                  api/raft.pb.go on lines 1489..1502
                  api/resource.pb.go on lines 484..497
                  api/resource.pb.go on lines 514..527
                  api/specs.pb.go on lines 2809..2822

                  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 159.

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language