Preparing report...

Report for github.com/longhorn/longhorn-instance-manager

A    Great!    Found 22 issues across 20 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!


golint15%

Golint is a linter for Go source code.

    • longhorn-instance-manager/pkg/util/bitmap.go
    • Line 10: warning: exported type Bitmap should have comment or be unexported (golint)
    • Line 32: warning: exported method Bitmap.AllocateRange should have comment or be unexported (golint)
    • Line 72: warning: exported method Bitmap.ReleaseRange should have comment or be unexported (golint)
    • longhorn-instance-manager/pkg/process/command.go
    • Line 11: warning: exported type Executor should have comment or be unexported (golint)
    • Line 15: warning: exported type Command should have comment or be unexported (golint)
    • Line 24: warning: exported type BinaryExecutor should have comment or be unexported (golint)
    • Line 26: warning: exported method BinaryExecutor.NewCommand should have comment or be unexported (golint)
    • Line 30: warning: exported type BinaryCommand should have comment or be unexported (golint)
    • Line 35: warning: exported function NewBinaryCommand should have comment or be unexported (golint)
    • Line 58: warning: exported method BinaryCommand.SetOutput should have comment or be unexported (golint)
    • Line 65: warning: exported method BinaryCommand.Started should have comment or be unexported (golint)
    • Line 71: warning: exported method BinaryCommand.StopWithSignal should have comment or be unexported (golint)
    • Line 79: warning: exported method BinaryCommand.Stop should have comment or be unexported (golint)
    • Line 87: warning: exported method BinaryCommand.Kill should have comment or be unexported (golint)
    • Line 95: warning: exported type MockExecutor should have comment or be unexported (golint)
    • Line 97: warning: exported method MockExecutor.NewCommand should have comment or be unexported (golint)
    • Line 101: warning: exported type MockCommand should have comment or be unexported (golint)
    • Line 113: warning: exported function NewMockCommand should have comment or be unexported (golint)
    • Line 127: warning: exported method MockCommand.Run should have comment or be unexported (golint)
    • Line 135: warning: exported method MockCommand.SetOutput should have comment or be unexported (golint)
    • Line 138: warning: exported method MockCommand.Started should have comment or be unexported (golint)
    • Line 144: warning: exported method MockCommand.Stop should have comment or be unexported (golint)
    • Line 152: warning: exported method MockCommand.StopWithSignal should have comment or be unexported (golint)
    • Line 156: warning: exported method MockCommand.Kill should have comment or be unexported (golint)
    • longhorn-instance-manager/pkg/process/process_manager.go
    • Line 29: warning: exported type Manager should have comment or be unexported (golint)
    • Line 49: warning: exported function NewManager should have comment or be unexported (golint)
    • Line 107: warning: exported method Manager.Shutdown should have comment or be unexported (golint)
    • Line 261: warning: exported method Manager.ProcessList should have comment or be unexported (golint)
    • Line 274: warning: exported method Manager.ProcessLog should have comment or be unexported (golint)
    • Line 300: warning: exported method Manager.Subscribe should have comment or be unexported (golint)
    • Line 304: warning: exported method Manager.ProcessWatch should have comment or be unexported (golint)
    • Line 353: warning: exported function ParsePortRange should have comment or be unexported (golint)
    • longhorn-instance-manager/pkg/types/types.go
    • Line 8: warning: exported const GRPCServiceTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported var WaitInterval should have comment or be unexported (golint)
    • Line 23: warning: exported const RetryInterval should have comment (or a comment on this block) or be unexported (golint)
    • longhorn-instance-manager/pkg/meta/version.go
    • Line 6: warning: exported const InstanceManagerAPIMinVersion should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported type VersionOutput should have comment or be unexported (golint)
    • Line 25: warning: exported function GetVersion should have comment or be unexported (golint)
    • longhorn-instance-manager/pkg/api/types.go
    • Line 12: warning: exported type Process should have comment or be unexported (golint)
    • Line 24: warning: exported function RPCToProcess should have comment or be unexported (golint)
    • Line 35: warning: exported function RPCToProcessList should have comment or be unexported (golint)
    • Line 43: warning: exported type ProcessStatus should have comment or be unexported (golint)
    • Line 50: warning: exported function RPCToProcessStatus should have comment or be unexported (golint)
    • Line 59: warning: exported type ProcessStream should have comment or be unexported (golint)
    • Line 65: warning: exported function NewProcessStream should have comment or be unexported (golint)
    • Line 73: warning: exported method ProcessStream.Close should have comment or be unexported (golint)
    • Line 81: warning: exported method ProcessStream.Recv should have comment or be unexported (golint)
    • Line 89: warning: exported function NewLogStream should have comment or be unexported (golint)
    • Line 97: warning: exported type LogStream should have comment or be unexported (golint)
    • Line 103: warning: exported method LogStream.Close should have comment or be unexported (golint)
    • Line 111: warning: exported method LogStream.Recv should have comment or be unexported (golint)
    • longhorn-instance-manager/pkg/util/util.go
    • Line 18: warning: exported const DefaulCmdTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported function Execute should have comment or be unexported (golint)
    • Line 27: warning: exported function ExecuteWithTimeout should have comment or be unexported (golint)
    • Line 61: warning: exported function PrintJSON should have comment or be unexported (golint)
    • Line 71: warning: exported function GetURL should have comment or be unexported (golint)
    • Line 75: warning: exported function RemoveFile should have comment or be unexported (golint)
    • Line 88: warning: exported function GRPCServiceReadinessProbe should have comment or be unexported (golint)
    • Line 95: warning: exported function Now should have comment or be unexported (golint)
    • Line 99: warning: exported function UUID should have comment or be unexported (golint)
    • longhorn-instance-manager/pkg/process/healthchecker.go
    • Line 12: warning: exported type HealthChecker should have comment or be unexported (golint)
    • Line 17: warning: exported type GRPCHealthChecker should have comment or be unexported (golint)
    • Line 19: warning: exported method GRPCHealthChecker.IsRunning should have comment or be unexported (golint)
    • Line 23: warning: exported method GRPCHealthChecker.WaitForRunning should have comment or be unexported (golint)
    • Line 42: warning: exported type MockHealthChecker should have comment or be unexported (golint)
    • Line 44: warning: exported method MockHealthChecker.IsRunning should have comment or be unexported (golint)
    • Line 48: warning: exported method MockHealthChecker.WaitForRunning should have comment or be unexported (golint)
    • longhorn-instance-manager/pkg/process/process.go
    • Line 15: warning: exported type State should have comment or be unexported (golint)
    • Line 18: warning: exported const StateStarting should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type Process should have comment or be unexported (golint)
    • Line 48: warning: exported method Process.Start should have comment or be unexported (golint)
    • Line 118: warning: exported method Process.RPCResponse should have comment or be unexported (golint)
    • Line 142: warning: exported method Process.Stop should have comment or be unexported (golint)
    • Line 146: warning: exported method Process.StopWithSignal should have comment or be unexported (golint)
    • Line 191: warning: exported method Process.IsStopped should have comment or be unexported (golint)
    • longhorn-instance-manager/pkg/health/health_probe.go
    • Line 14: warning: exported type CheckServer should have comment or be unexported (golint)
    • Line 18: warning: exported function NewHealthCheckServer should have comment or be unexported (golint)
    • Line 24: warning: exported method CheckServer.Check should have comment or be unexported (golint)
    • Line 36: warning: exported method CheckServer.Watch should have comment or be unexported (golint)
    • longhorn-instance-manager/pkg/client/process_manager.go
    • Line 17: warning: exported type ProcessManagerClient should have comment or be unexported (golint)
    • Line 21: warning: exported function NewProcessManagerClient should have comment or be unexported (golint)
    • Line 27: warning: exported method ProcessManagerClient.ProcessCreate should have comment or be unexported (golint)
    • Line 57: warning: exported method ProcessManagerClient.ProcessDelete should have comment or be unexported (golint)
    • Line 81: warning: exported method ProcessManagerClient.ProcessGet should have comment or be unexported (golint)
    • Line 105: warning: exported method ProcessManagerClient.ProcessList should have comment or be unexported (golint)
    • Line 123: warning: exported method ProcessManagerClient.ProcessLog should have comment or be unexported (golint)
    • Line 144: warning: exported method ProcessManagerClient.ProcessWatch should have comment or be unexported (golint)
    • Line 162: warning: exported method ProcessManagerClient.ProcessReplace should have comment or be unexported (golint)
    • Line 196: warning: exported method ProcessManagerClient.VersionGet should have comment or be unexported (golint)
    • longhorn-instance-manager/app/cmd/process.go
    • Line 13: warning: exported function ProcessCmd should have comment or be unexported (golint)
    • Line 26: warning: exported function ProcessCreateCmd should have comment or be unexported (golint)
    • Line 64: warning: exported function ProcessDeleteCmd should have comment or be unexported (golint)
    • Line 91: warning: exported function ProcessGetCmd should have comment or be unexported (golint)
    • Line 118: warning: exported function ProcessListCmd should have comment or be unexported (golint)
    • Line 141: warning: exported function ProcessReplaceCmd should have comment or be unexported (golint)
    • longhorn-instance-manager/pkg/util/log.go
    • Line 14: warning: exported const LogComponentField should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type LonghornFormatter should have comment or be unexported (golint)
    • Line 25: warning: exported type LonghornWriter should have comment or be unexported (golint)
    • Line 31: warning: exported function NewLonghornWriter should have comment or be unexported (golint)
    • Line 48: warning: exported function SetUpLogger should have comment or be unexported (golint)
    • Line 70: warning: exported method LonghornFormatter.Format should have comment or be unexported (golint)
    • Line 94: warning: exported method LonghornWriter.Close should have comment or be unexported (golint)
    • Line 101: warning: exported method LonghornWriter.StreamLog should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign45%

