Preparing report...

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

A    Great!    Found 56 issues across 67 files

Tweet

gofmt92%

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.


golint17%

Golint is a linter for Go source code.

    • cb-dragonfly/pkg/api/rest/alert/task.go
    • Line 16: warning: comment on exported function ListAlertTask should be of the form "ListAlertTask ..." (golint)
    • Line 25: warning: comment on exported function GetAlertTask should be of the form "GetAlertTask ..." (golint)
    • Line 38: warning: comment on exported function CreateAlertTask should be of the form "CreateAlertTask ..." (golint)
    • Line 51: warning: comment on exported function UpdateAlertTask should be of the form "UpdateAlertTask ..." (golint)
    • Line 64: warning: comment on exported function DeleteAlertTask should be of the form "DeleteAlertTask ..." (golint)
    • Line 90: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 96: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 101: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • cb-dragonfly/pkg/collector/type.go
    • Line 3: warning: exported type AggregateType should have comment or be unexported (golint)
    • Line 6: warning: exported const MIN should have comment (or a comment on this block) or be unexported (golint)
    • cb-dragonfly/pkg/metricstore/influxdb/storage.go
    • Line 7: warning: exported type StoreType should have comment or be unexported (golint)
    • Line 10: warning: exported const InfluxDBV1Type should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: comment on exported function NewStorage should be of the form "NewStorage ..." (golint)
    • cb-dragonfly/pkg/kafka/broker.go
    • Line 13: warning: exported type KafkaStruct should have comment or be unexported (golint)
    • Line 21: warning: comment on exported function Initialize should be of the form "Initialize ..." (golint)
    • Line 39: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 45: warning: exported function GetInstance should have comment or be unexported (golint)
    • Line 56: warning: exported method KafkaStruct.GetAllTopics should have comment or be unexported (golint)
    • Line 63: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 64: warning: should omit 2nd value from range; this loop is equivalent to `for topic := range ...` (golint)
    • Line 71: warning: exported method KafkaStruct.DeleteTopics should have comment or be unexported (golint)
    • cb-dragonfly/pkg/metricstore/influxdb/influxdbv2/influxdb.go
    • Line 10: warning: exported type Client should have comment or be unexported (golint)
    • Line 16: warning: exported type Config should have comment or be unexported (golint)
    • Line 20: warning: exported type Storage should have comment or be unexported (golint)
    • Line 25: warning: exported method Storage.Init should have comment or be unexported (golint)
    • Line 43: warning: exported method Storage.WriteMetric should have comment or be unexported (golint)
    • Line 66: warning: exported method Storage.ReadMetric should have comment or be unexported (golint)
    • cb-dragonfly/pkg/core/alert/template/template.go
    • Line 13: warning: exported const NamePattern should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported function ListTemplates should have comment or be unexported (golint)
    • Line 24: warning: exported function GetTemplate should have comment or be unexported (golint)
    • Line 36: warning: exported function CreateTemplate should have comment or be unexported (golint)
    • Line 49: warning: exported function UpdateTemplate should have comment or be unexported (golint)
    • Line 54: warning: exported function DeleteTemplate should have comment or be unexported (golint)
    • Line 66: warning: exported function DeleteAllTemplates should have comment or be unexported (golint)
    • cb-dragonfly/pkg/localstore/cbstore.go
    • Line 13: warning: exported type CBStore should have comment or be unexported (golint)
    • Line 20: warning: exported function Initialize should have comment or be unexported (golint)
    • Line 24: warning: exported function GetInstance should have comment or be unexported (golint)
    • Line 31: warning: exported method CBStore.StorePut should have comment or be unexported (golint)
    • Line 35: warning: exported method CBStore.StoreGet should have comment or be unexported (golint)
    • Line 43: warning: exported method CBStore.StoreGetToInt should have comment or be unexported (golint)
    • Line 52: warning: exported method CBStore.StoreGetToString should have comment or be unexported (golint)
    • Line 60: warning: exported method CBStore.StoreDelete should have comment or be unexported (golint)
    • Line 64: warning: exported method CBStore.StoreGetList should have comment or be unexported (golint)
    • Line 79: warning: exported method CBStore.StoreDelList should have comment or be unexported (golint)
    • Line 92: warning: exported method CBStore.StoreGetNodeValue should have comment or be unexported (golint)
    • cb-dragonfly/pkg/core/alert/eventhandler/eventhandler.go
    • Line 12: warning: exported const SlackType should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported var EventTypes should have comment or be unexported (golint)
    • Line 21: warning: exported type EventHandler should have comment or be unexported (golint)
    • Line 29: warning: exported function InitializeEventTypes should have comment or be unexported (golint)
    • Line 34: warning: exported function ListEventHandlers should have comment or be unexported (golint)
    • Line 54: warning: exported function GetEventHandler should have comment or be unexported (golint)
    • Line 61: warning: exported function CreateEventHandler should have comment or be unexported (golint)
    • Line 68: warning: exported function UpdateEventHandler should have comment or be unexported (golint)
    • Line 75: warning: exported function DeleteEventHandler should have comment or be unexported (golint)
    • cb-dragonfly/pkg/collector/cbstore.go
    • Line 12: warning: exported type CBStore should have comment or be unexported (golint)
    • Line 19: warning: exported function Initialize should have comment or be unexported (golint)
    • Line 23: warning: exported function GetInstance should have comment or be unexported (golint)
    • Line 30: warning: exported method CBStore.StorePut should have comment or be unexported (golint)
    • Line 34: warning: exported method CBStore.StoreGet should have comment or be unexported (golint)
    • Line 42: warning: exported method CBStore.StoreDelete should have comment or be unexported (golint)
    • Line 46: warning: exported method CBStore.StoreGetList should have comment or be unexported (golint)
    • Line 61: warning: exported method CBStore.StoreDelList should have comment or be unexported (golint)
    • Line 74: warning: exported method CBStore.StoreGetNodeValue should have comment or be unexported (golint)
    • cb-dragonfly/pkg/api/grpc/request/monitoring.go
    • Line 12: warning: exported type MonitoringRequest should have comment or be unexported (golint)
    • Line 19: warning: exported function NewMonitoringRequest should have comment or be unexported (golint)
    • Line 31: warning: comment on exported method MonitoringRequest.GetMonitoringConfig should be of the form "GetMonitoringConfig ..." (golint)
    • Line 44: warning: comment on exported method MonitoringRequest.SetMonitoringConfig should be of the form "SetMonitoringConfig ..." (golint)
    • Line 58: warning: comment on exported method MonitoringRequest.ResetMonitoringConfig should be of the form "ResetMonitoringConfig ..." (golint)
    • Line 73: warning: comment on exported method MonitoringRequest.GetVMMonInfo should be of the form "GetVMMonInfo ..." (golint)
    • Line 101: warning: comment on exported method MonitoringRequest.GetVMOnDemandMonInfo should be of the form "GetVMOnDemandMonInfo ..." (golint)
    • Line 129: warning: comment on exported method MonitoringRequest.GetMCISMonInfo should be of the form "GetMCISMonInfo ..." (golint)
    • cb-dragonfly/pkg/manager/manager.go
    • Line 24: warning: exported type CollectManager should have comment or be unexported (golint)
    • Line 30: warning: exported function NewCollectorManager should have comment or be unexported (golint)
    • Line 60: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 78: warning: exported method CollectManager.FlushMonitoringData should have comment or be unexported (golint)
    • Line 86: warning: exported method CollectManager.SetConfigurationToMemoryDB should have comment or be unexported (golint)
    • Line 97: warning: exported method CollectManager.StartCollectorGroup should have comment or be unexported (golint)
    • Line 121: warning: exported method CollectManager.CreateCollectorGroup should have comment or be unexported (golint)
    • Line 146: warning: exported method CollectManager.StopCollectorGroup should have comment or be unexported (golint)
    • Line 150: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 159: warning: exported method CollectManager.StartScheduler should have comment or be unexported (golint)
    • cb-dragonfly/pkg/manager/topic_manager.go
    • Line 14: warning: exported type TopicManager should have comment or be unexported (golint)
    • Line 22: warning: exported function TopicMangerInit should have comment or be unexported (golint)
    • Line 27: warning: exported function TopicMangerInstance should have comment or be unexported (golint)
    • Line 34: warning: exported method TopicManager.SetTopicToCollectorBasedTheNumberOfAgent should have comment or be unexported (golint)
    • Line 48: warning: exported method TopicManager.DeleteAllTopicsInfo should have comment or be unexported (golint)
    • Line 56: warning: exported method TopicManager.DeleteTopics should have comment or be unexported (golint)
    • Line 77: warning: should omit 2nd value from range; this loop is equivalent to `for key := range ...` (golint)
    • Line 86: warning: exported method TopicManager.AddNewTopics should have comment or be unexported (golint)
    • Line 109: warning: exported method TopicManager.SetTopicToCollectorBasedCSPTypeOfAgent should have comment or be unexported (golint)
    • Line 123: warning: exported method TopicManager.AddNewTopicsOnCSPCollector should have comment or be unexported (golint)
    • cb-dragonfly/pkg/api/grpc/request/monitoring_api.go
    • Line 13: warning: exported const TimeoutMinutes should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported type MonitoringAPI should have comment or be unexported (golint)
    • Line 29: warning: comment on exported function InitMonitoringAPI should be of the form "InitMonitoringAPI ..." (golint)
    • Line 42: warning: exported function GetMonitoringAPI should have comment or be unexported (golint)
    • Line 46: warning: exported method MonitoringAPI.Open should have comment or be unexported (golint)
    • Line 65: warning: exported method MonitoringAPI.Close should have comment or be unexported (golint)
    • Line 76: warning: exported method MonitoringAPI.GetMonitoringConfig should have comment or be unexported (golint)
    • Line 80: warning: exported method MonitoringAPI.SetMonitoringConfig should have comment or be unexported (golint)
    • Line 84: warning: exported method MonitoringAPI.ResetMonitoringConfig should have comment or be unexported (golint)
    • Line 88: warning: exported method MonitoringAPI.GetVMMonInfo should have comment or be unexported (golint)
    • Line 92: warning: exported method MonitoringAPI.GetVMOnDemandMonInfo should have comment or be unexported (golint)
    • Line 96: warning: exported method MonitoringAPI.GetMCISMonInfo should have comment or be unexported (golint)
    • cb-dragonfly/pkg/core/metric/metric.go
    • Line 16: warning: exported type Metric should have comment or be unexported (golint)
    • Line 19: warning: exported const Cpu should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: comment on exported type CBMCISMetric should be of the form "CBMCISMetric ..." (with optional leading article) (golint)
    • Line 36: warning: comment on exported type MCBMCISMetric should be of the form "MCBMCISMetric ..." (with optional leading article) (golint)
    • Line 45: warning: comment on exported type Request should be of the form "Request ..." (with optional leading article) (golint)
    • Line 51: warning: comment on exported type Mrequest should be of the form "Mrequest ..." (with optional leading article) (golint)
    • Line 56: warning: exported type Parameter should have comment or be unexported (golint)
    • Line 57: warning: don't use underscores in Go names; struct field agent_ip should be agentIP (golint)
    • Line 58: warning: don't use underscores in Go names; struct field mcis_metric should be mcisMetric (golint)
    • Line 61: warning: comment on exported function GetVMMonInfo should be of the form "GetVMMonInfo ..." (golint)
    • Line 74: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 90: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 106: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 126: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 222: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 239: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • cb-dragonfly/pkg/api/grpc/request/client.go
    • Line 11: warning: exported const GrpcPort should have comment or be unexported (golint)
    • Line 16: warning: exported function ConnectGRPC should have comment or be unexported (golint)
    • Line 26: warning: exported function ConnectClient should have comment or be unexported (golint)
    • cb-dragonfly/pkg/util/utility.go
    • Line 15: warning: exported function StructToMap should have comment or be unexported (golint)
    • Line 44: warning: exported function ToMap should have comment or be unexported (golint)
    • Line 62: warning: exported function GetFields should have comment or be unexported (golint)
    • Line 71: warning: exported function SplitOneStringToTopicsSlice should have comment or be unexported (golint)
    • Line 75: warning: exported function MergeTopicsToOneString should have comment or be unexported (golint)
    • Line 83: warning: exported function CalculateNumberOfCollector should have comment or be unexported (golint)
    • Line 91: warning: exported function ReturnDiffTopicList should have comment or be unexported (golint)
    • Line 104: warning: exported function GetAllTopicBySort should have comment or be unexported (golint)
    • Line 114: warning: exported function MakeCollectorTopicMap should have comment or be unexported (golint)
    • Line 145: warning: exported function MakeCollectorTopicMapBasedCSP should have comment or be unexported (golint)
    • cb-dragonfly/pkg/core/alert/eventhandler/event/smtp/smtp.go
    • Line 14: warning: exported const EventType should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type SmtpHandler should have comment or be unexported (golint)
    • Line 19: warning: exported method SmtpHandler.ListEventHandlers should have comment or be unexported (golint)
    • Line 27: warning: exported method SmtpHandler.GetEventHandler should have comment or be unexported (golint)
    • Line 40: warning: exported method SmtpHandler.CreateEventHandler should have comment or be unexported (golint)
    • Line 44: warning: exported method SmtpHandler.UpdateEventHandler should have comment or be unexported (golint)
    • Line 70: warning: exported method SmtpHandler.DeleteEventHandler should have comment or be unexported (golint)
    • cb-dragonfly/pkg/core/agent/agent.go
    • Line 22: warning: exported const UBUNTU should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported function InstallTelegraf should have comment or be unexported (golint)
    • Line 36: 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 51: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 70: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 75: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 81: 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 91: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 100: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 104: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 109: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 117: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 123: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 130: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 137: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 144: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 145: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 148: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 156: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 163: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 261: warning: exported function GetPackageName should have comment or be unexported (golint)
    • Line 270: warning: comment on exported function UninstallAgent should be of the form "UninstallAgent ..." (golint)
    • Line 291: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 298: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 311: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 316: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 321: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 328: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 336: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • cb-dragonfly/pkg/core/alert/event/event.go
    • Line 10: warning: exported function CreateEventLog should have comment or be unexported (golint)
    • Line 38: warning: exported function ListEventLog should have comment or be unexported (golint)
    • Line 54: warning: exported function DeleteEventLog should have comment or be unexported (golint)
    • cb-dragonfly/pkg/core/metric/mcis_metric.go
    • Line 14: warning: exported const Rtt should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported type MCISMetric should have comment or be unexported (golint)
    • Line 27: warning: exported function GetMCISMonInfo should have comment or be unexported (golint)
    • Line 32: warning: exported function GetMCISRealtimeMonInfo should have comment or be unexported (golint)
    • Line 37: warning: comment on exported function GetMCISCommonMonInfo should be of the form "GetMCISCommonMonInfo ..." (golint)
    • Line 159: warning: exported method MCISMetric.CheckParameter should have comment or be unexported (golint)
    • cb-dragonfly/pkg/localstore/metadata.go
    • Line 13: warning: exported const ENABLE should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type Metadata should have comment or be unexported (golint)
    • Line 22: warning: exported type AgentInfo should have comment or be unexported (golint)
    • Line 25: warning: don't use underscores in Go names; struct field Public_IP should be PublicIP (golint)
    • Line 31: warning: don't use underscores in Go names; func parameter public_ip should be publicIP (golint)
    • Line 48: warning: exported function AgentInstallationMetadata should have comment or be unexported (golint)
    • Line 49: warning: don't use underscores in Go names; var agent_State should be agentState (golint)
    • Line 50: warning: don't use underscores in Go names; var agent_Type should be agentType (golint)
    • Line 55: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 60: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 65: warning: exported function AgentDeletionMetadata should have comment or be unexported (golint)
    • Line 66: warning: don't use underscores in Go names; var agent_State should be agentState (golint)
    • Line 67: warning: don't use underscores in Go names; var agent_Type should be agentType (golint)
    • Line 73: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 78: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 88: warning: exported function ShowMetadata should have comment or be unexported (golint)
    • Line 90: warning: don't use underscores in Go names; var ns_id should be nsID (golint)
    • Line 91: warning: don't use underscores in Go names; var mcis_id should be mcisID (golint)
    • Line 92: warning: don't use underscores in Go names; var vm_id should be vmID (golint)
    • Line 93: warning: don't use underscores in Go names; var csp_type should be cspType (golint)
    • Line 101: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • cb-dragonfly/pkg/core/config/config.go
    • Line 15: warning: exported const MonConfigKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: comment on exported function SetMonConfig should be of the form "SetMonConfig ..." (golint)
    • Line 50: warning: comment on exported function GetMonConfig should be of the form "GetMonConfig ..." (golint)
    • Line 67: warning: comment on exported function ResetMonConfig should be of the form "ResetMonConfig ..." (golint)
    • cb-dragonfly/pkg/config/config.go
    • Line 11: warning: exported type Config should have comment or be unexported (golint)
    • Line 21: warning: exported type Kapacitor should have comment or be unexported (golint)
    • Line 25: warning: exported type Kafka should have comment or be unexported (golint)
    • Line 28: warning: don't use underscores in Go names; struct field Deploy_Type should be DeployType (golint)
    • Line 29: warning: don't use underscores in Go names; struct field Helm_External_Port should be HelmExternalPort (golint)
    • Line 30: warning: don't use underscores in Go names; struct field Compose_External_Port should be ComposeExternalPort (golint)
    • Line 34: warning: exported type InfluxDB should have comment or be unexported (golint)
    • Line 43: warning: exported type CollectManager should have comment or be unexported (golint)
    • Line 49: warning: exported type APIServer should have comment or be unexported (golint)
    • Line 53: warning: exported type Monitoring should have comment or be unexported (golint)
    • Line 60: warning: exported type GrpcServer should have comment or be unexported (golint)
    • Line 64: warning: exported method Kapacitor.GetKapacitorEndpointUrl should have comment or be unexported (golint)
    • Line 68: warning: exported method Kafka.GetKafkaEndpointUrl should have comment or be unexported (golint)
    • Line 75: warning: exported function GetInstance should have comment or be unexported (golint)
    • Line 82: warning: exported function GetDefaultConfig should have comment or be unexported (golint)
    • Line 88: warning: exported method Config.SetMonConfig should have comment or be unexported (golint)
    • Line 92: warning: exported method Config.GetInfluxDBConfig should have comment or be unexported (golint)
    • Line 96: warning: exported method Config.GetKapacitorConfig should have comment or be unexported (golint)
    • Line 100: warning: exported method Config.GetKafkaConfig should have comment or be unexported (golint)
    • Line 104: warning: exported method Config.GetGrpcConfig should have comment or be unexported (golint)
    • cb-dragonfly/pkg/types/metric_types.go
    • Line 3: warning: comment on exported type Metric should be of the form "Metric ..." (with optional leading article) (golint)
    • Line 6: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 11: warning: exported const MONCONFIG should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported const NSID should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported const AGENTCOUNT should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported const ALIBABA should have comment (or a comment on this block) or be unexported (golint)
    • cb-dragonfly/pkg/core/alert/template/template_builder.go
    • Line 15: warning: exported const TemplatePath should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported type TemplateBuilder should have comment or be unexported (golint)
    • Line 20: warning: exported function RegisterTemplate should have comment or be unexported (golint)
    • Line 61: warning: exported function CleanTemplates should have comment or be unexported (golint)
    • cb-dragonfly/pkg/core/alert/eventhandler/event/slack/slack.go
    • Line 14: warning: exported const EventType should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type SlackHandler should have comment or be unexported (golint)
    • Line 19: warning: exported method SlackHandler.ListEventHandlers should have comment or be unexported (golint)
    • Line 41: warning: exported method SlackHandler.GetEventHandler should have comment or be unexported (golint)
    • Line 51: warning: exported method SlackHandler.CreateEventHandler should have comment or be unexported (golint)
    • Line 71: warning: exported method SlackHandler.UpdateEventHandler should have comment or be unexported (golint)
    • Line 91: warning: exported method SlackHandler.DeleteEventHandler should have comment or be unexported (golint)
    • cb-dragonfly/pkg/collector/metric_collector.go
    • Line 15: warning: exported type MetricCollector should have comment or be unexported (golint)
    • Line 23: warning: exported type TelegrafMetric should have comment or be unexported (golint)
    • Line 31: warning: exported var KafkaConfig should have comment or be unexported (golint)
    • Line 33: warning: exported function NewMetricCollector should have comment or be unexported (golint)
    • Line 70: warning: exported const DEFAULT should have comment (or a comment on this block) or be unexported (golint)
    • Line 77: warning: exported method MetricCollector.Collector should have comment or be unexported (golint)
    • cb-dragonfly/pkg/metricstore/influxdb/influxdbv1/influxdb.go
    • Line 13: warning: exported type ClientOptions should have comment or be unexported (golint)
    • Line 19: warning: exported type Config should have comment or be unexported (golint)
    • Line 24: warning: exported type Storage should have comment or be unexported (golint)
    • Line 32: warning: exported function GetInstance should have comment or be unexported (golint)
    • Line 39: warning: exported function Initialize should have comment or be unexported (golint)
    • Line 69: warning: exported method Storage.WriteMetric should have comment or be unexported (golint)
    • Line 87: warning: exported method Storage.ReadMetric should have comment or be unexported (golint)
    • cb-dragonfly/pkg/util/sshrun.go
    • Line 8: warning: exported function RunCommand should have comment or be unexported (golint)
    • Line 21: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • cb-dragonfly/pkg/manager/scheduler.go
    • Line 17: warning: exported type CollectorScheduler should have comment or be unexported (golint)
    • Line 22: warning: exported function NewCollectorScheduler should have comment or be unexported (golint)
    • Line 32: warning: exported method CollectorScheduler.Scheduler should have comment or be unexported (golint)
    • Line 55: warning: comment on exported method CollectorScheduler.ScheduleBasedTheNumberOfCollector should be of the form "ScheduleBasedTheNumberOfCollector ..." (golint)
    • Line 103: warning: exported method CollectorScheduler.NeedCollectorScaleInOut should have comment or be unexported (golint)
    • Line 128: warning: exported method CollectorScheduler.NeedRebalancedTopics should have comment or be unexported (golint)
    • Line 131: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 143: warning: comment on exported method CollectorScheduler.ScheduleBasedCollectorCSPType should be of the form "ScheduleBasedCollectorCSPType ..." (golint)
    • Line 177: warning: comment on exported method CollectorScheduler.ReturnDiffTopics should be of the form "ReturnDiffTopics ..." (golint)
    • Line 182: warning: exported method CollectorScheduler.SendTopicsToCollectors should have comment or be unexported (golint)
    • cb-dragonfly/pkg/core/alert/types/types.go
    • Line 3: warning: exported type AlertTaskReq should have comment or be unexported (golint)
    • Line 25: warning: exported type AlertTask should have comment or be unexported (golint)
    • Line 47: warning: exported type AlertEventHandlerReq should have comment or be unexported (golint)
    • Line 65: warning: exported type AlertEventHandler should have comment or be unexported (golint)
    • Line 72: warning: exported type AlertEventLog should have comment or be unexported (golint)
    • cb-dragonfly/pkg/api/rest/alert/eventhandler.go
    • Line 16: warning: comment on exported function ListEventHandler should be of the form "ListEventHandler ..." (golint)
    • Line 26: warning: comment on exported function GetEventHandler should be of the form "GetEventHandler ..." (golint)
    • Line 37: warning: comment on exported function CreateEventHandler should be of the form "CreateEventHandler ..." (golint)
    • Line 50: warning: comment on exported function UpdateEventHandler should be of the form "UpdateEventHandler ..." (golint)
    • Line 65: warning: comment on exported function DeleteEventHandler should be of the form "DeleteEventHandler ..." (golint)
    • cb-dragonfly/pkg/api/rest/config/config.go
    • Line 16: warning: comment on exported function SetMonConfig should be of the form "SetMonConfig ..." (golint)
    • Line 27: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 48: warning: comment on exported function GetMonConfig should be of the form "GetMonConfig ..." (golint)
    • Line 57: warning: comment on exported function ResetMonConfig should be of the form "ResetMonConfig ..." (golint)
    • cb-dragonfly/pkg/api/grpc/server/monitoring.go
    • Line 15: warning: exported type MonitoringService should have comment or be unexported (golint)
    • Line 17: warning: exported method MonitoringService.GetMCISMonInfo should have comment or be unexported (golint)
    • Line 31: warning: exported method MonitoringService.GetVMOnDemandMonCpuInfo should have comment or be unexported (golint)
    • Line 60: warning: exported method MonitoringService.GetVMOnDemandMonCpuFreqInfo should have comment or be unexported (golint)
    • Line 89: warning: exported method MonitoringService.GetVMOnDemandMonMemoryInfo should have comment or be unexported (golint)
    • Line 118: warning: exported method MonitoringService.GetVMOnDemandMonDiskInfo should have comment or be unexported (golint)
    • Line 147: warning: exported method MonitoringService.GetVMOnDemandMonNetworkInfo should have comment or be unexported (golint)
    • Line 176: warning: exported method MonitoringService.GetVMMonCpuInfo should have comment or be unexported (golint)
    • Line 204: warning: exported method MonitoringService.GetVMMonCpuFreqInfo should have comment or be unexported (golint)
    • Line 231: warning: exported method MonitoringService.GetVMMonMemoryInfo should have comment or be unexported (golint)
    • Line 258: warning: exported method MonitoringService.GetVMMonDiskInfo should have comment or be unexported (golint)
    • Line 285: warning: exported method MonitoringService.GetVMMonNetworkInfo should have comment or be unexported (golint)
    • Line 312: warning: exported method MonitoringService.SetMonConfig should have comment or be unexported (golint)
    • Line 333: warning: exported method MonitoringService.GetMonConfig should have comment or be unexported (golint)
    • Line 347: warning: exported method MonitoringService.ResetMonConfig should have comment or be unexported (golint)
    • Line 361: warning: exported method MonitoringService.InstallTelegraf should have comment or be unexported (golint)
    • cb-dragonfly/pkg/manager/apiserver.go
    • Line 22: warning: exported type APIServer should have comment or be unexported (golint)
    • Line 26: warning: comment on exported function NewAPIServer should be of the form "NewAPIServer ..." (golint)
    • Line 35: warning: comment on exported method APIServer.StartAPIServer should be of the form "StartAPIServer ..." (golint)
    • Line 49: warning: exported method APIServer.SetRoutingRule should have comment or be unexported (golint)
    • cb-dragonfly/pkg/core/alert/task/task.go
    • Line 19: warning: exported const KapacitorTaskPattern should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported function ListTasks should have comment or be unexported (golint)
    • Line 43: warning: exported function GetTask should have comment or be unexported (golint)
    • Line 60: warning: exported function CreateTask should have comment or be unexported (golint)
    • Line 107: warning: exported function UpdateTask should have comment or be unexported (golint)
    • Line 136: warning: exported function DeleteTask should have comment or be unexported (golint)
    • cb-dragonfly/pkg/collector/aggregator.go
    • Line 17: warning: exported type Aggregator should have comment or be unexported (golint)
    • Line 21: warning: exported method Aggregator.AggregateMetric should have comment or be unexported (golint)
    • Line 127: warning: exported method Aggregator.CalculateMetric should have comment or be unexported (golint)
    • cb-dragonfly/pkg/metricstore/influxdb/metric.go
    • Line 8: warning: exported type MetricType should have comment or be unexported (golint)
    • Line 11: warning: exported const CPU should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: comment on exported type Cpu should be of the form "Cpu ..." (with optional leading article) (golint)
    • Line 34: warning: exported type Cpufreq should have comment or be unexported (golint)
    • Line 38: warning: exported method Cpufreq.GetField should have comment or be unexported (golint)
    • Line 42: warning: exported method Cpu.GetField should have comment or be unexported (golint)
    • Line 47: warning: comment on exported type Memory should be of the form "Memory ..." (with optional leading article) (golint)
    • Line 58: warning: exported method Memory.GetField should have comment or be unexported (golint)
    • Line 63: warning: comment on exported type Disk should be of the form "Disk ..." (with optional leading article) (golint)
    • Line 75: warning: exported method Disk.GetField should have comment or be unexported (golint)
    • Line 80: warning: comment on exported type DiskIO should be of the form "DiskIO ..." (with optional leading article) (golint)
    • Line 88: warning: exported method DiskIO.GetField should have comment or be unexported (golint)
    • Line 93: warning: comment on exported type Network should be of the form "Network ..." (with optional leading article) (golint)
    • Line 101: warning: exported method Network.GetField should have comment or be unexported (golint)
    • cb-dragonfly/pkg/api/rest/agent/agent.go
    • Line 17: warning: exported function InstallTelegraf should have comment or be unexported (golint)
    • Line 43: warning: comment on exported function GetWindowInstaller should be of the form "GetWindowInstaller ..." (golint)
    • Line 50: warning: comment on exported function GetTelegrafConfFile should be of the form "GetTelegrafConfFile ..." (golint)
    • Line 81: warning: comment on exported function GetTelegrafPkgFile should be of the form "GetTelegrafPkgFile ..." (golint)
    • Line 118: warning: exported function UninstallAgent 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.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!