Preparing report...

Report for github.com/aylei/kubectl-debug

A    Great!    Found 11 issues across 16 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


golint31%

Golint is a linter for Go source code.

    • kubectl-debug/pkg/agent/runtime.go
    • Line 52: warning: exported type ContainerRuntimeScheme should have comment or be unexported (golint)
    • Line 55: warning: exported const DockerScheme should have comment (or a comment on this block) or be unexported (golint)
    • Line 61: warning: exported type ContainerInfo should have comment or be unexported (golint)
    • Line 66: warning: exported type RunConfig should have comment or be unexported (golint)
    • Line 89: warning: exported type ContainerRuntime should have comment or be unexported (golint)
    • Line 97: warning: exported type DockerContainerRuntime should have comment or be unexported (golint)
    • Line 101: warning: exported var DockerContainerRuntimeImplementsContainerRuntime should have comment or be unexported (golint)
    • Line 103: warning: exported method DockerContainerRuntime.PullImage should have comment or be unexported (golint)
    • Line 137: warning: exported method DockerContainerRuntime.ContainerInfo should have comment or be unexported (golint)
    • Line 150: warning: exported method DockerContainerRuntime.RunDebugContainer should have comment or be unexported (golint)
    • Line 170: warning: exported method DockerContainerRuntime.CreateContainer should have comment or be unexported (golint)
    • Line 199: warning: comment on exported method DockerContainerRuntime.StartContainer should be of the form "StartContainer ..." (golint)
    • Line 211: warning: exported method DockerContainerRuntime.CleanContainer should have comment or be unexported (golint)
    • Line 235: warning: exported method DockerContainerRuntime.RmContainer should have comment or be unexported (golint)
    • Line 325: warning: exported type ContainerdContainerRuntime should have comment or be unexported (golint)
    • Line 330: warning: exported var ContainerdContainerRuntimeImplementsContainerRuntime should have comment or be unexported (golint)
    • Line 332: warning: exported var PushTracker should have comment or be unexported (golint)
    • Line 363: warning: exported type StatusInfo should have comment or be unexported (golint)
    • Line 372: warning: exported function Display should have comment or be unexported (golint)
    • Line 530: warning: exported method ContainerdContainerRuntime.PullImage should have comment or be unexported (golint)
    • Line 619: warning: exported method ContainerdContainerRuntime.ContainerInfo should have comment or be unexported (golint)
    • Line 683: warning: exported function GetNetworkNamespace should have comment or be unexported (golint)
    • Line 686: warning: exported function GetIPCNamespace should have comment or be unexported (golint)
    • Line 689: warning: exported function GetUserNamespace should have comment or be unexported (golint)
    • Line 692: warning: exported function GetPIDNamespace should have comment or be unexported (golint)
    • Line 696: warning: exported method ContainerdContainerRuntime.RunDebugContainer should have comment or be unexported (golint)
    • Line 716: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 947: warning: exported var DebugAttacherImplementsAttacher should have comment or be unexported (golint)
    • Line 949: warning: comment on exported method DebugAttacher.AttachContainer should be of the form "AttachContainer ..." (golint)
    • Line 980: warning: receiver name m should be consistent with previous receiver name a for DebugAttacher (golint)
    • Line 1042: warning: exported method DebugAttacher.SetContainerLxcfs should have comment or be unexported (golint)
    • Line 1042: warning: receiver name m should be consistent with previous receiver name a for DebugAttacher (golint)
    • Line 1086: warning: exported function NewRuntimeManager should have comment or be unexported (golint)
    • Line 1154: warning: context.Context should be the first parameter of a function (golint)
    • kubectl-debug/pkg/plugin/cmd.go
    • Line 511: warning: comment on exported method DebugOptions.Run should be of the form "Run ..." (golint)
    • Line 742: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • kubectl-debug/pkg/plugin/config.go
    • Line 9: warning: exported type Config should have comment or be unexported (golint)
    • Line 36: warning: exported function Load should have comment or be unexported (golint)
    • Line 52: warning: exported function LoadFile should have comment or be unexported (golint)
    • kubectl-debug/pkg/agent/config.go
    • Line 12: warning: exported var DefaultConfig should have comment or be unexported (golint)
    • Line 26: warning: exported type Config should have comment or be unexported (golint)
    • Line 41: warning: exported function Load should have comment or be unexported (golint)
    • Line 56: warning: exported function LoadFile should have comment or be unexported (golint)
    • kubectl-debug/pkg/agent/lxcfs.go
    • Line 23: warning: comment on exported var LxcfsEnabled should be of the form "LxcfsEnabled ..." (golint)
    • Line 26: warning: comment on exported var LxcfsRootDir should be of the form "LxcfsRootDir ..." (golint)
    • Line 32: warning: comment on exported var LxcfsProcFiles should be of the form "LxcfsProcFiles ..." (golint)
    • kubectl-debug/pkg/agent/server.go
    • Line 19: warning: exported type Server should have comment or be unexported (golint)
    • Line 23: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 27: warning: exported method Server.Run should have comment or be unexported (golint)
    • Line 164: warning: exported method Server.Healthz should have comment or be unexported (golint)

gocyclo75%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • kubectl-debug/pkg/util/jsonstream.go
    • Line 46: warning: cyclomatic complexity 19 of function (*JSONProgress).String() is high (> 15) (gocyclo)
    • Line 230: warning: cyclomatic complexity 19 of function DisplayJSONMessagesStream() is high (> 15) (gocyclo)
    • Line 190: warning: cyclomatic complexity 16 of function (*JSONMessage).Display() is high (> 15) (gocyclo)
    • kubectl-debug/pkg/plugin/cmd.go
    • Line 257: warning: cyclomatic complexity 58 of function (*DebugOptions).Complete() is high (> 15) (gocyclo)
    • Line 513: warning: cyclomatic complexity 40 of function (*DebugOptions).Run() is high (> 15) (gocyclo)
    • kubectl-debug/pkg/agent/runtime.go
    • Line 696: warning: cyclomatic complexity 24 of function (*ContainerdContainerRuntime).RunDebugContainer() is high (> 15) (gocyclo)
    • Line 413: warning: cyclomatic complexity 22 of function showProgress() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!