Preparing report...

Report for github.com/slime-io/slime

A    Great!    Found 34 issues across 58 files

Tweet

gofmt87%

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!


gocyclo91%

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.


golint48%

Golint is a linter for Go source code.

    • slime/pkg/controller/smartlimiter/multicluster/controller.go
    • Line 26: warning: exported const RootNamespace should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type Controller should have comment or be unexported (golint)
    • Line 42: warning: exported function New should have comment or be unexported (golint)
    • Line 90: warning: exported method Controller.Run should have comment or be unexported (golint)
    • slime/pkg/model/source/k8s/source.go
    • Line 22: warning: exported type Source should have comment or be unexported (golint)
    • Line 39: warning: exported method Source.SetHandler should have comment or be unexported (golint)
    • Line 50: warning: exported method Source.Start should have comment or be unexported (golint)
    • Line 69: warning: comment on exported method Source.WatchAdd should be of the form "WatchAdd ..." (golint)
    • Line 75: warning: exported method Source.Get should have comment or be unexported (golint)
    • Line 79: warning: comment on exported method Source.WatchRemove should be of the form "WatchRemove ..." (golint)
    • Line 84: warning: exported method Source.SourceClusterHandler should have comment or be unexported (golint)
    • Line 99: warning: exported function NewMetricSource should have comment or be unexported (golint)
    • slime/pkg/util/calculator.go
    • Line 9: warning: exported function CalculateTemplate should have comment or be unexported (golint)
    • Line 12: 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 15: 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 21: warning: exported function CalculateTemplateBool should have comment or be unexported (golint)
    • Line 30: 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 33: 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 57: warning: exported type Node should have comment or be unexported (golint)
    • Line 65: warning: exported function Calculate should have comment or be unexported (golint)
    • Line 68: 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 179: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 189: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 195: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 201: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 207: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 214: 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)
    • slime/pkg/controller/controller.go
    • Line 13: warning: exported var UpdateHook should have comment or be unexported (golint)
    • Line 14: warning: exported var DeleteHook should have comment or be unexported (golint)
    • Line 16: warning: exported type Collection should have comment or be unexported (golint)
    • Line 19: warning: exported const VirtualService should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type Worker should have comment or be unexported (golint)
    • Line 47: warning: exported type WorkEventType should have comment or be unexported (golint)
    • Line 50: warning: exported const Add should have comment (or a comment on this block) or be unexported (golint)
    • Line 55: warning: exported type WorkEvent should have comment or be unexported (golint)
    • slime/pkg/bootstrap/config.go
    • Line 12: warning: exported const DefaultModuleConfigPath should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported function GetModuleConfig should have comment or be unexported (golint)
    • Line 37: 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 67: warning: exported type Environment should have comment or be unexported (golint)
    • slime/pkg/controller/servicefence/servicefence_controller.go
    • Line 154: warning: exported function DoUpdate should have comment or be unexported (golint)
    • Line 307: warning: should omit 2nd value from range; this loop is equivalent to `for mk := range ...` (golint)
    • Line 394: 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 399: warning: exported method ReconcileServiceFence.Subscribe should have comment or be unexported (golint)
    • Line 405: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • slime/pkg/controller/smartlimiter/smartlimiter_controller.go
    • Line 30: warning: exported const MATCH_KEY should have comment or be unexported (golint)
    • Line 34: warning: exported function Add should have comment or be unexported (golint)
    • Line 111: warning: exported method ReconcileSmartLimiter.Reconcile should have comment or be unexported (golint)
    • Line 142: warning: exported function DoRemove should have comment or be unexported (golint)
    • Line 156: warning: exported function DoUpdate should have comment or be unexported (golint)
    • Line 169: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • slime/pkg/util/const.go
    • Line 4: warning: comment on exported const Envoy_Ratelimit should be of the form "Envoy_Ratelimit ..." (golint)
    • Line 5: warning: don't use underscores in Go names; const Envoy_Ratelimit should be EnvoyRatelimit (golint)
    • Line 6: warning: don't use underscores in Go names; const Envoy_Cors should be EnvoyCors (golint)
    • Line 6: warning: exported const Envoy_Cors should have comment (or a comment on this block) or be unexported (golint)
    • Line 7: warning: don't use underscores in Go names; const Envoy_FilterHttpWasm should be EnvoyFilterHTTPWasm (golint)
    • Line 8: warning: don't use underscores in Go names; const Envoy_WasmV8 should be EnvoyWasmV8 (golint)
    • Line 9: warning: don't use underscores in Go names; const Envoy_Route should be EnvoyRoute (golint)
    • Line 10: warning: don't use underscores in Go names; const Envoy_HttpConnectionManager should be EnvoyHTTPConnectionManager (golint)
    • Line 11: warning: don't use underscores in Go names; const Envoy_LocalRateLimit should be EnvoyLocalRateLimit (golint)
    • Line 12: warning: don't use underscores in Go names; const Netease_LocalFlowControl should be NeteaseLocalFlowControl (golint)
    • Line 14: warning: don't use underscores in Go names; const Struct_Wasm_Config should be StructWasmConfig (golint)
    • Line 15: warning: don't use underscores in Go names; const Struct_Wasm_Name should be StructWasmName (golint)
    • Line 16: warning: don't use underscores in Go names; const Struct_Wasm_Configuration should be StructWasmConfiguration (golint)
    • Line 18: warning: don't use underscores in Go names; const Struct_Any_TypedUrl should be StructAnyTypedURL (golint)
    • Line 19: warning: don't use underscores in Go names; const Struct_Any_AtType should be StructAnyAtType (golint)
    • Line 20: warning: don't use underscores in Go names; const Struct_Any_Value should be StructAnyValue (golint)
    • Line 22: warning: don't use underscores in Go names; const Struct_HttpFilter_TypedConfig should be StructHTTPFilterTypedConfig (golint)
    • Line 23: warning: don't use underscores in Go names; const Struct_HttpFilter_Name should be StructHTTPFilterName (golint)
    • Line 24: warning: don't use underscores in Go names; const Struct_HttpFilter_TypedPerFilterConfig should be StructHTTPFilterTypedPerFilterConfig (golint)
    • Line 26: warning: don't use underscores in Go names; const Struct_EnvoyLocalRateLimit_Limiter should be StructEnvoyLocalRateLimitLimiter (golint)
    • Line 27: warning: don't use underscores in Go names; const Struct_EnvoyLocalRateLimit_Enabled should be StructEnvoyLocalRateLimitEnabled (golint)
    • Line 28: warning: don't use underscores in Go names; const Struct_EnvoyLocalRateLimit_Enforced should be StructEnvoyLocalRateLimitEnforced (golint)
    • Line 30: warning: don't use underscores in Go names; const TypeUrl_EnvoyFilterHttpWasm should be TypeURLEnvoyFilterHTTPWasm (golint)
    • Line 31: warning: don't use underscores in Go names; const TypeUrl_StringValue should be TypeURLStringValue (golint)
    • Line 32: warning: don't use underscores in Go names; const TypeUrl_UdpaTypedStruct should be TypeURLUdpaTypedStruct (golint)
    • Line 33: warning: don't use underscores in Go names; const TypeUrl_EnvoyLocalRatelimit should be TypeURLEnvoyLocalRatelimit (golint)
    • Line 34: warning: don't use underscores in Go names; const TypeUrl_NeteaseLocalFlowControl should be TypeURLNeteaseLocalFlowControl (golint)
    • Line 36: warning: don't use underscores in Go names; const EnvoyFilter_GlobalSidecar should be EnvoyFilterGlobalSidecar (golint)
    • Line 38: warning: don't use underscores in Go names; const Wellknow_Waidcard should be WellknowWaidcard (golint)
    • Line 39: warning: don't use underscores in Go names; const Wellknow_RootPath should be WellknowRootPath (golint)
    • Line 40: warning: don't use underscores in Go names; const Wellkonw_BaseSet should be WellkonwBaseSet (golint)
    • Line 41: warning: don't use underscores in Go names; const Wellkonw_K8sSuffix should be WellkonwK8sSuffix (golint)
    • slime/test/mock.go
    • Line 19: warning: exported type MockClient should have comment or be unexported (golint)
    • Line 23: warning: exported method MockClient.Get should have comment or be unexported (golint)
    • Line 44: warning: exported method MockClient.List should have comment or be unexported (golint)
    • Line 48: warning: exported method MockClient.Create should have comment or be unexported (golint)
    • Line 52: warning: exported method MockClient.Delete should have comment or be unexported (golint)
    • Line 56: warning: exported method MockClient.Update should have comment or be unexported (golint)
    • Line 74: warning: exported method MockClient.Patch should have comment or be unexported (golint)
    • Line 78: warning: exported method MockClient.DeleteAllOf should have comment or be unexported (golint)
    • Line 82: warning: exported method MockClient.Status should have comment or be unexported (golint)
    • Line 86: warning: exported function IsEqual should have comment or be unexported (golint)
    • slime/pkg/util/stack.go
    • Line 3: warning: exported type Queue should have comment or be unexported (golint)
    • Line 10: warning: exported type FILOStack should have comment or be unexported (golint)
    • Line 14: warning: exported method FILOStack.Length should have comment or be unexported (golint)
    • Line 18: warning: exported function NewFILOStack should have comment or be unexported (golint)
    • Line 24: warning: exported method FILOStack.Pop should have comment or be unexported (golint)
    • Line 33: warning: exported method FILOStack.Push should have comment or be unexported (golint)
    • Line 37: warning: exported method FILOStack.Peek should have comment or be unexported (golint)
    • Line 45: warning: exported type FIFOStack should have comment or be unexported (golint)
    • Line 49: warning: exported method FIFOStack.Length should have comment or be unexported (golint)
    • Line 53: warning: exported function NewFIFOStack should have comment or be unexported (golint)
    • Line 59: warning: exported method FIFOStack.Pop should have comment or be unexported (golint)
    • Line 68: warning: exported method FIFOStack.Push should have comment or be unexported (golint)
    • Line 72: warning: exported method FIFOStack.Peek should have comment or be unexported (golint)
    • slime/pkg/util/util.go
    • Line 21: warning: comment on exported function IsContain should be of the form "IsContain ..." (golint)
    • Line 34: warning: exported function CopyMap should have comment or be unexported (golint)
    • Line 42: warning: exported function MapToMapInterface should have comment or be unexported (golint)
    • Line 76: 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 83: warning: comment on exported function MessageToStruct should be of the form "MessageToStruct ..." (golint)
    • Line 102: warning: exported function ProtoToMap should have comment or be unexported (golint)
    • Line 110: 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 118: warning: exported function Make should have comment or be unexported (golint)
    • Line 126: warning: exported function FromJSONMap should have comment or be unexported (golint)
    • Line 188: warning: comment on exported function IsK8SService should be of the form "IsK8SService ..." (golint)
    • Line 197: warning: exported function UnityHost should have comment or be unexported (golint)
    • Line 203: 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 208: warning: comment on exported type SubcribeableMap should be of the form "SubcribeableMap ..." (with optional leading article) (golint)
    • Line 215: warning: exported function NewSubcribeableMap should have comment or be unexported (golint)
    • Line 223: warning: exported method SubcribeableMap.Set should have comment or be unexported (golint)
    • Line 232: warning: exported method SubcribeableMap.Get should have comment or be unexported (golint)
    • Line 239: warning: exported method SubcribeableMap.Subscribe should have comment or be unexported (golint)
    • slime/pkg/model/source/source.go
    • Line 10: warning: exported type Source should have comment or be unexported (golint)
    • Line 17: warning: exported type EventType should have comment or be unexported (golint)
    • Line 20: warning: exported const Add should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type Event should have comment or be unexported (golint)
    • slime/pkg/model/source/aggregate/source.go
    • Line 8: warning: exported type Source should have comment or be unexported (golint)
    • Line 12: warning: exported method Source.Start should have comment or be unexported (golint)
    • Line 18: warning: exported method Source.WatchAdd should have comment or be unexported (golint)
    • Line 24: warning: exported method Source.WatchRemove should have comment or be unexported (golint)
    • Line 30: warning: exported method Source.Get should have comment or be unexported (golint)
    • Line 40: warning: exported method Source.AppendSource should have comment or be unexported (golint)
    • slime/pkg/controller/smartlimiter/process.go
    • Line 89: warning: exported method ReconcileSmartLimiter.WatchSource should have comment or be unexported (golint)
    • Line 107: warning: exported method ReconcileSmartLimiter.Refresh should have comment or be unexported (golint)
    • Line 140: 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)
    • slime/pkg/apis/microservice/v1alpha1/wrapper/netease_types.go
    • Line 14: warning: exported type NeteaseType should have comment or be unexported (golint)
    • Line 21: warning: exported type EnvoyPlugin should have comment or be unexported (golint)
    • Line 47: warning: comment on exported type EnvoyPluginList should be of the form "EnvoyPluginList ..." (with optional leading article) (golint)
    • Line 114: warning: exported type PluginManager should have comment or be unexported (golint)
    • Line 140: warning: comment on exported type PluginManagerList should be of the form "PluginManagerList ..." (with optional leading article) (golint)
    • slime/pkg/controller/pluginmanager/wasm/source.go
    • Line 5: warning: exported type Getter should have comment or be unexported (golint)
    • Line 9: warning: exported type LocalSource should have comment or be unexported (golint)
    • Line 13: warning: exported method LocalSource.Get should have comment or be unexported (golint)
    • Line 16: warning: if block ends with a return statement, so drop this else and outdent its block (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell98%

Misspell Finds commonly misspelled English words