Preparing report...

Report for github.com/cruise-automation/k-rail

A+    Excellent!    Found 38 issues across 69 files

Tweet

gofmt91%

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


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!


gocyclo92%

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.


golint52%

Golint is a linter for Go source code.

    • k-rail/policies/rolebinding/no_anonymous_role_binding.go
    • Line 25: warning: exported type PolicyNoAnonymousRoleBinding should have comment or be unexported (golint)
    • Line 27: warning: exported method PolicyNoAnonymousRoleBinding.Name should have comment or be unexported (golint)
    • Line 31: warning: exported method PolicyNoAnonymousRoleBinding.Validate should have comment or be unexported (golint)
    • k-rail/policies/ingress/require_ingress_exemption.go
    • Line 23: warning: exported type PolicyRequireIngressExemption should have comment or be unexported (golint)
    • Line 25: warning: exported method PolicyRequireIngressExemption.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicyRequireIngressExemption.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/bind_mounts.go
    • Line 23: warning: exported type PolicyBindMounts should have comment or be unexported (golint)
    • Line 25: warning: exported method PolicyBindMounts.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicyBindMounts.Validate should have comment or be unexported (golint)
    • k-rail/server/config.go
    • Line 19: warning: exported type PolicySettings should have comment or be unexported (golint)
    • Line 25: warning: exported type Config should have comment or be unexported (golint)
    • k-rail/policies/pod/mutate_default_seccomp_policy.go
    • Line 23: warning: exported type PolicyDefaultSeccompPolicy should have comment or be unexported (golint)
    • Line 25: warning: exported method PolicyDefaultSeccompPolicy.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicyDefaultSeccompPolicy.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/no_host_network.go
    • Line 23: warning: exported type PolicyNoHostNetwork should have comment or be unexported (golint)
    • Line 25: warning: exported method PolicyNoHostNetwork.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicyNoHostNetwork.Validate should have comment or be unexported (golint)
    • k-rail/policies/config.go
    • Line 48: warning: exported type MutateEmptyDirSizeLimit should have comment or be unexported (golint)
    • Line 53: warning: exported method MutateEmptyDirSizeLimit.UnmarshalJSON should have comment or be unexported (golint)
    • k-rail/policies/pod/deny_unconfined_apparmor.go
    • Line 24: warning: exported type PolicyDenyUnconfinedApparmorPolicy should have comment or be unexported (golint)
    • Line 26: warning: exported method PolicyDenyUnconfinedApparmorPolicy.Name should have comment or be unexported (golint)
    • Line 30: warning: exported method PolicyDenyUnconfinedApparmorPolicy.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/safe_to_evict.go
    • Line 23: warning: exported type PolicySafeToEvict should have comment or be unexported (golint)
    • Line 25: warning: exported method PolicySafeToEvict.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicySafeToEvict.Validate should have comment or be unexported (golint)
    • k-rail/plugins/grpc.go
    • Line 18: warning: exported method GRPCClient.PluginName should have comment or be unexported (golint)
    • Line 26: warning: exported method GRPCClient.PolicyNames should have comment or be unexported (golint)
    • Line 34: warning: exported method GRPCClient.ConfigurePlugin should have comment or be unexported (golint)
    • Line 45: warning: exported method GRPCClient.Validate should have comment or be unexported (golint)
    • Line 78: warning: comment on exported type GRPCServer should be of the form "GRPCServer ..." (with optional leading article) (golint)
    • Line 84: warning: exported method GRPCServer.PluginName should have comment or be unexported (golint)
    • Line 89: warning: exported method GRPCServer.PolicyNames should have comment or be unexported (golint)
    • Line 94: warning: exported method GRPCServer.ConfigurePlugin should have comment or be unexported (golint)
    • Line 98: warning: exported method GRPCServer.Validate should have comment or be unexported (golint)
    • k-rail/plugins/plugins.go
    • Line 17: warning: exported type Plugin should have comment or be unexported (golint)
    • Line 24: warning: exported method Plugin.Name should have comment or be unexported (golint)
    • Line 28: warning: exported method Plugin.PolicyNames should have comment or be unexported (golint)
    • Line 32: warning: exported method Plugin.Configure should have comment or be unexported (golint)
    • Line 36: warning: exported method Plugin.Kill should have comment or be unexported (golint)
    • Line 40: warning: exported method Plugin.Validate should have comment or be unexported (golint)
    • Line 50: warning: exported function NewPluginPolicy should have comment or be unexported (golint)
    • Line 54: warning: exported method PluginPolicy.Name should have comment or be unexported (golint)
    • Line 58: warning: exported method PluginPolicy.Validate should have comment or be unexported (golint)
    • Line 80: warning: comment on exported type KRailGRPCPlugin should be of the form "KRailGRPCPlugin ..." (with optional leading article) (golint)
    • Line 89: warning: exported method KRailGRPCPlugin.GRPCServer should have comment or be unexported (golint)
    • Line 94: warning: exported method KRailGRPCPlugin.GRPCClient should have comment or be unexported (golint)
    • Line 98: warning: exported function PluginsFromDirectory should have comment or be unexported (golint)
    • Line 116: warning: exported var Handshake should have comment or be unexported (golint)
    • Line 122: warning: exported const GRPCPluginName should have comment or be unexported (golint)
    • Line 128: warning: exported function LaunchPluginProcess should have comment or be unexported (golint)
    • k-rail/policies/pod/empty_dir_size_limit.go
    • Line 24: warning: exported type PolicyEmptyDirSizeLimit should have comment or be unexported (golint)
    • Line 27: warning: exported method PolicyEmptyDirSizeLimit.Name should have comment or be unexported (golint)
    • Line 33: warning: exported method PolicyEmptyDirSizeLimit.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/immutable_image_digest.go
    • Line 28: warning: exported type PolicyImageImmutableReference should have comment or be unexported (golint)
    • Line 30: warning: exported method PolicyImageImmutableReference.Name should have comment or be unexported (golint)
    • Line 34: warning: exported method PolicyImageImmutableReference.Validate should have comment or be unexported (golint)
    • k-rail/policies/service/require_service_loadbalancer_exemption.go
    • Line 27: warning: exported type PolicyRequireServiceLoadbalancerExemption should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicyRequireServiceLoadbalancerExemption.Name should have comment or be unexported (golint)
    • Line 33: warning: exported method PolicyRequireServiceLoadbalancerExemption.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/trusted_repository.go
    • Line 26: warning: exported type PolicyTrustedRepository should have comment or be unexported (golint)
    • Line 28: warning: exported method PolicyTrustedRepository.Name should have comment or be unexported (golint)
    • Line 32: warning: exported method PolicyTrustedRepository.Validate should have comment or be unexported (golint)
    • k-rail/policies/persistentVolume/no_persistent_volume_host.go
    • Line 13: warning: don't use MixedCaps in package name; persistentVolume should be persistentvolume (golint)
    • Line 24: warning: exported type PolicyNoPersistentVolumeHost should have comment or be unexported (golint)
    • Line 26: warning: exported method PolicyNoPersistentVolumeHost.Name should have comment or be unexported (golint)
    • Line 30: warning: exported method PolicyNoPersistentVolumeHost.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/no_exec.go
    • Line 23: warning: exported type PolicyNoExec should have comment or be unexported (golint)
    • Line 25: warning: exported method PolicyNoExec.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicyNoExec.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/no_host_pid.go
    • Line 23: warning: exported type PolicyNoHostPID should have comment or be unexported (golint)
    • Line 25: warning: exported method PolicyNoHostPID.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicyNoHostPID.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/no_tiller.go
    • Line 26: warning: exported type PolicyNoTiller should have comment or be unexported (golint)
    • Line 28: warning: exported method PolicyNoTiller.Name should have comment or be unexported (golint)
    • Line 32: warning: exported method PolicyNoTiller.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/mutate_safe_to_evict.go
    • Line 23: warning: exported type PolicyMutateSafeToEvict should have comment or be unexported (golint)
    • Line 25: warning: exported method PolicyMutateSafeToEvict.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicyMutateSafeToEvict.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/no_new_capabilities.go
    • Line 25: warning: exported type PolicyNoNewCapabilities should have comment or be unexported (golint)
    • Line 27: warning: exported method PolicyNoNewCapabilities.Name should have comment or be unexported (golint)
    • Line 31: warning: exported method PolicyNoNewCapabilities.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/no_privileged_container.go
    • Line 25: warning: exported type PolicyNoPrivilegedContainer should have comment or be unexported (golint)
    • Line 27: warning: exported method PolicyNoPrivilegedContainer.Name should have comment or be unexported (golint)
    • Line 31: warning: exported method PolicyNoPrivilegedContainer.Validate should have comment or be unexported (golint)
    • k-rail/policies/ingress/unique_ingress_host.go
    • Line 27: warning: exported function NewPolicyRequireUniqueHost should have comment or be unexported (golint)
    • Line 43: warning: exported type PolicyRequireUniqueHost should have comment or be unexported (golint)
    • Line 47: warning: exported method PolicyRequireUniqueHost.Name should have comment or be unexported (golint)
    • Line 51: warning: exported method PolicyRequireUniqueHost.CheckIngressNamespaces should have comment or be unexported (golint)
    • Line 69: warning: exported function Find should have comment or be unexported (golint)
    • Line 78: warning: exported method PolicyRequireUniqueHost.Validate should have comment or be unexported (golint)
    • Line 102: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 130: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • k-rail/plugins/examples/example.go
    • Line 19: warning: comment on exported type ExamplePlugin should be of the form "ExamplePlugin ..." (with optional leading article) (golint)
    • Line 26: warning: exported type Config should have comment or be unexported (golint)
    • Line 30: warning: exported method ExamplePlugin.PluginName should have comment or be unexported (golint)
    • Line 34: warning: exported method ExamplePlugin.RegisterPolicy should have comment or be unexported (golint)
    • Line 38: warning: exported method ExamplePlugin.PolicyNames should have comment or be unexported (golint)
    • Line 40: warning: should omit 2nd value from range; this loop is equivalent to `for name := range ...` (golint)
    • Line 46: warning: exported method ExamplePlugin.ConfigurePlugin should have comment or be unexported (golint)
    • Line 56: warning: exported method ExamplePlugin.Validate should have comment or be unexported (golint)
    • Line 64: warning: comment on exported type Policy should be of the form "Policy ..." (with optional leading article) (golint)
    • Line 73: warning: exported type ThresholdPolicy should have comment or be unexported (golint)
    • Line 75: warning: exported method ThresholdPolicy.Name should have comment or be unexported (golint)
    • Line 79: warning: exported method ThresholdPolicy.Validate should have comment or be unexported (golint)
    • k-rail/policies/service/service_no_externalip.go
    • Line 24: warning: exported type PolicyServiceNoExternalIP should have comment or be unexported (golint)
    • Line 26: warning: exported method PolicyServiceNoExternalIP.Name should have comment or be unexported (golint)
    • Line 30: warning: exported method PolicyServiceNoExternalIP.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/docker_sock.go
    • Line 23: warning: exported type PolicyDockerSock should have comment or be unexported (golint)
    • Line 25: warning: exported method PolicyDockerSock.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicyDockerSock.Validate should have comment or be unexported (golint)
    • k-rail/policies/pod/no_shareprocessnamespace.go
    • Line 23: warning: exported type PolicyNoShareProcessNamespace should have comment or be unexported (golint)
    • Line 25: warning: exported method PolicyNoShareProcessNamespace.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method PolicyNoShareProcessNamespace.Validate should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!