dotcloud/docker

View on GitHub

Showing 1,904 of 1,904 total issues

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

func delVlanLink(linkName string) error {
    if strings.Contains(linkName, ".") {
        _, _, err := parseVlan(linkName)
        if err != nil {
            return err
Severity: Major
Found in libnetwork/drivers/macvlan/macvlan_setup.go and 1 other location - About 2 hrs to fix
libnetwork/drivers/ipvlan/ipvlan_setup.go on lines 134..158

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

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 parseConfig has 84 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func parseConfig(cfg map[string]string) (fluent.Config, error) {
    var config fluent.Config

    loc, err := parseAddress(cfg[addressKey])
    if err != nil {
Severity: Major
Found in daemon/logger/fluentd/fluentd.go - About 2 hrs to fix

    Plugin has 22 methods (exceeds 20 allowed). Consider refactoring.
    Open

    type Plugin struct {
        mu        sync.RWMutex
        PluginObj types.Plugin `json:"plugin"` // todo: embed struct
        pClient   *plugins.Client
        refCount  int
    Severity: Minor
    Found in plugin/v2/plugin.go - About 2 hrs to fix

      TableEvent has 22 methods (exceeds 20 allowed). Consider refactoring.
      Open

      type TableEvent struct {
          Type TableEvent_Type `protobuf:"varint,1,opt,name=type,proto3,enum=networkdb.TableEvent_Type" json:"type,omitempty"`
          // Lamport time when this event was generated.
          LTime github_com_hashicorp_serf_serf.LamportTime `protobuf:"varint,2,opt,name=l_time,json=lTime,proto3,customtype=github.com/hashicorp/serf/serf.LamportTime" json:"l_time"`
          // Node name where this event originated.
      Severity: Minor
      Found in libnetwork/networkdb/networkdb.pb.go - About 2 hrs to fix

        containerRouter has 22 methods (exceeds 20 allowed). Consider refactoring.
        Open

        func (s *containerRouter) postCommit(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
            if err := httputils.ParseForm(r); err != nil {
                return err
            }
        
        
        Severity: Minor
        Found in api/server/router/container/container_routes.go - About 2 hrs to fix

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

                  case 3:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 5:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 3:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578

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

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

                  case 2:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in api/types/swarm/runtime/plugin.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 4:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field NetworkID", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 1:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field NetworkID", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 2:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field EndpointMAC", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/drivers/overlay/overlay.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 1:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/agent.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 3:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/agent.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 1:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/agent.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 3:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 3:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/networkdb/networkdb.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 2:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field Remote", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in api/types/swarm/runtime/plugin.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 1:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field EndpointIP", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in libnetwork/drivers/overlay/overlay.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 389..420
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

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

                  case 1:
                      if wireType != 2 {
                          return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType)
                      }
                      var stringLen uint64
          Severity: Major
          Found in api/types/plugins/logdriver/entry.pb.go and 25 other locations - About 2 hrs to fix
          api/types/plugins/logdriver/entry.pb.go on lines 600..631
          api/types/swarm/runtime/plugin.pb.go on lines 408..439
          api/types/swarm/runtime/plugin.pb.go on lines 440..471
          api/types/swarm/runtime/plugin.pb.go on lines 608..639
          api/types/swarm/runtime/plugin.pb.go on lines 640..671
          libnetwork/agent.pb.go on lines 647..678
          libnetwork/agent.pb.go on lines 679..710
          libnetwork/agent.pb.go on lines 711..742
          libnetwork/agent.pb.go on lines 743..774
          libnetwork/agent.pb.go on lines 775..806
          libnetwork/agent.pb.go on lines 975..1006
          libnetwork/drivers/overlay/overlay.pb.go on lines 272..303
          libnetwork/drivers/overlay/overlay.pb.go on lines 304..335
          libnetwork/drivers/overlay/overlay.pb.go on lines 336..367
          libnetwork/networkdb/networkdb.pb.go on lines 1891..1922
          libnetwork/networkdb/networkdb.pb.go on lines 2011..2042
          libnetwork/networkdb/networkdb.pb.go on lines 2043..2074
          libnetwork/networkdb/networkdb.pb.go on lines 2125..2156
          libnetwork/networkdb/networkdb.pb.go on lines 2176..2207
          libnetwork/networkdb/networkdb.pb.go on lines 2331..2362
          libnetwork/networkdb/networkdb.pb.go on lines 2451..2482
          libnetwork/networkdb/networkdb.pb.go on lines 2483..2514
          libnetwork/networkdb/networkdb.pb.go on lines 2515..2546
          libnetwork/networkdb/networkdb.pb.go on lines 2547..2578
          libnetwork/networkdb/networkdb.pb.go on lines 2721..2752

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

          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