Preparing report...

Report for github.com/openebs/maya

A+    Excellent!    Found 115 issues across 856 files

Tweet

gofmt97%

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!


gocyclo97%

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.

    • maya/pkg/task/task.go
    • Line 447: warning: cyclomatic complexity 56 of function (*executor).ExecuteIt() is high (> 15) (gocyclo)
    • Line 1630: warning: cyclomatic complexity 19 of function (*executor).listK8sResources() is high (> 15) (gocyclo)
    • maya/types/v1/quantity.go
    • Line 274: warning: cyclomatic complexity 34 of function ParseQuantity() is high (> 15) (gocyclo)
    • Line 157: warning: cyclomatic complexity 28 of function parseQuantityString() is high (> 15) (gocyclo)

golint93%

Golint is a linter for Go source code.

    • maya/pkg/client/http/v1alpha1/http_client.go
    • Line 28: warning: should not use dot imports (golint)
    • Line 35: warning: exported const DeleteAction should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: comment on exported type Rest should be of the form "Rest ..." (with optional leading article) (golint)
    • Line 74: warning: exported method Rest.WithName should have comment or be unexported (golint)
    • Line 79: warning: exported method Rest.WithVerb should have comment or be unexported (golint)
    • Line 84: warning: exported method Rest.WithBody should have comment or be unexported (golint)
    • Line 89: warning: exported method Rest.Do should have comment or be unexported (golint)
    • maya/pkg/client/jiva/model.go
    • Line 38: warning: exported type Volumes should have comment or be unexported (golint)
    • Line 45: warning: exported type VolumeCollection should have comment or be unexported (golint)
    • Line 50: warning: exported type Replica should have comment or be unexported (golint)
    • Line 56: warning: exported type InfoReplica should have comment or be unexported (golint)
    • Line 71: warning: exported type DiskInfo should have comment or be unexported (golint)
    • Line 81: warning: exported type ReplicaCollection should have comment or be unexported (golint)
    • Line 86: warning: exported type MarkDiskAsRemovedInput should have comment or be unexported (golint)
    • Line 99: warning: exported type ControllerClient should have comment or be unexported (golint)
    • Line 105: warning: exported type RevertInput should have comment or be unexported (golint)
    • Line 120: warning: exported type SnapshotOutput should have comment or be unexported (golint)
    • Line 124: warning: exported type Resource should have comment or be unexported (golint)
    • Line 131: warning: exported type Collection should have comment or be unexported (golint)
    • Line 143: warning: exported type Sort should have comment or be unexported (golint)
    • Line 149: warning: exported type Condition should have comment or be unexported (golint)
    • Line 154: warning: exported type Pagination should have comment or be unexported (golint)
    • Line 164: warning: exported function Filter should have comment or be unexported (golint)
    • Line 174: warning: exported function Contains should have comment or be unexported (golint)
    • maya/pkg/client/k8s/v1alpha1/node.go
    • Line 38: warning: exported function Node should have comment or be unexported (golint)
    • Line 47: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 57: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 68: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • maya/tests/artifacts/openebs-ci.go
    • Line 30: warning: exported type Artifact should have comment or be unexported (golint)
    • Line 33: warning: exported const OpenEBSArtifacts should have comment (or a comment on this block) or be unexported (golint)
    • Line 61: warning: exported const MayaAPIServerLabelSelector should have comment (or a comment on this block) or be unexported (golint)
    • maya/pkg/client/k8s/v1alpha1/namespace.go
    • Line 27: warning: comment on exported type NamespaceGetter should be of the form "NamespaceGetter ..." (with optional leading article) (golint)
    • Line 48: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 58: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • maya/pkg/msg/v1alpha1/msg.go
    • Line 36: warning: exported type MsgType should have comment or be unexported (golint)
    • Line 39: warning: exported const InfoMsg should have comment (or a comment on this block) or be unexported (golint)
    • Line 64: warning: exported function IsInfo should have comment or be unexported (golint)
    • Line 71: warning: exported function IsWarn should have comment or be unexported (golint)
    • Line 78: warning: exported function IsSkip should have comment or be unexported (golint)
    • Line 85: warning: exported function IsNotInfo should have comment or be unexported (golint)
    • Line 89: warning: exported function IsErr should have comment or be unexported (golint)
    • Line 96: warning: exported function IsNotErr should have comment or be unexported (golint)
    • Line 115: warning: exported method Msgs.Filter should have comment or be unexported (golint)
    • Line 127: warning: exported method Msgs.Log should have comment or be unexported (golint)
    • Line 136: warning: exported method Msgs.LogNonInfos should have comment or be unexported (golint)
    • Line 140: warning: exported method Msgs.LogNonErrors should have comment or be unexported (golint)
    • Line 144: warning: exported method Msgs.LogErrors should have comment or be unexported (golint)
    • Line 148: warning: exported method Msgs.AddInfo should have comment or be unexported (golint)
    • Line 156: warning: exported method Msgs.AddWarn should have comment or be unexported (golint)
    • Line 164: warning: exported method Msgs.AddSkip should have comment or be unexported (golint)
    • Line 172: warning: exported method Msgs.AddError should have comment or be unexported (golint)
    • Line 180: warning: exported method Msgs.Merge should have comment or be unexported (golint)
    • Line 194: warning: exported method Msgs.Infos should have comment or be unexported (golint)
    • Line 198: warning: exported method Msgs.NonInfos should have comment or be unexported (golint)
    • Line 202: warning: exported method Msgs.Errors should have comment or be unexported (golint)
    • Line 206: warning: exported method Msgs.HasError should have comment or be unexported (golint)
    • Line 210: warning: exported method Msgs.NonErrors should have comment or be unexported (golint)
    • Line 214: warning: exported method Msgs.Skips should have comment or be unexported (golint)
    • Line 218: warning: exported method Msgs.Warns should have comment or be unexported (golint)
    • Line 222: warning: exported method Msgs.HasWarn should have comment or be unexported (golint)
    • Line 251: warning: exported method AllMsgs.HasError should have comment or be unexported (golint)
    • Line 259: warning: exported method AllMsgs.HasWarn should have comment or be unexported (golint)
    • Line 267: warning: exported method AllMsgs.HasSkip should have comment or be unexported (golint)
    • Line 275: warning: exported method AllMsgs.HasInfo should have comment or be unexported (golint)
    • Line 283: warning: exported method AllMsgs.IsEmpty should have comment or be unexported (golint)
    • Line 295: warning: exported method AllMsgs.ToMsgs should have comment or be unexported (golint)
    • Line 323: warning: exported method Msgs.AllMsgs should have comment or be unexported (golint)
    • maya/pkg/cstor/pool/v1alpha1/cstorpool.go
    • Line 44: warning: exported type CStorPool should have comment or be unexported (golint)
    • Line 49: warning: exported type CStorPoolList should have comment or be unexported (golint)
    • Line 64: warning: comment on exported type CstorpoolInterface should be of the form "CstorpoolInterface ..." (with optional leading article) (golint)
    • maya/pkg/client/k8s/k8s.go
    • Line 103: warning: comment on exported const CStorPoolCRKK should be of the form "CStorPoolCRKK ..." (golint)
    • Line 112: warning: comment on exported const CStorVolumeCRKK should be of the form "CStorVolumeCRKK ..." (golint)
    • Line 115: warning: comment on exported const CStorVolumeReplicaCRKK should be of the form "CStorVolumeReplicaCRKK ..." (golint)
    • Line 152: warning: exported const BatchV1KA should have comment (or a comment on this block) or be unexported (golint)
    • maya/cmd/mayactl/app/command/completion.go
    • Line 60: warning: exported function RunCompletion should have comment or be unexported (golint)
    • Line 80: warning: exported function RunCompletionBash should have comment or be unexported (golint)
    • Line 84: warning: exported function RunCompletionZsh should have comment or be unexported (golint)
    • Line 85: warning: don't use underscores in Go names; var zsh_initialization should be zshInitialization (golint)
    • Line 187: warning: don't use underscores in Go names; var zsh_tail should be zshTail (golint)
    • maya/pkg/util/iscsi.go
    • Line 15: warning: package comment should be of the form "Package util ..." (golint)
    • Line 25: warning: exported const IstgtConfPath should have comment (or a comment on this block) or be unexported (golint)
    • Line 37: warning: exported function CheckForIscsi should have comment or be unexported (golint)
    • maya/cmd/cstor-pool-mgmt/volumereplica/volumereplica.go
    • Line 327: warning: exported function SetTargetIp should have comment or be unexported (golint)
    • Line 340: warning: exported function GetTargetIp should have comment or be unexported (golint)
    • Line 785: warning: should omit 2nd value from range; this loop is equivalent to `for snapName := range ...` (golint)
    • Line 851: warning: should omit 2nd value from range; this loop is equivalent to `for snapName := range ...` (golint)
    • Line 878: warning: should omit 2nd value from range; this loop is equivalent to `for snapName := range ...` (golint)
    • Line 895: warning: should omit 2nd value from range; this loop is equivalent to `for snapName := range ...` (golint)
    • Line 903: warning: should omit 2nd value from range; this loop is equivalent to `for snapName := range ...` (golint)
    • maya/pkg/usage/const.go
    • Line 1: warning: package comment should be of the form "Package usage ..." (golint)
    • Line 24: warning: comment on exported const InstallEvent should be of the form "InstallEvent ..." (golint)
    • Line 32: warning: exported const AppName should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: comment on exported const RunningStatus should be of the form "RunningStatus ..." (golint)
    • Line 39: warning: comment on exported const Replica should be of the form "Replica ..." (golint)
    • Line 43: warning: comment on exported const DefaultCASType should be of the form "DefaultCASType ..." (golint)
    • maya/pkg/usage/ping.go
    • Line 25: warning: exported var OpenEBSPingPeriod should have comment or be unexported (golint)
    • Line 42: warning: should omit values from range; this loop is equivalent to `for range ...` (golint)
    • Line 60: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • maya/cmd/maya-apiserver/app/config/config.go
    • Line 150: warning: receiver name mc should be consistent with previous receiver name c for MayaConfig (golint)
    • Line 174: warning: receiver name mc should be consistent with previous receiver name c for MayaConfig (golint)
    • Line 251: warning: receiver name mc should be consistent with previous receiver name c for MayaConfig (golint)
    • maya/tests/operations.go
    • Line 25: warning: should not use dot imports (golint)
    • Line 26: warning: should not use dot imports (golint)
    • Line 1245: warning: exported method Operations.BuildAndDeployBusyBoxPod should have comment or be unexported (golint)
    • maya/pkg/usage/usage.go
    • Line 1: warning: package comment should be of the form "Package usage ..." (golint)
    • Line 207: warning: comment on exported method Usage.ApplicationBuilder should be of the form "ApplicationBuilder ..." (golint)
    • Line 226: warning: comment on exported method Usage.SetVolumeType should be of the form "SetVolumeType ..." (golint)
    • Line 237: warning: comment on exported method Usage.SetReplicaCount should be of the form "SetReplicaCount ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell0%

Misspell Finds commonly misspelled English words

An error occurred while running this test (exit status 3)