Preparing report...

Report for github.com/galaxy-future/cudgx

(v0.0.0-20220106113257-704dd55521b7)

A+    Excellent!    Found 31 issues across 57 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!


gocyclo96%

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.


golint45%

Golint is a linter for Go source code.

    • internal/predict/xclient/xclient.go
    • Line 7: warning: exported type Client should have comment or be unexported (golint)
    • Line 12: warning: exported function InitializeBridgxClient should have comment or be unexported (golint)
    • Line 16: warning: exported function InitializeSchedulxClient should have comment or be unexported (golint)
    • common/kafka/consumer.go
    • Line 12: warning: exported function NewConsumers should have comment or be unexported (golint)
    • Line 43: warning: exported method ConsumerClient.Start should have comment or be unexported (golint)
    • Line 56: warning: exported method ConsumerClient.Stop should have comment or be unexported (golint)
    • Line 60: warning: exported type ConsumerClient should have comment or be unexported (golint)
    • Line 94: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • common/utils/env.go
    • Line 11: warning: exported function TryGetStringEnvironment should have comment or be unexported (golint)
    • Line 20: warning: exported function TryGetIntEnvironment should have comment or be unexported (golint)
    • Line 35: warning: exported function TryGetDurationEnvironment should have comment or be unexported (golint)
    • internal/clients/mysql.go
    • Line 11: warning: exported var DBClient should have comment or be unexported (golint)
    • Line 13: warning: exported function InitDBClient should have comment or be unexported (golint)
    • internal/request/predict_rule.go
    • Line 3: warning: exported type CreatePredictRuleRequest should have comment or be unexported (golint)
    • Line 17: warning: exported type UpdatePredictRuleRequest should have comment or be unexported (golint)
    • Line 32: warning: exported type BatchDeletePredictRuleRequest should have comment or be unexported (golint)
    • Line 36: warning: exported type EnableOrDisablePredictRuleRequest should have comment or be unexported (golint)
    • common/clickhouse/async-writer.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 13: warning: exported type CommitFunc should have comment or be unexported (golint)
    • Line 46: warning: exported method AsyncWriter.Start should have comment or be unexported (golint)
    • internal/predict/xclient/schedulx.go
    • Line 14: warning: exported function NewSchedulxClient should have comment or be unexported (golint)
    • Line 24: warning: exported type XclientRoundTripper should have comment or be unexported (golint)
    • Line 28: warning: exported method XclientRoundTripper.RoundTrip should have comment or be unexported (golint)
    • Line 37: warning: exported type SchedulxResponse should have comment or be unexported (golint)
    • common/kafka/producer.go
    • Line 7: warning: exported type ProducerClient should have comment or be unexported (golint)
    • Line 11: warning: exported method ProducerClient.SendMessage should have comment or be unexported (golint)
    • Line 19: warning: exported function NewProducer should have comment or be unexported (golint)
    • internal/predict/consts/const.go
    • Line 3: warning: exported const QPSMetricsName should have comment or be unexported (golint)
    • Line 4: warning: exported const DefaultPredictQueryCount should have comment or be unexported (golint)
    • Line 5: warning: exported const DefaultPredictMinCount should have comment or be unexported (golint)
    • Line 6: warning: exported const MinSkipFactor should have comment or be unexported (golint)
    • Line 7: warning: exported const DefaultRuleConcurrency should have comment or be unexported (golint)
    • Line 10: warning: exported const SchedulxExpandSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported const XClientUsername should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported const RuleStatusEnable should have comment (or a comment on this block) or be unexported (golint)
    • internal/gateway/gateway.go
    • Line 11: warning: exported type KafkaClient should have comment or be unexported (golint)
    • Line 16: warning: exported method Gateway.GetMonitoringStorageConfigEntry should have comment or be unexported (golint)
    • Line 32: warning: exported method Gateway.GetStreamingStorageConfigEntry should have comment or be unexported (golint)
    • Line 48: warning: exported method KafkaClient.SendMessage should have comment or be unexported (golint)
    • Line 52: warning: exported method Gateway.GetMonitoringWriter should have comment or be unexported (golint)
    • Line 74: warning: exported method Gateway.GetStreamingWriter should have comment or be unexported (golint)
    • Line 96: warning: exported method Gateway.WrapStreamingMessage should have comment or be unexported (golint)
    • Line 99: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • internal/predict/xclient/type.go
    • Line 3: warning: exported type ExpandAndShrinkResponse should have comment or be unexported (golint)
    • Line 8: warning: exported type GetServiceScheduleResponse should have comment or be unexported (golint)
    • Line 14: warning: exported type GetServiceClusterInstanceResponse should have comment or be unexported (golint)
    • Line 20: warning: exported type ServiceClusterInstanceCountList should have comment or be unexported (golint)
    • Line 24: warning: exported type ServiceClusterInstanceCount should have comment or be unexported (golint)
    • Line 30: warning: exported type ServiceSchedule should have comment or be unexported (golint)
    • Line 36: warning: exported type ServiceCluster should have comment or be unexported (golint)
    • internal/predict/model/predict_rule.go
    • Line 9: warning: exported type PredictRule should have comment or be unexported (golint)
    • Line 25: warning: exported method PredictRule.TableName should have comment or be unexported (golint)
    • Line 29: warning: exported function CreatePredictRule should have comment or be unexported (golint)
    • Line 37: warning: exported function DeletePredictRuleById should have comment or be unexported (golint)
    • Line 45: warning: exported function UpdatePredictRule should have comment or be unexported (golint)
    • Line 66: warning: exported function GetPredictRuleById should have comment or be unexported (golint)
    • Line 75: warning: exported function GetPredictRuleByServiceNameAndClusterName should have comment or be unexported (golint)
    • Line 84: warning: exported function ListPredictRules should have comment or be unexported (golint)
    • Line 102: warning: exported function ListAllPredictRules should have comment or be unexported (golint)
    • Line 112: warning: exported function UpdatePredictRuleStatusById should have comment or be unexported (golint)
    • internal/gateway/config.go
    • Line 14: warning: exported type Gateway should have comment or be unexported (golint)
    • Line 21: warning: exported type Config should have comment or be unexported (golint)
    • Line 28: warning: exported type MessageRouteConfig should have comment or be unexported (golint)
    • Line 33: warning: exported type StorageEntryConfig should have comment or be unexported (golint)
    • Line 39: warning: exported type DatabaseConfig should have comment or be unexported (golint)
    • Line 44: warning: exported function GetGateway should have comment or be unexported (golint)
    • Line 48: warning: exported function Init should have comment or be unexported (golint)
    • Line 53: warning: exported function NewFromConfigFile should have comment or be unexported (golint)
    • Line 89: warning: exported method Gateway.GetConfig should have comment or be unexported (golint)
    • internal/gateway/rule/manager.go
    • Line 12: warning: exported type Manager should have comment or be unexported (golint)
    • Line 17: warning: exported function NewRuleManager should have comment or be unexported (golint)
    • Line 25: warning: exported method Manager.InitManager should have comment or be unexported (golint)
    • Line 54: warning: exported method Manager.MatchRule should have comment or be unexported (golint)
    • internal/predict/service/predict_rule.go
    • Line 10: warning: exported function CreatePredictRule should have comment or be unexported (golint)
    • Line 32: warning: exported function DeletePredictRuleById should have comment or be unexported (golint)
    • Line 39: warning: exported function UpdatePredictRuleById should have comment or be unexported (golint)
    • Line 63: warning: exported function GetPredictRuleByServiceNameAndClusterName should have comment or be unexported (golint)
    • Line 71: warning: exported function GetPredictRuleById should have comment or be unexported (golint)
    • Line 79: warning: exported function ListPredictRules should have comment or be unexported (golint)
    • Line 87: warning: exported function UpdatePredictRuleStatus should have comment or be unexported (golint)
    • internal/gateway/rule/type.go
    • Line 17: warning: exported type Rule should have comment or be unexported (golint)
    • Line 43: warning: exported type Filter should have comment or be unexported (golint)
    • Line 49: warning: exported type Aggregate should have comment or be unexported (golint)
    • Line 54: warning: exported type MysqlOption should have comment or be unexported (golint)
    • common/mod/gateway.go
    • Line 3: warning: exported const GatewayModuleName should have comment or be unexported (golint)
    • Line 4: warning: exported const GatewayStatusSuccess should have comment or be unexported (golint)
    • internal/response/base.go
    • Line 4: warning: exported var StatusSuccess should have comment or be unexported (golint)
    • Line 10: warning: exported type ResponseBase should have comment or be unexported (golint)
    • Line 16: warning: exported function MkFailedResponse should have comment or be unexported (golint)
    • Line 23: warning: exported function MkSuccessResponse should have comment or be unexported (golint)
    • Line 31: warning: exported const ParamError should have comment (or a comment on this block) or be unexported (golint)
    • internal/clients/clickhouse_reader.go
    • Line 10: warning: exported var ClickhouseRdCli should have comment or be unexported (golint)
    • Line 13: warning: exported function InitClickhouseRdCli should have comment or be unexported (golint)
    • Line 18: warning: exported type ClickhouseReader should have comment or be unexported (golint)
    • Line 24: warning: exported function NewClickhouse should have comment or be unexported (golint)
    • internal/consumer/consumer.go
    • Line 17: warning: exported type Consumer should have comment or be unexported (golint)
    • Line 24: warning: exported function NewConsumer should have comment or be unexported (golint)
    • Line 45: warning: exported method Consumer.Start should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!