kubenetworks/kubevpn

View on GitHub

Showing 198 of 556 total issues

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

        for _, port := range c.Ports {
            p := nat.Port(fmt.Sprintf("%d/%s", port.ContainerPort, strings.ToLower(string(port.Protocol))))
            if port.HostPort != 0 {
                binding := []nat.PortBinding{{HostPort: strconv.FormatInt(int64(port.HostPort), 10)}}
                portMap[p] = binding
Severity: Major
Found in pkg/dev/runconfig.go and 1 other location - About 1 hr to fix
pkg/dev/options.go on lines 681..691

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

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

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

        for _, port := range c.Ports {
            p := nat.Port(fmt.Sprintf("%d/%s", port.ContainerPort, strings.ToLower(string(port.Protocol))))
            if port.HostPort != 0 {
                binding := []nat.PortBinding{{HostPort: strconv.FormatInt(int64(port.HostPort), 10)}}
                portMap[p] = binding
Severity: Major
Found in pkg/dev/options.go and 1 other location - About 1 hr to fix
pkg/dev/runconfig.go on lines 192..202

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

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

func (c *daemonClient) Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (Daemon_LeaveClient, error) {
    stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[4], Daemon_Leave_FullMethodName, opts...)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/daemon/rpc/daemon_grpc.pb.go and 9 other locations - About 1 hr to fix
pkg/daemon/rpc/daemon_grpc.pb.go on lines 80..93
pkg/daemon/rpc/daemon_grpc.pb.go on lines 112..125
pkg/daemon/rpc/daemon_grpc.pb.go on lines 144..157
pkg/daemon/rpc/daemon_grpc.pb.go on lines 176..189
pkg/daemon/rpc/daemon_grpc.pb.go on lines 240..253
pkg/daemon/rpc/daemon_grpc.pb.go on lines 272..285
pkg/daemon/rpc/daemon_grpc.pb.go on lines 371..384
pkg/daemon/rpc/daemon_grpc.pb.go on lines 448..461
pkg/daemon/rpc/daemon_grpc.pb.go on lines 480..493

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

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

func (c *daemonClient) Quit(ctx context.Context, in *QuitRequest, opts ...grpc.CallOption) (Daemon_QuitClient, error) {
    stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[10], Daemon_Quit_FullMethodName, opts...)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/daemon/rpc/daemon_grpc.pb.go and 9 other locations - About 1 hr to fix
pkg/daemon/rpc/daemon_grpc.pb.go on lines 80..93
pkg/daemon/rpc/daemon_grpc.pb.go on lines 112..125
pkg/daemon/rpc/daemon_grpc.pb.go on lines 144..157
pkg/daemon/rpc/daemon_grpc.pb.go on lines 176..189
pkg/daemon/rpc/daemon_grpc.pb.go on lines 208..221
pkg/daemon/rpc/daemon_grpc.pb.go on lines 240..253
pkg/daemon/rpc/daemon_grpc.pb.go on lines 272..285
pkg/daemon/rpc/daemon_grpc.pb.go on lines 371..384
pkg/daemon/rpc/daemon_grpc.pb.go on lines 448..461

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

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

func (c *daemonClient) Proxy(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (Daemon_ProxyClient, error) {
    stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[3], Daemon_Proxy_FullMethodName, opts...)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/daemon/rpc/daemon_grpc.pb.go and 9 other locations - About 1 hr to fix
pkg/daemon/rpc/daemon_grpc.pb.go on lines 80..93
pkg/daemon/rpc/daemon_grpc.pb.go on lines 112..125
pkg/daemon/rpc/daemon_grpc.pb.go on lines 144..157
pkg/daemon/rpc/daemon_grpc.pb.go on lines 208..221
pkg/daemon/rpc/daemon_grpc.pb.go on lines 240..253
pkg/daemon/rpc/daemon_grpc.pb.go on lines 272..285
pkg/daemon/rpc/daemon_grpc.pb.go on lines 371..384
pkg/daemon/rpc/daemon_grpc.pb.go on lines 448..461
pkg/daemon/rpc/daemon_grpc.pb.go on lines 480..493

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

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

func (c *daemonClient) ConnectFork(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (Daemon_ConnectForkClient, error) {
    stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[1], Daemon_ConnectFork_FullMethodName, opts...)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/daemon/rpc/daemon_grpc.pb.go and 9 other locations - About 1 hr to fix
pkg/daemon/rpc/daemon_grpc.pb.go on lines 80..93
pkg/daemon/rpc/daemon_grpc.pb.go on lines 144..157
pkg/daemon/rpc/daemon_grpc.pb.go on lines 176..189
pkg/daemon/rpc/daemon_grpc.pb.go on lines 208..221
pkg/daemon/rpc/daemon_grpc.pb.go on lines 240..253
pkg/daemon/rpc/daemon_grpc.pb.go on lines 272..285
pkg/daemon/rpc/daemon_grpc.pb.go on lines 371..384
pkg/daemon/rpc/daemon_grpc.pb.go on lines 448..461
pkg/daemon/rpc/daemon_grpc.pb.go on lines 480..493

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

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

func (c *daemonClient) Disconnect(ctx context.Context, in *DisconnectRequest, opts ...grpc.CallOption) (Daemon_DisconnectClient, error) {
    stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[2], Daemon_Disconnect_FullMethodName, opts...)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/daemon/rpc/daemon_grpc.pb.go and 9 other locations - About 1 hr to fix
pkg/daemon/rpc/daemon_grpc.pb.go on lines 80..93
pkg/daemon/rpc/daemon_grpc.pb.go on lines 112..125
pkg/daemon/rpc/daemon_grpc.pb.go on lines 176..189
pkg/daemon/rpc/daemon_grpc.pb.go on lines 208..221
pkg/daemon/rpc/daemon_grpc.pb.go on lines 240..253
pkg/daemon/rpc/daemon_grpc.pb.go on lines 272..285
pkg/daemon/rpc/daemon_grpc.pb.go on lines 371..384
pkg/daemon/rpc/daemon_grpc.pb.go on lines 448..461
pkg/daemon/rpc/daemon_grpc.pb.go on lines 480..493

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

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

func (c *daemonClient) Clone(ctx context.Context, in *CloneRequest, opts ...grpc.CallOption) (Daemon_CloneClient, error) {
    stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[5], Daemon_Clone_FullMethodName, opts...)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/daemon/rpc/daemon_grpc.pb.go and 9 other locations - About 1 hr to fix
pkg/daemon/rpc/daemon_grpc.pb.go on lines 80..93
pkg/daemon/rpc/daemon_grpc.pb.go on lines 112..125
pkg/daemon/rpc/daemon_grpc.pb.go on lines 144..157
pkg/daemon/rpc/daemon_grpc.pb.go on lines 176..189
pkg/daemon/rpc/daemon_grpc.pb.go on lines 208..221
pkg/daemon/rpc/daemon_grpc.pb.go on lines 272..285
pkg/daemon/rpc/daemon_grpc.pb.go on lines 371..384
pkg/daemon/rpc/daemon_grpc.pb.go on lines 448..461
pkg/daemon/rpc/daemon_grpc.pb.go on lines 480..493

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

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

func (c *daemonClient) Reset(ctx context.Context, in *ResetRequest, opts ...grpc.CallOption) (Daemon_ResetClient, error) {
    stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[9], Daemon_Reset_FullMethodName, opts...)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/daemon/rpc/daemon_grpc.pb.go and 9 other locations - About 1 hr to fix
pkg/daemon/rpc/daemon_grpc.pb.go on lines 80..93
pkg/daemon/rpc/daemon_grpc.pb.go on lines 112..125
pkg/daemon/rpc/daemon_grpc.pb.go on lines 144..157
pkg/daemon/rpc/daemon_grpc.pb.go on lines 176..189
pkg/daemon/rpc/daemon_grpc.pb.go on lines 208..221
pkg/daemon/rpc/daemon_grpc.pb.go on lines 240..253
pkg/daemon/rpc/daemon_grpc.pb.go on lines 272..285
pkg/daemon/rpc/daemon_grpc.pb.go on lines 371..384
pkg/daemon/rpc/daemon_grpc.pb.go on lines 480..493

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

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

func (c *daemonClient) Logs(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (Daemon_LogsClient, error) {
    stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[8], Daemon_Logs_FullMethodName, opts...)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/daemon/rpc/daemon_grpc.pb.go and 9 other locations - About 1 hr to fix
pkg/daemon/rpc/daemon_grpc.pb.go on lines 80..93
pkg/daemon/rpc/daemon_grpc.pb.go on lines 112..125
pkg/daemon/rpc/daemon_grpc.pb.go on lines 144..157
pkg/daemon/rpc/daemon_grpc.pb.go on lines 176..189
pkg/daemon/rpc/daemon_grpc.pb.go on lines 208..221
pkg/daemon/rpc/daemon_grpc.pb.go on lines 240..253
pkg/daemon/rpc/daemon_grpc.pb.go on lines 272..285
pkg/daemon/rpc/daemon_grpc.pb.go on lines 448..461
pkg/daemon/rpc/daemon_grpc.pb.go on lines 480..493

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

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

func (c *daemonClient) Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (Daemon_ConnectClient, error) {
    stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[0], Daemon_Connect_FullMethodName, opts...)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/daemon/rpc/daemon_grpc.pb.go and 9 other locations - About 1 hr to fix
pkg/daemon/rpc/daemon_grpc.pb.go on lines 112..125
pkg/daemon/rpc/daemon_grpc.pb.go on lines 144..157
pkg/daemon/rpc/daemon_grpc.pb.go on lines 176..189
pkg/daemon/rpc/daemon_grpc.pb.go on lines 208..221
pkg/daemon/rpc/daemon_grpc.pb.go on lines 240..253
pkg/daemon/rpc/daemon_grpc.pb.go on lines 272..285
pkg/daemon/rpc/daemon_grpc.pb.go on lines 371..384
pkg/daemon/rpc/daemon_grpc.pb.go on lines 448..461
pkg/daemon/rpc/daemon_grpc.pb.go on lines 480..493

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

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

func (c *daemonClient) Remove(ctx context.Context, in *RemoveRequest, opts ...grpc.CallOption) (Daemon_RemoveClient, error) {
    stream, err := c.cc.NewStream(ctx, &Daemon_ServiceDesc.Streams[6], Daemon_Remove_FullMethodName, opts...)
    if err != nil {
        return nil, err
    }
Severity: Major
Found in pkg/daemon/rpc/daemon_grpc.pb.go and 9 other locations - About 1 hr to fix
pkg/daemon/rpc/daemon_grpc.pb.go on lines 80..93
pkg/daemon/rpc/daemon_grpc.pb.go on lines 112..125
pkg/daemon/rpc/daemon_grpc.pb.go on lines 144..157
pkg/daemon/rpc/daemon_grpc.pb.go on lines 176..189
pkg/daemon/rpc/daemon_grpc.pb.go on lines 208..221
pkg/daemon/rpc/daemon_grpc.pb.go on lines 240..253
pkg/daemon/rpc/daemon_grpc.pb.go on lines 371..384
pkg/daemon/rpc/daemon_grpc.pb.go on lines 448..461
pkg/daemon/rpc/daemon_grpc.pb.go on lines 480..493

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

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

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

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

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

Refactorings

Further Reading

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

func (c *fakeUDPTunnelConnector) ConnectContext(ctx context.Context, conn net.Conn) (net.Conn, error) {
    //defer conn.SetDeadline(time.Time{})
    switch con := conn.(type) {
    case *net.TCPConn:
        err := con.SetNoDelay(true)
Severity: Major
Found in pkg/core/tcphandler.go and 1 other location - About 1 hr to fix
pkg/core/gvisorudphandler.go on lines 25..42

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

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

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

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

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

Refactorings

Further Reading

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

func (c *gvisorUDPOverTCPTunnelConnector) ConnectContext(ctx context.Context, conn net.Conn) (net.Conn, error) {
    switch con := conn.(type) {
    case *net.TCPConn:
        err := con.SetNoDelay(true)
        if err != nil {
Severity: Major
Found in pkg/core/gvisorudphandler.go and 1 other location - About 1 hr to fix
pkg/core/tcphandler.go on lines 22..40

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

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

            } else {
                resp, err := cli.Connect(cmd.Context(), req)
                if err != nil {
                    return err
                }
Severity: Major
Found in cmd/kubevpn/cmds/connect.go and 1 other location - About 1 hr to fix
cmd/kubevpn/cmds/connect.go on lines 98..114

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

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 lite {
                resp, err := cli.ConnectFork(cmd.Context(), req)
                if err != nil {
                    return err
                }
Severity: Major
Found in cmd/kubevpn/cmds/connect.go and 1 other location - About 1 hr to fix
cmd/kubevpn/cmds/connect.go on lines 114..130

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

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

    for _, address := range cred.Addresses {
        // Type
        err = binary.Write(b, *endian, uint16(address.AddrType))
        if err != nil {
            return []byte{}, err
Severity: Major
Found in pkg/util/gssapi_ccache.go and 1 other location - About 1 hr to fix
pkg/util/gssapi_ccache.go on lines 393..409

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

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

    for _, authData := range cred.AuthData {
        // Type
        err = binary.Write(b, *endian, uint16(authData.ADType))
        if err != nil {
            return []byte{}, err
Severity: Major
Found in pkg/util/gssapi_ccache.go and 1 other location - About 1 hr to fix
pkg/util/gssapi_ccache.go on lines 367..383

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

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

    err = d.updateDHCPConfigMap(ctx, func(ipv4 *ipallocator.Range, ipv6 *ipallocator.Range) (err error) {
        for {
            if v4, err = ipv4.AllocateNext(); err != nil {
                return err
            }
Severity: Major
Found in pkg/handler/dhcp.go and 1 other location - About 1 hr to fix
pkg/handler/dhcp.go on lines 144..162

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

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

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

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

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

Refactorings

Further Reading

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

func printResetResp(resp rpc.Daemon_ResetClient) error {
    for {
        recv, err := resp.Recv()
        if err == io.EOF {
            return nil
Severity: Major
Found in cmd/kubevpn/cmds/reset.go and 1 other location - About 1 hr to fix
cmd/kubevpn/cmds/reset.go on lines 107..119

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

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