IneffAssign detects ineffectual assignments in Go code.

    • longhorn-instance-manager/pkg/api/types.go
    • Line 9: warning: cannot find module providing package github.com/longhorn/longhorn-instance-manager/pkg/rpc: import lookup disabled by -mod=readonly (ineffassign)
    • Line 9: warning: could not import github.com/longhorn/longhorn-instance-manager/pkg/rpc (invalid package name: "") (ineffassign)
    • Line 9: warning: cannot find module providing package github.com/longhorn/longhorn-instance-manager/pkg/rpc: import lookup disabled by -mod=readonly (ineffassign)
    • Line 4: warning: could not import context (no metadata for context) (ineffassign)
    • Line 6: warning: could not import github.com/pkg/errors (no metadata for github.com/pkg/errors) (ineffassign)
    • Line 7: warning: could not import google.golang.org/grpc (no metadata for google.golang.org/grpc) (ineffassign)
    • Line 9: warning: could not import github.com/longhorn/longhorn-instance-manager/pkg/rpc (no metadata for github.com/longhorn/longhorn-instance-manager/pkg/rpc) (ineffassign)
    • Line 24: warning: undeclared name: rpc (ineffassign)
    • Line 35: warning: undeclared name: rpc (ineffassign)
    • Line 50: warning: undeclared name: rpc (ineffassign)
    • Line 62: warning: undeclared name: rpc (ineffassign)
    • Line 65: warning: undeclared name: rpc (ineffassign)
    • Line 89: warning: undeclared name: rpc (ineffassign)
    • Line 100: warning: undeclared name: rpc (ineffassign)
    • longhorn-instance-manager/pkg/process/process.go
    • Line 10: warning: cannot find module providing package github.com/longhorn/longhorn-instance-manager/pkg/rpc: import lookup disabled by -mod=readonly (ineffassign)
    • Line 10: warning: could not import github.com/longhorn/longhorn-instance-manager/pkg/rpc (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/longhorn/longhorn-instance-manager/pkg/rpc (invalid package name: "") (ineffassign)
    • Line 118: warning: undeclared name: rpc (ineffassign)
    • /home/shawn/mygo/src/github.com/gojp/goreportcard/_repos/src/github.com/longhorn/longhorn-instance-manager/pkg/api/types.go
    • Line 9: warning: cannot find module providing package github.com/longhorn/longhorn-instance-manager/pkg/rpc: import lookup disabled by -mod=readonly (ineffassign)
    • Line 9: warning: could not import github.com/longhorn/longhorn-instance-manager/pkg/rpc (invalid package name: "") (ineffassign)
    • Line 9: warning: cannot find module providing package github.com/longhorn/longhorn-instance-manager/pkg/rpc: import lookup disabled by -mod=readonly (ineffassign)
    • Line 4: warning: could not import context (no metadata for context) (ineffassign)
    • Line 6: warning: could not import github.com/pkg/errors (no metadata for github.com/pkg/errors) (ineffassign)
    • Line 7: warning: could not import google.golang.org/grpc (no metadata for google.golang.org/grpc) (ineffassign)
    • Line 9: warning: could not import github.com/longhorn/longhorn-instance-manager/pkg/rpc (no metadata for github.com/longhorn/longhorn-instance-manager/pkg/rpc) (ineffassign)
    • Line 24: warning: undeclared name: rpc (ineffassign)
    • Line 35: warning: undeclared name: rpc (ineffassign)
    • Line 50: warning: undeclared name: rpc (ineffassign)
    • Line 62: warning: undeclared name: rpc (ineffassign)
    • Line 65: warning: undeclared name: rpc (ineffassign)
    • Line 89: warning: undeclared name: rpc (ineffassign)
    • Line 100: warning: undeclared name: rpc (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!