Preparing report...

Report for github.com/xiaomeng79/istio-micro

A+    Excellent!    Found 45 issues across 65 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!


golint30%

Golint is a linter for Go source code.

    • istio-micro/internal/kafka/init.go
    • Line 11: warning: exported type Kafka should have comment or be unexported (golint)
    • Line 20: warning: exported function NewKafka should have comment or be unexported (golint)
    • Line 54: warning: exported method Kafka.Close should have comment or be unexported (golint)
    • istio-micro/internal/api/errors.go
    • Line 17: warning: exported type ErrorNo should have comment or be unexported (golint)
    • Line 24: warning: comment on exported const Success should be of the form "Success ..." (golint)
    • Line 26: warning: comment on exported const ReqPathError should be of the form "ReqPathError ..." (golint)
    • Line 28: warning: exported const ReqVersionNoExist should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: comment on exported const CommonPageError should be of the form "CommonPageError ..." (golint)
    • Line 42: warning: comment on exported const BusParamError should be of the form "BusParamError ..." (golint)
    • Line 48: warning: comment on exported const ServiceError should be of the form "ServiceError ..." (golint)
    • Line 52: warning: exported var ReturnMsg should have comment or be unexported (golint)
    • Line 89: warning: comment on exported function RPCErr should be of the form "RPCErr ..." (golint)
    • Line 102: warning: comment on exported function HandleSuccess should be of the form "HandleSuccess ..." (golint)
    • Line 120: warning: exported function HandleSuccessReq should have comment or be unexported (golint)
    • Line 129: warning: comment on exported function HandleError should be of the form "HandleError ..." (golint)
    • istio-micro/srv/user/model.go
    • Line 15: warning: exported type User should have comment or be unexported (golint)
    • Line 134: warning: comment on exported method User.Add should be of the form "Add ..." (golint)
    • Line 151: warning: comment on exported method User.Update should be of the form "Update ..." (golint)
    • Line 168: warning: comment on exported method User.Delete should be of the form "Delete ..." (golint)
    • Line 184: warning: comment on exported method User.QueryOne should be of the form "QueryOne ..." (golint)
    • Line 205: warning: comment on exported method User.QueryAll should be of the form "QueryAll ..." (golint)
    • istio-micro/internal/utils/convert.go
    • Line 14: warning: exported function S2ID should have comment or be unexported (golint)
    • Line 28: warning: exported function S2N should have comment or be unexported (golint)
    • Line 39: warning: exported function S2F64 should have comment or be unexported (golint)
    • Line 50: warning: exported function S2I32 should have comment or be unexported (golint)
    • Line 61: warning: exported function Struct2Map should have comment or be unexported (golint)
    • Line 72: warning: exported function OddsCompute should have comment or be unexported (golint)
    • Line 76: warning: exported function Map2Struct should have comment or be unexported (golint)
    • istio-micro/internal/trace/options.go
    • Line 7: warning: comment on exported type Options should be of the form "Options ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported function DefaultOptions should be of the form "DefaultOptions ..." (golint)
    • Line 27: warning: comment on exported method Options.Validate should be of the form "Validate ..." (golint)
    • Line 41: warning: comment on exported method Options.TracingEnabled should be of the form "TracingEnabled ..." (golint)
    • istio-micro/srv/account/account.go
    • Line 13: warning: exported type Server should have comment or be unexported (golint)
    • Line 15: warning: exported method Server.AccountAdd should have comment or be unexported (golint)
    • Line 28: warning: exported method Server.AccountUpdate should have comment or be unexported (golint)
    • Line 42: warning: comment on exported method Server.AccountQueryOne should be of the form "AccountQueryOne ..." (golint)
    • istio-micro/pkg/pprof/pprof.go
    • Line 14: warning: exported const Addr should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported function Run should have comment or be unexported (golint)
    • istio-micro/cinit/common.go
    • Line 12: warning: exported const ReqParam should have comment (or a comment on this block) or be unexported (golint)
    • Line 147: warning: comment on exported function InitOption should be of the form "InitOption ..." (golint)
    • Line 177: warning: comment on exported function Close should be of the form "Close ..." (golint)
    • istio-micro/internal/errors/errors.go
    • Line 13: warning: comment on exported type Error should be of the form "Error ..." (with optional leading article) (golint)
    • Line 26: warning: comment on exported function New should be of the form "New ..." (golint)
    • Line 36: warning: comment on exported function Parse should be of the form "Parse ..." (golint)
    • Line 46: warning: comment on exported function BadRequest should be of the form "BadRequest ..." (golint)
    • Line 56: warning: comment on exported function Unauthorized should be of the form "Unauthorized ..." (golint)
    • Line 66: warning: comment on exported function Forbidden should be of the form "Forbidden ..." (golint)
    • Line 76: warning: comment on exported function NotFound should be of the form "NotFound ..." (golint)
    • Line 86: warning: comment on exported function InternalServerError should be of the form "InternalServerError ..." (golint)
    • Line 96: warning: comment on exported function Conflict should be of the form "Conflict ..." (golint)
    • istio-micro/internal/metrics/metrics.go
    • Line 11: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 15: warning: comment on exported function NewMetrics should be of the form "NewMetrics ..." (golint)
    • Line 21: warning: exported method Metrics.WithPrefix should have comment or be unexported (golint)
    • Line 25: warning: exported method Metrics.GetRegistry should have comment or be unexported (golint)
    • Line 29: warning: exported method Metrics.MemStats should have comment or be unexported (golint)
    • Line 34: warning: comment on exported method Metrics.Log should be of the form "Log ..." (golint)
    • Line 39: warning: comment on exported method Metrics.Graphite should be of the form "Graphite ..." (golint)
    • Line 44: warning: comment on exported method Metrics.InfluxDB should be of the form "InfluxDB ..." (golint)
    • Line 49: warning: comment on exported method Metrics.InfluxDBWithTags should be of the form "InfluxDBWithTags ..." (golint)
    • istio-micro/cinit/kafka.go
    • Line 9: warning: exported var Kf should have comment or be unexported (golint)
    • Line 11: warning: comment on exported function KafkaInit should be of the form "KafkaInit ..." (golint)
    • Line 17: warning: comment on exported function KafkaClose should be of the form "KafkaClose ..." (golint)
    • istio-micro/srv/account/model.go
    • Line 16: warning: exported type Account should have comment or be unexported (golint)
    • Line 65: warning: comment on exported method Account.Add should be of the form "Add ..." (golint)
    • Line 95: warning: comment on exported method Account.Update should be of the form "Update ..." (golint)
    • Line 112: warning: comment on exported method Account.QueryOne should be of the form "QueryOne ..." (golint)
    • istio-micro/internal/jwt/jwt.go
    • Line 13: warning: exported type Msg should have comment or be unexported (golint)
    • Line 18: warning: exported type MyCustomClaims should have comment or be unexported (golint)
    • Line 23: warning: exported function Encode should have comment or be unexported (golint)
    • Line 39: warning: exported function Decode should have comment or be unexported (golint)
    • istio-micro/internal/api/base.go
    • Line 19: warning: exported type ReqParam should have comment or be unexported (golint)
    • Line 43: warning: exported method ReqParam.Decode should have comment or be unexported (golint)
    • Line 51: warning: exported method ReqParam.Validate should have comment or be unexported (golint)
    • Line 64: warning: exported method ReqParam.ValidateAppSecret should have comment or be unexported (golint)
    • Line 72: warning: comment on exported method ReqParam.DataDecode should be of the form "DataDecode ..." (golint)
    • Line 100: warning: comment on exported method ReqParam.DataEncode should be of the form "DataEncode ..." (golint)
    • Line 128: warning: comment on exported method ReqParam.CreateSign should be of the form "CreateSign ..." (golint)
    • Line 158: warning: comment on exported method ReqParam.CompareSign should be of the form "CompareSign ..." (golint)
    • Line 204: warning: comment on exported method ReqParam.R should be of the form "R ..." (golint)
    • istio-micro/api/backend/user.go
    • Line 16: warning: comment on exported function UserAdd should be of the form "UserAdd ..." (golint)
    • Line 36: warning: comment on exported function UserUpdate should be of the form "UserUpdate ..." (golint)
    • Line 62: warning: comment on exported function UserDelete should be of the form "UserDelete ..." (golint)
    • Line 83: warning: comment on exported function UserQueryOne should be of the form "UserQueryOne ..." (golint)
    • Line 103: warning: comment on exported function UserQueryAll should be of the form "UserQueryAll ..." (golint)
    • Line 134: warning: exported const UserName should have comment (or a comment on this block) or be unexported (golint)
    • Line 137: warning: exported type User should have comment or be unexported (golint)
    • Line 142: warning: comment on exported function Login should be of the form "Login ..." (golint)
    • istio-micro/srv/user/cache.go
    • Line 13: warning: exported const CacheIDPrefix should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported function CacheGet should have comment or be unexported (golint)
    • Line 29: warning: exported function CacheSet should have comment or be unexported (golint)
    • Line 47: warning: exported function CacheDel should have comment or be unexported (golint)
    • istio-micro/srv/user/run.go
    • Line 20: warning: exported const SN should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported function Run should have comment or be unexported (golint)
    • istio-micro/srv/user/user.go
    • Line 14: warning: exported type Server should have comment or be unexported (golint)
    • Line 16: warning: exported method Server.UserAdd should have comment or be unexported (golint)
    • Line 39: warning: exported method Server.UserUpdate should have comment or be unexported (golint)
    • Line 62: warning: exported method Server.UserDelete should have comment or be unexported (golint)
    • Line 85: warning: exported method Server.UserQueryOne should have comment or be unexported (golint)
    • Line 108: warning: exported method Server.UserQueryAll should have comment or be unexported (golint)
    • istio-micro/internal/utils/page.go
    • Line 5: warning: comment on exported type Page should be of the form "Page ..." (with optional leading article) (golint)
    • Line 15: warning: exported const PageIndexDefault should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: comment on exported method Page.InitPage should be of the form "InitPage ..." (golint)
    • istio-micro/internal/gateway/server.go
    • Line 19: warning: comment on exported type Endpoint should be of the form "Endpoint ..." (with optional leading article) (golint)
    • Line 24: warning: comment on exported type Options should be of the form "Options ..." (with optional leading article) (golint)
    • Line 43: warning: comment on exported type Option should be of the form "Option ..." (with optional leading article) (golint)
    • Line 46: warning: comment on exported function WithAddr should be of the form "WithAddr ..." (golint)
    • Line 53: warning: comment on exported function WithGRPCServer should be of the form "WithGRPCServer ..." (golint)
    • Line 63: warning: comment on exported function WithSwaggerDir should be of the form "WithSwaggerDir ..." (golint)
    • Line 70: warning: comment on exported function WithMuxOption should be of the form "WithMuxOption ..." (golint)
    • Line 77: warning: comment on exported function WithHandle should be of the form "WithHandle ..." (golint)
    • Line 84: warning: comment on exported function Run should be of the form "Run ..." (golint)
    • istio-micro/internal/sqlupdate/sqlupdate.go
    • Line 13: warning: exported var ErrNoSQLNeedUpdate should have comment or be unexported (golint)
    • Line 16: warning: comment on exported type SQLUpdate should be of the form "SQLUpdate ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported type UpdateRecord should be of the form "UpdateRecord ..." (with optional leading article) (golint)
    • Line 96: warning: comment on exported method SQLUpdate.GetSqls should be of the form "GetSqls ..." (golint)
    • istio-micro/internal/metrics/prometheus/options.go
    • Line 9: warning: exported type Option should have comment or be unexported (golint)
    • Line 11: warning: exported type Options should have comment or be unexported (golint)
    • Line 18: warning: exported function Registry should have comment or be unexported (golint)
    • Line 24: warning: exported function MetricsPath should have comment or be unexported (golint)
    • Line 30: warning: exported function Namespace should have comment or be unexported (golint)
    • Line 36: warning: exported function Subsystem should have comment or be unexported (golint)
    • istio-micro/srv/account/run.go
    • Line 20: warning: exported const SN should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported function Run should have comment or be unexported (golint)
    • istio-micro/internal/utils/time.go
    • Line 8: warning: comment on exported function GenMicTimeStr should be of the form "GenMicTimeStr ..." (golint)
    • Line 13: warning: comment on exported function MicTimeToFormatStr should be of the form "MicTimeToFormatStr ..." (golint)
    • Line 19: warning: comment on exported function GenMicTime should be of the form "GenMicTime ..." (golint)
    • Line 24: warning: comment on exported function MicTimeToStr should be of the form "MicTimeToStr ..." (golint)
    • Line 30: warning: comment on exported function StrMicTimeToStr should be of the form "StrMicTimeToStr ..." (golint)
    • Line 40: warning: comment on exported function StrToMicTime should be of the form "StrToMicTime ..." (golint)
    • istio-micro/internal/api/middle.go
    • Line 17: warning: exported function VerifyParam should have comment or be unexported (golint)
    • Line 50: warning: comment on exported function JWT should be of the form "JWT ..." (golint)
    • Line 73: warning: exported function TraceHeader should have comment or be unexported (golint)
    • Line 80: warning: comment on exported function NoSign should be of the form "NoSign ..." (golint)
    • Line 89: warning: comment on exported function MetricsFunc should be of the form "MetricsFunc ..." (golint)
    • istio-micro/internal/metrics/options.go
    • Line 7: warning: exported type Option should have comment or be unexported (golint)
    • Line 9: warning: exported type Options should have comment or be unexported (golint)
    • Line 14: warning: exported function Registry should have comment or be unexported (golint)
    • Line 20: warning: exported function Prefix should have comment or be unexported (golint)
    • istio-micro/srv/socket/run.go
    • Line 17: warning: exported const SN should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported function Run should have comment or be unexported (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!