Preparing report...

Report for github.com/cloud-barista/cb-ladybug

A    Great!    Found 34 issues across 37 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!


gocyclo94%

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.


golint10%

Golint is a linter for Go source code.

    • cb-ladybug/src/utils/lang/functions.go
    • Line 33: warning: comment on exported function GetStoreClusterKey should be of the form "GetStoreClusterKey ..." (golint)
    • Line 37: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 42: warning: comment on exported function GetStoreNodeKey should be of the form "GetStoreNodeKey ..." (golint)
    • Line 46: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 51: warning: comment on exported function GetUid should be of the form "GetUid ..." (golint)
    • Line 56: warning: comment on exported function GetRandomString should be of the form "GetRandomString ..." (golint)
    • Line 73: warning: comment on exported function GetNodeName should be of the form "GetNodeName ..." (golint)
    • Line 78: warning: exported function GetIdxToInt should have comment or be unexported (golint)
    • Line 86: warning: exported function GetMaxNumber should have comment or be unexported (golint)
    • cb-ladybug/src/core/service/common.go
    • Line 12: warning: exported type NodeConfigInfo should have comment or be unexported (golint)
    • Line 20: warning: exported function SetNodeConfigInfos should have comment or be unexported (golint)
    • Line 27: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 30: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 40: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 43: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 62: warning: exported function GetControlPlaneIPs should have comment or be unexported (golint)
    • cb-ladybug/src/core/model/request.go
    • Line 3: warning: exported type ClusterReq should have comment or be unexported (golint)
    • Line 10: warning: exported type NodeReq should have comment or be unexported (golint)
    • Line 15: warning: exported type NodeConfig should have comment or be unexported (golint)
    • Line 21: warning: exported type Config should have comment or be unexported (golint)
    • Line 25: warning: exported type Kubernetes should have comment or be unexported (golint)
    • cb-ladybug/src/core/model/types.go
    • Line 4: warning: exported const KIND_STATUS should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported type Model should have comment or be unexported (golint)
    • Line 15: warning: exported type ListModel should have comment or be unexported (golint)
    • cb-ladybug/src/core/model/spider/connection.go
    • Line 12: warning: comment on exported type Connection should be of the form "Connection ..." (with optional leading article) (golint)
    • Line 22: warning: exported function NewConnection should have comment or be unexported (golint)
    • Line 29: warning: comment on exported method Connection.GET should be of the form "GET ..." (golint)
    • Line 30: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/core/model/tumblebug/base.go
    • Line 18: warning: exported type KeyValue should have comment or be unexported (golint)
    • Line 23: warning: exported type Model should have comment or be unexported (golint)
    • Line 28: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 80: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 85: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 92: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 96: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • cb-ladybug/src/core/service/node.go
    • Line 20: warning: exported function ListNode should have comment or be unexported (golint)
    • Line 30: warning: exported function GetNode should have comment or be unexported (golint)
    • Line 40: warning: exported function AddNode should have comment or be unexported (golint)
    • Line 215: warning: exported function RemoveNode should have comment or be unexported (golint)
    • Line 294: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 315: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 346: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • cb-ladybug/src/core/model/status.go
    • Line 4: warning: exported const STATUS_UNKNOWN should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported type Status should have comment or be unexported (golint)
    • Line 17: warning: exported function NewStatus should have comment or be unexported (golint)
    • cb-ladybug/src/core/model/spider/region.go
    • Line 12: warning: exported type Region should have comment or be unexported (golint)
    • Line 19: warning: exported type KeyValue should have comment or be unexported (golint)
    • Line 24: warning: exported function NewRegion should have comment or be unexported (golint)
    • Line 31: warning: comment on exported method Region.GET should be of the form "GET ..." (golint)
    • Line 32: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/core/model/tumblebug/image.go
    • Line 11: warning: exported type Image should have comment or be unexported (golint)
    • Line 23: warning: exported function NewImage should have comment or be unexported (golint)
    • Line 34: warning: exported method Image.GET should have comment or be unexported (golint)
    • Line 34: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 39: warning: exported method Image.POST should have comment or be unexported (golint)
    • Line 39: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 48: warning: exported method Image.DELETE should have comment or be unexported (golint)
    • Line 48: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/rest-api/router/cluster.go
    • Line 15: warning: comment on exported function ListCluster should be of the form "ListCluster ..." (golint)
    • Line 35: warning: comment on exported function GetCluster should be of the form "GetCluster ..." (golint)
    • Line 61: warning: comment on exported function CreateCluster should be of the form "CreateCluster ..." (golint)
    • Line 99: warning: comment on exported function DeleteCluster should be of the form "DeleteCluster ..." (golint)
    • cb-ladybug/src/core/model/node.go
    • Line 13: warning: exported type Node should have comment or be unexported (golint)
    • Line 25: warning: exported type NodeList should have comment or be unexported (golint)
    • Line 32: warning: exported function NewNodeVM should have comment or be unexported (golint)
    • Line 46: warning: exported function NewNode should have comment or be unexported (golint)
    • Line 54: warning: exported function NewNodeList should have comment or be unexported (golint)
    • Line 63: warning: exported method Node.Select should have comment or be unexported (golint)
    • Line 63: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 70: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 77: warning: exported method Node.Insert should have comment or be unexported (golint)
    • Line 77: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 88: warning: exported method Node.Delete should have comment or be unexported (golint)
    • Line 88: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 98: warning: exported method NodeList.SelectList should have comment or be unexported (golint)
    • Line 98: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/core/model/tumblebug/mcis.go
    • Line 12: warning: exported type MCIS should have comment or be unexported (golint)
    • Line 18: warning: exported function NewMCIS should have comment or be unexported (golint)
    • Line 25: warning: exported method MCIS.GET should have comment or be unexported (golint)
    • Line 25: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 39: warning: exported method MCIS.POST should have comment or be unexported (golint)
    • Line 39: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 49: warning: exported method MCIS.DELETE should have comment or be unexported (golint)
    • Line 49: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/core/model/tumblebug/ns.go
    • Line 11: warning: exported type NS should have comment or be unexported (golint)
    • Line 17: warning: exported function NewNS should have comment or be unexported (golint)
    • Line 24: warning: exported method NS.GET should have comment or be unexported (golint)
    • Line 24: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/utils/app/ack.go
    • Line 14: warning: exported type Status should have comment or be unexported (golint)
    • Line 18: warning: exported function SendMessage should have comment or be unexported (golint)
    • Line 22: warning: exported function Send should have comment or be unexported (golint)
    • Line 26: warning: exported function Validate should have comment or be unexported (golint)
    • Line 35: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 41: warning: exported function ClusterReqDef should have comment or be unexported (golint)
    • Line 48: warning: exported function ClusterReqValidate should have comment or be unexported (golint)
    • Line 61: warning: exported function NodeReqValidate should have comment or be unexported (golint)
    • cb-ladybug/src/core/model/tumblebug/firewall.go
    • Line 11: warning: exported type Firewall should have comment or be unexported (golint)
    • Line 22: warning: exported type FirewallRules should have comment or be unexported (golint)
    • Line 29: warning: exported function NewFirewall should have comment or be unexported (golint)
    • Line 41: warning: exported method Firewall.GET should have comment or be unexported (golint)
    • Line 41: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 47: warning: exported method Firewall.POST should have comment or be unexported (golint)
    • Line 47: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 57: warning: exported method Firewall.DELETE should have comment or be unexported (golint)
    • Line 57: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/core/model/tumblebug/sshkey.go
    • Line 13: warning: exported type SSHKey should have comment or be unexported (golint)
    • Line 20: warning: exported function NewSSHKey should have comment or be unexported (golint)
    • Line 27: warning: exported method SSHKey.GET should have comment or be unexported (golint)
    • Line 27: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 33: warning: exported method SSHKey.POST should have comment or be unexported (golint)
    • Line 33: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 50: warning: exported method SSHKey.DELETE should have comment or be unexported (golint)
    • Line 50: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/rest-api/router/node.go
    • Line 15: warning: comment on exported function ListNode should be of the form "ListNode ..." (golint)
    • Line 41: warning: comment on exported function GetNode should be of the form "GetNode ..." (golint)
    • Line 68: warning: comment on exported function AddNode should be of the form "AddNode ..." (golint)
    • Line 110: warning: comment on exported function RemoveNode should be of the form "RemoveNode ..." (golint)
    • cb-ladybug/src/core/service/cluster.go
    • Line 17: warning: exported function ListCluster should have comment or be unexported (golint)
    • Line 28: warning: exported function GetCluster should have comment or be unexported (golint)
    • Line 38: warning: exported function CreateCluster should have comment or be unexported (golint)
    • Line 52: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 305: warning: exported function DeleteCluster should have comment or be unexported (golint)
    • cb-ladybug/src/core/service/csp.go
    • Line 14: warning: exported const GCP_IMAGE_ID should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: comment on exported function GetUserAccount should be of the form "GetUserAccount ..." (golint)
    • Line 51: warning: comment on exported function GetVmImageId should be of the form "GetVmImageId ..." (golint)
    • Line 64: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 74: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 86: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 92: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 99: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 104: warning: comment on exported function GetCSPName should be of the form "GetCSPName ..." (golint)
    • Line 115: warning: comment on exported function GetRegionName should be of the form "GetRegionName ..." (golint)
    • cb-ladybug/src/core/service/mcir.go
    • Line 11: warning: exported method NodeConfigInfo.CreateVPC should have comment or be unexported (golint)
    • Line 30: warning: exported method NodeConfigInfo.CreateFirewall should have comment or be unexported (golint)
    • Line 51: warning: exported method NodeConfigInfo.CreateSshKey should have comment or be unexported (golint)
    • Line 71: warning: exported method NodeConfigInfo.CreateImage should have comment or be unexported (golint)
    • Line 96: warning: exported method NodeConfigInfo.CreateSpec should have comment or be unexported (golint)
    • cb-ladybug/src/core/model/vm.go
    • Line 15: warning: exported type VM should have comment or be unexported (golint)
    • Line 39: warning: exported method VM.ConnectionTest should have comment or be unexported (golint)
    • Line 39: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 49: warning: exported method VM.CopyScripts should have comment or be unexported (golint)
    • Line 49: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 68: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 74: warning: exported method VM.SetSystemd should have comment or be unexported (golint)
    • Line 74: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 85: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 91: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 96: warning: exported method VM.Bootstrap should have comment or be unexported (golint)
    • Line 96: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 105: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 106: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 110: warning: exported method VM.InstallHAProxy should have comment or be unexported (golint)
    • Line 110: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 132: warning: exported method VM.ControlPlaneInit should have comment or be unexported (golint)
    • Line 132: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 144: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 156: warning: exported method VM.InstallNetworkCNI should have comment or be unexported (golint)
    • Line 156: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 173: warning: exported method VM.ControlPlaneJoin should have comment or be unexported (golint)
    • Line 173: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 190: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 192: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 196: warning: exported method VM.WorkerJoin should have comment or be unexported (golint)
    • Line 196: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 204: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 212: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 214: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • cb-ladybug/src/core/model/tumblebug/spec.go
    • Line 13: warning: exported type Spec should have comment or be unexported (golint)
    • Line 20: warning: exported function NewSpec should have comment or be unexported (golint)
    • Line 27: warning: exported method Spec.GET should have comment or be unexported (golint)
    • Line 27: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 33: warning: exported method Spec.POST should have comment or be unexported (golint)
    • Line 33: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 51: warning: exported method Spec.DELETE should have comment or be unexported (golint)
    • Line 51: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/utils/config/const.go
    • Line 3: warning: exported type CSP should have comment or be unexported (golint)
    • Line 6: warning: exported const CONTROL_PLANE should have comment (or a comment on this block) or be unexported (golint)
    • cb-ladybug/src/rest-api/server.go
    • Line 12: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 16: warning: exported function Server should have comment or be unexported (golint)
    • cb-ladybug/src/core/model/cluster.go
    • Line 14: warning: exported const STATUS_CREATED should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported type Cluster should have comment or be unexported (golint)
    • Line 32: warning: exported type ClusterList should have comment or be unexported (golint)
    • Line 38: warning: exported function NewCluster should have comment or be unexported (golint)
    • Line 46: warning: exported function NewClusterList should have comment or be unexported (golint)
    • Line 54: warning: exported method Cluster.Insert should have comment or be unexported (golint)
    • Line 54: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 59: warning: exported method Cluster.Update should have comment or be unexported (golint)
    • Line 59: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 64: warning: exported method Cluster.Complete should have comment or be unexported (golint)
    • Line 64: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 69: warning: exported method Cluster.Fail should have comment or be unexported (golint)
    • Line 69: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 74: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 84: warning: exported method Cluster.Select should have comment or be unexported (golint)
    • Line 84: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 91: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 103: warning: exported method Cluster.Delete should have comment or be unexported (golint)
    • Line 103: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 126: warning: exported method ClusterList.SelectList should have comment or be unexported (golint)
    • Line 126: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/core/model/tumblebug/tvm.go
    • Line 12: warning: exported type TVM should have comment or be unexported (golint)
    • Line 17: warning: exported function NewTVm should have comment or be unexported (golint)
    • Line 23: warning: exported method TVM.GET should have comment or be unexported (golint)
    • Line 23: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 29: warning: exported method TVM.POST should have comment or be unexported (golint)
    • Line 29: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 40: warning: exported method TVM.DELETE should have comment or be unexported (golint)
    • Line 40: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • cb-ladybug/src/core/model/tumblebug/vpc.go
    • Line 11: warning: exported type VPC should have comment or be unexported (golint)
    • Line 23: warning: exported type Subnet should have comment or be unexported (golint)
    • Line 28: warning: exported function NewVPC should have comment or be unexported (golint)
    • Line 41: warning: exported method VPC.GET should have comment or be unexported (golint)
    • Line 41: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 47: warning: exported method VPC.POST should have comment or be unexported (golint)
    • Line 47: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 58: warning: exported method VPC.DELETE should have comment or be unexported (golint)
    • Line 58: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!