Preparing report...

Report for github.com/smartxworks/kopilot

A+    Excellent!    Found 8 issues across 34 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!


gocyclo100%

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.

No problems detected. Good job!


golint79%

Golint is a linter for Go source code.

    • kopilot/pkg/hub/k8s/repos.go
    • Line 31: warning: exported type ClusterRepository should have comment or be unexported (golint)
    • Line 37: warning: exported function NewClusterRepository should have comment or be unexported (golint)
    • Line 43: warning: exported method ClusterRepository.MapClusterToken should have comment or be unexported (golint)
    • kopilot/pkg/hub/k8s/webhook.go
    • Line 36: warning: exported function ServeWebhook should have comment or be unexported (golint)
    • Line 60: warning: exported type ClusterDefaulter should have comment or be unexported (golint)
    • Line 66: warning: exported method ClusterDefaulter.InjectDecoder should have comment or be unexported (golint)
    • Line 71: warning: exported method ClusterDefaulter.Handle should have comment or be unexported (golint)
    • Line 90: warning: exported type ClusterValidator should have comment or be unexported (golint)
    • Line 96: warning: exported method ClusterValidator.InjectDecoder should have comment or be unexported (golint)
    • Line 101: warning: exported method ClusterValidator.Handle should have comment or be unexported (golint)
    • kopilot/pkg/hub/handlers.go
    • Line 21: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 35: warning: exported type ClusterConnectHandler should have comment or be unexported (golint)
    • Line 44: warning: exported function NewClusterConnectHandler should have comment or be unexported (golint)
    • Line 83: warning: exported method ClusterConnectHandler.AddCallbacks should have comment or be unexported (golint)
    • Line 99: warning: exported type ClusterTokenMapper should have comment or be unexported (golint)
    • Line 103: warning: exported type ClusterConnectHandlerCallback should have comment or be unexported (golint)
    • Line 107: warning: exported type ClusterProxy should have comment or be unexported (golint)
    • Line 111: warning: exported function NewClusterProxy should have comment or be unexported (golint)
    • Line 117: warning: exported method ClusterProxy.Proxy should have comment or be unexported (golint)
    • Line 134: warning: exported type ClusterDialer should have comment or be unexported (golint)
    • Line 138: warning: exported type ClusterSessionManager should have comment or be unexported (golint)
    • Line 146: warning: exported function NewClusterSessionManager should have comment or be unexported (golint)
    • Line 152: warning: exported method ClusterSessionManager.OnNewClusterSession should have comment or be unexported (golint)
    • Line 164: warning: exported method ClusterSessionManager.DialCluster should have comment or be unexported (golint)
    • Line 175: warning: comment on exported var AgentYAMLTemplate should be of the form "AgentYAMLTemplate ..." (golint)
    • Line 178: warning: exported type AgentYAMLHandler should have comment or be unexported (golint)
    • Line 185: warning: exported function NewAgentYAMLHandler should have comment or be unexported (golint)
    • kopilot/pkg/hub/inmem/repos.go
    • Line 25: warning: exported type Cluster should have comment or be unexported (golint)
    • Line 30: warning: exported type ClusterRepository should have comment or be unexported (golint)
    • Line 36: warning: exported function NewClusterRepository should have comment or be unexported (golint)
    • Line 42: warning: exported method ClusterRepository.MapClusterToken should have comment or be unexported (golint)
    • kopilot/pkg/hub/k8s/apis/kopilot/v1alpha1/register.go
    • Line 27: warning: exported var SchemeGroupVersion should have comment or be unexported (golint)
    • Line 29: warning: exported function Kind should have comment or be unexported (golint)
    • Line 33: warning: exported function Resource should have comment or be unexported (golint)
    • Line 38: warning: exported var SchemeBuilder should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.

    • kopilot/pkg/hub/handlers_test.go
    • Line 19: warning: no required module provides package github.com/smartxworks/kopilot/pkg/hub/mock; to add it: (ineffassign)
    • Line 19: warning: could not import github.com/smartxworks/kopilot/pkg/hub/mock (invalid package name: "") (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!