kubenetworks/kubevpn

View on GitHub

Showing 526 of 526 total issues

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

    if cfg.Addr6 != "" {
        var ipv6CIDR *net.IPNet
        if ipv6, ipv6CIDR, err = net.ParseCIDR(cfg.Addr6); err != nil {
            return
        }
Severity: Minor
Found in pkg/tun/tun_linux.go and 1 other location - About 40 mins to fix
pkg/tun/tun_linux.go on lines 66..75

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

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

    if cfg.Addr != "" {
        var ipv4CIDR *net.IPNet
        if ipv4, ipv4CIDR, err = net.ParseCIDR(cfg.Addr); err != nil {
            return
        }
Severity: Minor
Found in pkg/tun/tun_linux.go and 1 other location - About 40 mins to fix
pkg/tun/tun_linux.go on lines 77..86

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

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 CreateFolder has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

func CreateFolder(ctx context.Context, cli *client.Client, id string, src string, target string) (string, error) {
Severity: Minor
Found in pkg/util/volume.go - About 35 mins to fix

    Function initTtySize has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func initTtySize(ctx context.Context, cli command.Cli, id string, isExec bool, resizeTtyFunc func(ctx context.Context, cli command.Cli, id string, isExec bool) error) {
    Severity: Minor
    Found in pkg/dev/docker_tty.go - About 35 mins to fix

      Function resizeTtyTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func resizeTtyTo(ctx context.Context, apiClient client.ContainerAPIClient, id string, height, width uint, isExec bool) error {
      Severity: Minor
      Found in pkg/dev/docker_tty.go - About 35 mins to fix

        Function disconnectByKubeConfig has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func disconnectByKubeConfig(ctx context.Context, svr *Server, kubeconfigBytes string, ns string, jump *rpc.SshJump) error {
        Severity: Minor
        Found in pkg/daemon/action/disconnect.go - About 35 mins to fix

          Function transportTunClient has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func transportTunClient(ctx context.Context, tunInbound <-chan *DataElem, tunOutbound chan<- *DataElem, packetConn net.PacketConn, remoteAddr net.Addr) error {
          Severity: Minor
          Found in pkg/core/tunhandlerclient.go - About 35 mins to fix

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

            func (c *daemonClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
                out := new(GetResponse)
                err := c.cc.Invoke(ctx, Daemon_Get_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/daemon/rpc/daemon_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *daemonClient) Upgrade(ctx context.Context, in *UpgradeRequest, opts ...grpc.CallOption) (*UpgradeResponse, error) {
                out := new(UpgradeResponse)
                err := c.cc.Invoke(ctx, Daemon_Upgrade_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/daemon/rpc/daemon_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *daemonClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) {
                out := new(VersionResponse)
                err := c.cc.Invoke(ctx, Daemon_Version_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/daemon/rpc/daemon_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *daemonClient) Identify(ctx context.Context, in *IdentifyRequest, opts ...grpc.CallOption) (*IdentifyResponse, error) {
                out := new(IdentifyResponse)
                err := c.cc.Invoke(ctx, Daemon_Identify_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/daemon/rpc/daemon_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *dHCPClient) RentIP(ctx context.Context, in *RentIPRequest, opts ...grpc.CallOption) (*RentIPResponse, error) {
                out := new(RentIPResponse)
                err := c.cc.Invoke(ctx, DHCP_RentIP_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/dhcp/rpc/dhcpserver_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *daemonClient) SshStop(ctx context.Context, in *SshStopRequest, opts ...grpc.CallOption) (*SshStopResponse, error) {
                out := new(SshStopResponse)
                err := c.cc.Invoke(ctx, Daemon_SshStop_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/daemon/rpc/daemon_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *daemonClient) ConfigAdd(ctx context.Context, in *ConfigAddRequest, opts ...grpc.CallOption) (*ConfigAddResponse, error) {
                out := new(ConfigAddResponse)
                err := c.cc.Invoke(ctx, Daemon_ConfigAdd_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/daemon/rpc/daemon_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *daemonClient) ConfigRemove(ctx context.Context, in *ConfigRemoveRequest, opts ...grpc.CallOption) (*ConfigRemoveResponse, error) {
                out := new(ConfigRemoveResponse)
                err := c.cc.Invoke(ctx, Daemon_ConfigRemove_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/daemon/rpc/daemon_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *daemonClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
                out := new(ListResponse)
                err := c.cc.Invoke(ctx, Daemon_List_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/daemon/rpc/daemon_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *daemonClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
                out := new(StatusResponse)
                err := c.cc.Invoke(ctx, Daemon_Status_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/daemon/rpc/daemon_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *daemonClient) SshStart(ctx context.Context, in *SshStartRequest, opts ...grpc.CallOption) (*SshStartResponse, error) {
                out := new(SshStartResponse)
                err := c.cc.Invoke(ctx, Daemon_SshStart_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/daemon/rpc/daemon_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 51..58

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

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

            func (c *dHCPClient) ReleaseIP(ctx context.Context, in *ReleaseIPRequest, opts ...grpc.CallOption) (*ReleaseIPResponse, error) {
                out := new(ReleaseIPResponse)
                err := c.cc.Invoke(ctx, DHCP_ReleaseIP_FullMethodName, in, out, opts...)
                if err != nil {
                    return nil, err
            Severity: Major
            Found in pkg/dhcp/rpc/dhcpserver_grpc.pb.go and 11 other locations - About 35 mins to fix
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 304..311
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 313..320
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 322..329
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 331..338
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 403..410
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 412..419
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 421..428
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 430..437
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 439..446
            pkg/daemon/rpc/daemon_grpc.pb.go on lines 512..519
            pkg/dhcp/rpc/dhcpserver_grpc.pb.go on lines 42..49

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

            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 getDHCPServerClient has 5 return statements (exceeds 4 allowed).
            Open

            func getDHCPServerClient(ctx context.Context, namespace string) (rpc.DHCPClient, error) {
                cert, ok := os.LookupEnv(config.TLSCertKey)
                if !ok {
                    return nil, fmt.Errorf("can not get %s from env", config.TLSCertKey)
                }
            Severity: Major
            Found in pkg/handler/tools.go - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language