Preparing report...

Report for github.com/alibaba/sentinel-golang

A    Great!    Found 114 issues across 221 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!


gocyclo97%

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.

    • sentinel-golang/core/hotspot/cache/concurrent_lru.go
    • Line 28: warning: exported method LruCacheMap.Add should have comment or be unexported (golint)
    • Line 36: warning: exported method LruCacheMap.AddIfAbsent should have comment or be unexported (golint)
    • Line 47: warning: exported method LruCacheMap.Get should have comment or be unexported (golint)
    • Line 58: warning: exported method LruCacheMap.Remove should have comment or be unexported (golint)
    • Line 65: warning: exported method LruCacheMap.Contains should have comment or be unexported (golint)
    • Line 72: warning: exported method LruCacheMap.Keys should have comment or be unexported (golint)
    • Line 79: warning: exported method LruCacheMap.Len should have comment or be unexported (golint)
    • Line 86: warning: exported method LruCacheMap.Purge should have comment or be unexported (golint)
    • Line 93: warning: exported function NewLRUCacheMap should have comment or be unexported (golint)
    • sentinel-golang/core/flow/slot.go
    • Line 26: warning: exported const RuleCheckSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported var DefaultSlot should have comment or be unexported (golint)
    • Line 33: warning: exported type Slot should have comment or be unexported (golint)
    • Line 36: warning: exported method Slot.Order should have comment or be unexported (golint)
    • Line 40: warning: exported method Slot.Check should have comment or be unexported (golint)
    • sentinel-golang/core/flow/tc_warm_up.go
    • Line 27: warning: exported type WarmUpTrafficShapingCalculator should have comment or be unexported (golint)
    • Line 39: warning: exported method WarmUpTrafficShapingCalculator.BoundOwner should have comment or be unexported (golint)
    • Line 43: warning: exported function NewWarmUpTrafficShapingCalculator should have comment or be unexported (golint)
    • Line 70: warning: exported method WarmUpTrafficShapingCalculator.CalculateAllowedTokens should have comment or be unexported (golint)
    • Line 83: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 124: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • sentinel-golang/pkg/datasource/k8s/k8s.go
    • Line 13: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 31: warning: exported type CRDType should have comment or be unexported (golint)
    • Line 34: warning: exported const FlowRulesCRD should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: exported type DataSource should have comment or be unexported (golint)
    • sentinel-golang/core/hotspot/slot.go
    • Line 23: warning: exported const RuleCheckSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported var DefaultSlot should have comment or be unexported (golint)
    • Line 30: warning: exported type Slot should have comment or be unexported (golint)
    • Line 33: warning: exported method Slot.Order should have comment or be unexported (golint)
    • Line 37: warning: exported method Slot.Check should have comment or be unexported (golint)
    • sentinel-golang/core/circuitbreaker/stat_slot.go
    • Line 22: warning: exported const StatSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported var DefaultMetricStatSlot should have comment or be unexported (golint)
    • Line 34: warning: exported method MetricStatSlot.Order should have comment or be unexported (golint)
    • Line 38: warning: exported method MetricStatSlot.OnEntryPassed should have comment or be unexported (golint)
    • Line 38: warning: receiver name c should be consistent with previous receiver name s for MetricStatSlot (golint)
    • Line 43: warning: exported method MetricStatSlot.OnEntryBlocked should have comment or be unexported (golint)
    • Line 43: warning: receiver name c should be consistent with previous receiver name s for MetricStatSlot (golint)
    • Line 48: warning: exported method MetricStatSlot.OnCompleted should have comment or be unexported (golint)
    • Line 48: warning: receiver name c should be consistent with previous receiver name s for MetricStatSlot (golint)
    • sentinel-golang/core/flow/tc_adaptive.go
    • Line 23: warning: exported function NewMemoryAdaptiveTrafficShapingCalculator should have comment or be unexported (golint)
    • Line 33: warning: exported method MemoryAdaptiveTrafficShapingCalculator.BoundOwner should have comment or be unexported (golint)
    • Line 37: warning: exported method MemoryAdaptiveTrafficShapingCalculator.CalculateAllowedTokens should have comment or be unexported (golint)
    • sentinel-golang/core/log/metric/searcher.go
    • Line 31: warning: exported type DefaultMetricSearcher should have comment or be unexported (golint)
    • Line 52: warning: exported method DefaultMetricSearcher.FindByTimeAndResource should have comment or be unexported (golint)
    • Line 58: warning: exported method DefaultMetricSearcher.FindFromTimeWithMaxLines should have comment or be unexported (golint)
    • Line 198: warning: exported function NewDefaultMetricSearcher should have comment or be unexported (golint)
    • sentinel-golang/core/stat/stat_prepare_slot.go
    • Line 22: warning: exported const PrepareSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported var DefaultResourceNodePrepareSlot should have comment or be unexported (golint)
    • Line 29: warning: exported type ResourceNodePrepareSlot should have comment or be unexported (golint)
    • Line 32: warning: exported method ResourceNodePrepareSlot.Order should have comment or be unexported (golint)
    • Line 36: warning: exported method ResourceNodePrepareSlot.Prepare should have comment or be unexported (golint)
    • sentinel-golang/ext/datasource/file/refreshable_file.go
    • Line 29: warning: exported type RefreshableFileDataSource should have comment or be unexported (golint)
    • Line 38: warning: exported function NewFileDataSource should have comment or be unexported (golint)
    • Line 49: warning: exported method RefreshableFileDataSource.ReadSource should have comment or be unexported (golint)
    • Line 63: warning: exported method RefreshableFileDataSource.Initialize should have comment or be unexported (golint)
    • Line 146: warning: exported method RefreshableFileDataSource.Close should have comment or be unexported (golint)
    • sentinel-golang/api/init.go
    • Line 27: warning: comment on exported function InitDefault should be of the form "InitDefault ..." (golint)
    • Line 73: warning: comment on exported function InitWithConfigFile should be of the form "InitWithConfigFile ..." (golint)
    • sentinel-golang/core/hotspot/concurrency_stat_slot.go
    • Line 25: warning: exported const StatSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported var DefaultConcurrencyStatSlot should have comment or be unexported (golint)
    • Line 36: warning: exported method ConcurrencyStatSlot.Order should have comment or be unexported (golint)
    • Line 40: warning: exported method ConcurrencyStatSlot.OnEntryPassed should have comment or be unexported (golint)
    • Line 40: warning: receiver name c should be consistent with previous receiver name s for ConcurrencyStatSlot (golint)
    • Line 63: warning: exported method ConcurrencyStatSlot.OnEntryBlocked should have comment or be unexported (golint)
    • Line 63: warning: receiver name c should be consistent with previous receiver name s for ConcurrencyStatSlot (golint)
    • Line 67: warning: exported method ConcurrencyStatSlot.OnCompleted should have comment or be unexported (golint)
    • Line 67: warning: receiver name c should be consistent with previous receiver name s for ConcurrencyStatSlot (golint)
    • sentinel-golang/core/circuitbreaker/slot.go
    • Line 22: warning: exported const RuleCheckSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported var DefaultSlot should have comment or be unexported (golint)
    • Line 29: warning: exported type Slot should have comment or be unexported (golint)
    • Line 32: warning: exported method Slot.Order should have comment or be unexported (golint)
    • Line 36: warning: exported method Slot.Check should have comment or be unexported (golint)
    • Line 36: warning: receiver name b should be consistent with previous receiver name s for Slot (golint)
    • sentinel-golang/core/base/resource.go
    • Line 23: warning: exported const ResTypeCommon should have comment (or a comment on this block) or be unexported (golint)
    • Line 67: warning: exported method ResourceWrapper.Name should have comment or be unexported (golint)
    • Line 71: warning: exported method ResourceWrapper.Classification should have comment or be unexported (golint)
    • Line 75: warning: exported method ResourceWrapper.FlowType should have comment or be unexported (golint)
    • Line 79: warning: exported function NewResourceWrapper should have comment or be unexported (golint)
    • sentinel-golang/api/slot_chain.go
    • Line 30: warning: exported function GlobalSlotChain should have comment or be unexported (golint)
    • Line 34: warning: exported function BuildDefaultSlotChain should have comment or be unexported (golint)
    • sentinel-golang/core/system/slot.go
    • Line 24: warning: exported const RuleCheckSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: exported var DefaultAdaptiveSlot should have comment or be unexported (golint)
    • Line 31: warning: exported type AdaptiveSlot should have comment or be unexported (golint)
    • Line 34: warning: exported method AdaptiveSlot.Order should have comment or be unexported (golint)
    • Line 38: warning: exported method AdaptiveSlot.Check should have comment or be unexported (golint)
    • sentinel-golang/core/config/config.go
    • Line 35: warning: exported function ResetGlobalConfig should have comment or be unexported (golint)
    • Line 63: warning: exported function OverrideConfigFromEnvAndInitLog should have comment or be unexported (golint)
    • Line 124: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 133: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 178: warning: exported function GetDefaultLogDir should have comment or be unexported (golint)
    • Line 186: warning: exported function AppName should have comment or be unexported (golint)
    • Line 190: warning: exported function AppType should have comment or be unexported (golint)
    • Line 194: warning: exported function Logger should have comment or be unexported (golint)
    • Line 198: warning: exported function LogBaseDir should have comment or be unexported (golint)
    • Line 207: warning: exported function MetricLogFlushIntervalSec should have comment or be unexported (golint)
    • Line 211: warning: exported function MetricLogSingleFileMaxSize should have comment or be unexported (golint)
    • Line 215: warning: exported function MetricLogMaxFileAmount should have comment or be unexported (golint)
    • Line 219: warning: exported function SystemStatCollectIntervalMs should have comment or be unexported (golint)
    • Line 223: warning: exported function LoadStatCollectIntervalMs should have comment or be unexported (golint)
    • Line 227: warning: exported function CpuStatCollectIntervalMs should have comment or be unexported (golint)
    • Line 231: warning: exported function MemoryStatCollectIntervalMs should have comment or be unexported (golint)
    • Line 235: warning: exported function UseCacheTime should have comment or be unexported (golint)
    • Line 239: warning: exported function GlobalStatisticIntervalMsTotal should have comment or be unexported (golint)
    • Line 243: warning: exported function GlobalStatisticSampleCountTotal should have comment or be unexported (golint)
    • Line 247: warning: exported function GlobalStatisticBucketLengthInMs should have comment or be unexported (golint)
    • Line 251: warning: exported function MetricStatisticIntervalMs should have comment or be unexported (golint)
    • Line 254: warning: exported function MetricStatisticSampleCount should have comment or be unexported (golint)
    • sentinel-golang/core/base/slot_chain.go
    • Line 26: warning: exported type BaseSlot should have comment or be unexported (golint)
    • Line 104: warning: exported function NewSlotChain should have comment or be unexported (golint)
    • Line 113: warning: comment on exported method SlotChain.GetPooledContext should be of the form "GetPooledContext ..." (golint)
    • Line 120: warning: exported method SlotChain.RefurbishContext should have comment or be unexported (golint)
    • Line 160: warning: comment on exported method SlotChain.Entry should be of the form "Entry ..." (golint)
    • sentinel-golang/pkg/datasource/nacos/nacos.go
    • Line 14: warning: exported type NacosDataSource should have comment or be unexported (golint)
    • Line 22: warning: exported function NewNacosDataSource should have comment or be unexported (golint)
    • Line 41: warning: exported method NacosDataSource.Initialize should have comment or be unexported (golint)
    • Line 59: warning: exported method NacosDataSource.ReadSource should have comment or be unexported (golint)
    • Line 95: warning: exported method NacosDataSource.Close should have comment or be unexported (golint)
    • sentinel-golang/core/stat/stat_slot.go
    • Line 23: warning: exported const StatSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported var DefaultSlot should have comment or be unexported (golint)
    • Line 30: warning: exported type Slot should have comment or be unexported (golint)
    • Line 33: warning: exported method Slot.Order should have comment or be unexported (golint)
    • Line 37: warning: exported method Slot.OnEntryPassed should have comment or be unexported (golint)
    • Line 44: warning: exported method Slot.OnEntryBlocked should have comment or be unexported (golint)
    • Line 51: warning: exported method Slot.OnCompleted should have comment or be unexported (golint)
    • sentinel-golang/core/hotspot/traffic_shaping.go
    • Line 31: warning: exported type TrafficShapingController should have comment or be unexported (golint)
    • Line 283: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 372: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • sentinel-golang/core/base/stat.go
    • Line 21: warning: exported type TimePredicate should have comment or be unexported (golint)
    • Line 23: warning: exported type MetricEvent should have comment or be unexported (golint)
    • Line 47: warning: exported type ReadStat should have comment or be unexported (golint)
    • Line 56: warning: exported function NopReadStat should have comment or be unexported (golint)
    • Line 83: warning: exported type WriteStat should have comment or be unexported (golint)
    • Line 87: warning: exported function NopWriteStat should have comment or be unexported (golint)
    • Line 97: warning: exported type ConcurrencyStat should have comment or be unexported (golint)
    • Line 117: warning: error var IllegalGlobalStatisticParamsError should have name of the form ErrFoo (golint)
    • Line 117: warning: exported var IllegalGlobalStatisticParamsError should have comment or be unexported (golint)
    • Line 118: warning: error var IllegalStatisticParamsError should have name of the form ErrFoo (golint)
    • Line 119: warning: error var GlobalStatisticNonReusableError should have name of the form ErrFoo (golint)
    • Line 122: warning: exported function CheckValidityForStatistic should have comment or be unexported (golint)
    • sentinel-golang/ext/datasource/datasource.go
    • Line 24: warning: comment on exported type DataSource should be of the form "DataSource ..." (with optional leading article) (golint)
    • Line 43: warning: exported type Base should have comment or be unexported (golint)
    • Line 47: warning: exported method Base.Handle should have comment or be unexported (golint)
    • Line 70: warning: exported method Base.AddPropertyHandler should have comment or be unexported (golint)
    • Line 77: warning: exported method Base.RemovePropertyHandler should have comment or be unexported (golint)
    • sentinel-golang/util/time.go
    • Line 24: warning: exported const TimeFormat should have comment (or a comment on this block) or be unexported (golint)
    • Line 55: warning: exported type Clock should have comment or be unexported (golint)
    • Line 70: warning: exported function NewRealClock should have comment or be unexported (golint)
    • Line 74: warning: exported method RealClock.Now should have comment or be unexported (golint)
    • Line 78: warning: exported method RealClock.Sleep should have comment or be unexported (golint)
    • Line 82: warning: exported method RealClock.CurrentTimeMillis should have comment or be unexported (golint)
    • Line 90: warning: exported method RealClock.CurrentTimeNano should have comment or be unexported (golint)
    • Line 100: warning: exported function NewMockClock should have comment or be unexported (golint)
    • Line 106: warning: exported method MockClock.Now should have comment or be unexported (golint)
    • Line 112: warning: exported method MockClock.Sleep should have comment or be unexported (golint)
    • Line 122: warning: exported method MockClock.CurrentTimeMillis should have comment or be unexported (golint)
    • Line 126: warning: exported method MockClock.CurrentTimeNano should have comment or be unexported (golint)
    • Line 141: warning: exported function NewRealTicker should have comment or be unexported (golint)
    • Line 147: warning: exported method RealTicker.C should have comment or be unexported (golint)
    • Line 151: warning: exported method RealTicker.Stop should have comment or be unexported (golint)
    • Line 165: warning: exported function NewMockTicker should have comment or be unexported (golint)
    • Line 178: warning: exported method MockTicker.C should have comment or be unexported (golint)
    • Line 182: warning: exported method MockTicker.Stop should have comment or be unexported (golint)
    • Line 227: warning: exported function NewRealTickerCreator should have comment or be unexported (golint)
    • Line 231: warning: exported method RealTickerCreator.NewTicker should have comment or be unexported (golint)
    • Line 239: warning: exported function NewMockTickerCreator should have comment or be unexported (golint)
    • Line 243: warning: exported method MockTickerCreator.NewTicker should have comment or be unexported (golint)
    • Line 258: warning: comment on exported function SetTickerCreator should be of the form "SetTickerCreator ..." (golint)
    • Line 269: warning: exported function NewTicker should have comment or be unexported (golint)
    • Line 283: warning: comment on exported function CurrentTimeMillis should be of the form "CurrentTimeMillis ..." (golint)
    • Line 288: warning: comment on exported function CurrentTimeNano should be of the form "CurrentTimeNano ..." (golint)
    • sentinel-golang/util/atomic.go
    • Line 19: warning: exported type AtomicBool should have comment or be unexported (golint)
    • Line 24: warning: exported method AtomicBool.CompareAndSet should have comment or be unexported (golint)
    • Line 38: warning: exported method AtomicBool.Set should have comment or be unexported (golint)
    • Line 46: warning: exported method AtomicBool.Get should have comment or be unexported (golint)
    • sentinel-golang/pkg/adapters/micro/options.go
    • Line 12: warning: exported type Option should have comment or be unexported (golint)
    • Line 29: warning: comment on exported function WithClientResourceExtractor should be of the form "WithClientResourceExtractor ..." (golint)
    • Line 37: warning: comment on exported function WithServerResourceExtractor should be of the form "WithServerResourceExtractor ..." (golint)
    • Line 58: warning: comment on exported function WithClientBlockFallback should be of the form "WithClientBlockFallback ..." (golint)
    • Line 66: warning: comment on exported function WithServerBlockFallback should be of the form "WithServerBlockFallback ..." (golint)
    • sentinel-golang/pkg/datasource/etcdv3/etcdv3_example.go
    • Line 13: warning: comment on exported function Example_ClientWithOneDatasource should be of the form "Example_ClientWithOneDatasource ..." (golint)
    • Line 14: warning: don't use underscores in Go names; func Example_ClientWithOneDatasource should be ExampleClientWithOneDatasource (golint)
    • Line 42: warning: comment on exported function Example_ClientWithMultiDatasource should be of the form "Example_ClientWithMultiDatasource ..." (golint)
    • Line 43: warning: don't use underscores in Go names; func Example_ClientWithMultiDatasource should be ExampleClientWithMultiDatasource (golint)
    • sentinel-golang/ext/datasource/error.go
    • Line 17: warning: exported type Code should have comment or be unexported (golint)
    • Line 20: warning: exported const OK should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported function NewError should have comment or be unexported (golint)
    • Line 33: warning: exported type Error should have comment or be unexported (golint)
    • Line 38: warning: exported method Error.Code should have comment or be unexported (golint)
    • sentinel-golang/core/log/metric/writer.go
    • Line 34: warning: exported type DefaultMetricLogWriter should have comment or be unexported (golint)
    • Line 105: warning: exported method DefaultMetricLogWriter.Close should have comment or be unexported (golint)
    • Line 289: warning: exported function NewDefaultMetricLogWriter should have comment or be unexported (golint)
    • Line 293: warning: exported function NewDefaultMetricLogWriterOfApp should have comment or be unexported (golint)
    • sentinel-golang/core/base/entry.go
    • Line 24: warning: exported type ExitHandler should have comment or be unexported (golint)
    • Line 26: warning: exported type SentinelEntry should have comment or be unexported (golint)
    • Line 39: warning: exported function NewSentinelEntry should have comment or be unexported (golint)
    • Line 48: warning: exported method SentinelEntry.WhenExit should have comment or be unexported (golint)
    • Line 52: warning: exported method SentinelEntry.SetError should have comment or be unexported (golint)
    • Line 58: warning: exported method SentinelEntry.Context should have comment or be unexported (golint)
    • Line 62: warning: exported method SentinelEntry.Resource should have comment or be unexported (golint)
    • Line 66: warning: exported type ExitOptions should have comment or be unexported (golint)
    • Line 69: warning: exported type ExitOption should have comment or be unexported (golint)
    • Line 71: warning: exported function WithError should have comment or be unexported (golint)
    • Line 77: warning: exported method SentinelEntry.Exit should have comment or be unexported (golint)
    • sentinel-golang/core/flow/standalone_stat_slot.go
    • Line 24: warning: exported const StatSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: exported var DefaultStandaloneStatSlot should have comment or be unexported (golint)
    • Line 31: warning: exported type StandaloneStatSlot should have comment or be unexported (golint)
    • Line 34: warning: exported method StandaloneStatSlot.Order should have comment or be unexported (golint)
    • Line 38: warning: exported method StandaloneStatSlot.OnEntryPassed should have comment or be unexported (golint)
    • Line 51: warning: exported method StandaloneStatSlot.OnEntryBlocked should have comment or be unexported (golint)
    • Line 55: warning: exported method StandaloneStatSlot.OnCompleted should have comment or be unexported (golint)
    • sentinel-golang/core/config/entity.go
    • Line 26: warning: exported type Entity should have comment or be unexported (golint)
    • Line 133: warning: exported function CheckValid should have comment or be unexported (golint)
    • Line 172: warning: exported method Entity.AppName should have comment or be unexported (golint)
    • Line 176: warning: exported method Entity.AppType should have comment or be unexported (golint)
    • Line 180: warning: exported method Entity.LogBaseDir should have comment or be unexported (golint)
    • Line 184: warning: exported method Entity.Logger should have comment or be unexported (golint)
    • Line 193: warning: exported method Entity.MetricLogFlushIntervalSec should have comment or be unexported (golint)
    • Line 197: warning: exported method Entity.MetricLogSingleFileMaxSize should have comment or be unexported (golint)
    • Line 201: warning: exported method Entity.MetricLogMaxFileAmount should have comment or be unexported (golint)
    • Line 205: warning: exported method Entity.SystemStatCollectIntervalMs should have comment or be unexported (golint)
    • Line 209: warning: exported method Entity.LoadStatCollectIntervalMs should have comment or be unexported (golint)
    • Line 213: warning: exported method Entity.CpuStatCollectIntervalMs should have comment or be unexported (golint)
    • Line 217: warning: exported method Entity.MemoryStatCollectIntervalMs should have comment or be unexported (golint)
    • Line 221: warning: exported method Entity.UseCacheTime should have comment or be unexported (golint)
    • Line 225: warning: exported method Entity.GlobalStatisticIntervalMsTotal should have comment or be unexported (golint)
    • Line 229: warning: exported method Entity.GlobalStatisticSampleCountTotal should have comment or be unexported (golint)
    • Line 233: warning: exported method Entity.MetricStatisticIntervalMs should have comment or be unexported (golint)
    • Line 236: warning: exported method Entity.MetricStatisticSampleCount should have comment or be unexported (golint)
    • sentinel-golang/core/system/rule.go
    • Line 22: warning: exported type MetricType should have comment or be unexported (golint)
    • Line 57: warning: exported type AdaptiveStrategy should have comment or be unexported (golint)
    • Line 60: warning: exported const NoAdaptive should have comment (or a comment on this block) or be unexported (golint)
    • Line 99: warning: exported method Rule.ResourceName should have comment or be unexported (golint)
    • sentinel-golang/core/base/block_error.go
    • Line 30: warning: exported type BlockErrorOption should have comment or be unexported (golint)
    • Line 32: warning: exported function WithBlockType should have comment or be unexported (golint)
    • Line 38: warning: exported function WithBlockMsg should have comment or be unexported (golint)
    • Line 44: warning: exported function WithRule should have comment or be unexported (golint)
    • Line 50: warning: exported function WithSnapshotValue should have comment or be unexported (golint)
    • Line 56: warning: exported function NewBlockError should have comment or be unexported (golint)
    • Line 67: warning: exported method BlockError.ResetBlockError should have comment or be unexported (golint)
    • Line 74: warning: exported method BlockError.BlockMsg should have comment or be unexported (golint)
    • Line 78: warning: exported method BlockError.BlockType should have comment or be unexported (golint)
    • Line 82: warning: exported method BlockError.TriggeredRule should have comment or be unexported (golint)
    • Line 86: warning: exported method BlockError.TriggeredValue should have comment or be unexported (golint)
    • Line 90: warning: exported function NewBlockErrorFromDeepCopy should have comment or be unexported (golint)
    • Line 99: warning: exported function NewBlockErrorWithMessage should have comment or be unexported (golint)
    • Line 103: warning: exported function NewBlockErrorWithCause should have comment or be unexported (golint)
    • sentinel-golang/core/base/metric_item.go
    • Line 43: warning: exported type MetricItemRetriever should have comment or be unexported (golint)
    • Line 47: warning: exported method MetricItem.ToFatString should have comment or be unexported (golint)
    • Line 62: warning: exported method MetricItem.ToThinString should have comment or be unexported (golint)
    • Line 75: warning: exported function MetricItemFromFatString should have comment or be unexported (golint)
    • sentinel-golang/core/stat/resource_node.go
    • Line 22: warning: exported type ResourceNode should have comment or be unexported (golint)
    • Line 38: warning: exported method ResourceNode.ResourceType should have comment or be unexported (golint)
    • Line 42: warning: exported method ResourceNode.ResourceName should have comment or be unexported (golint)
    • sentinel-golang/core/stat/base_node.go
    • Line 25: warning: exported type BaseStatNode should have comment or be unexported (golint)
    • Line 35: warning: exported function NewBaseStatNode should have comment or be unexported (golint)
    • Line 47: warning: exported method BaseStatNode.MetricsOnCondition should have comment or be unexported (golint)
    • Line 51: warning: exported method BaseStatNode.GetQPS should have comment or be unexported (golint)
    • Line 55: warning: exported method BaseStatNode.GetPreviousQPS should have comment or be unexported (golint)
    • Line 59: warning: exported method BaseStatNode.GetSum should have comment or be unexported (golint)
    • Line 63: warning: exported method BaseStatNode.GetMaxAvg should have comment or be unexported (golint)
    • Line 67: warning: exported method BaseStatNode.AddCount should have comment or be unexported (golint)
    • Line 71: warning: exported method BaseStatNode.UpdateConcurrency should have comment or be unexported (golint)
    • Line 75: warning: exported method BaseStatNode.AvgRT should have comment or be unexported (golint)
    • Line 83: warning: exported method BaseStatNode.MinRT should have comment or be unexported (golint)
    • Line 87: warning: exported method BaseStatNode.MaxConcurrency should have comment or be unexported (golint)
    • Line 91: warning: exported method BaseStatNode.CurrentConcurrency should have comment or be unexported (golint)
    • Line 95: warning: exported method BaseStatNode.IncreaseConcurrency should have comment or be unexported (golint)
    • Line 99: warning: exported method BaseStatNode.DecreaseConcurrency should have comment or be unexported (golint)
    • Line 103: warning: exported method BaseStatNode.GenerateReadStat should have comment or be unexported (golint)
    • Line 107: warning: exported method BaseStatNode.DefaultMetric should have comment or be unexported (golint)
    • sentinel-golang/util/file.go
    • Line 23: warning: exported function FilePosition should have comment or be unexported (golint)
    • Line 30: warning: exported function FileExists should have comment or be unexported (golint)
    • Line 40: warning: exported function CreateDirIfNotExists should have comment or be unexported (golint)
    • Line 44: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • sentinel-golang/core/stat/node_storage.go
    • Line 24: warning: exported type ResourceNodeMap should have comment or be unexported (golint)
    • Line 50: warning: exported function GetResourceNode should have comment or be unexported (golint)
    • Line 57: warning: exported function GetOrCreateResourceNode should have comment or be unexported (golint)
    • Line 78: warning: exported function ResetResourceNodeMap should have comment or be unexported (golint)
    • sentinel-golang/core/flow/traffic_shaping.go
    • Line 50: warning: exported type TrafficShapingController should have comment or be unexported (golint)
    • Line 59: warning: exported function NewTrafficShapingController should have comment or be unexported (golint)
    • Line 63: warning: exported method TrafficShapingController.BoundRule should have comment or be unexported (golint)
    • Line 67: warning: exported method TrafficShapingController.FlowChecker should have comment or be unexported (golint)
    • Line 71: warning: exported method TrafficShapingController.FlowCalculator should have comment or be unexported (golint)
    • Line 75: warning: exported method TrafficShapingController.PerformChecking should have comment or be unexported (golint)
    • sentinel-golang/pkg/datasource/etcdv3/etcdv3.go
    • Line 15: warning: exported type Etcdv3DataSource should have comment or be unexported (golint)
    • Line 42: warning: exported method Etcdv3DataSource.Initialize should have comment or be unexported (golint)
    • Line 51: warning: exported method Etcdv3DataSource.ReadSource should have comment or be unexported (golint)
    • Line 128: warning: exported method Etcdv3DataSource.Close should have comment or be unexported (golint)
    • sentinel-golang/core/stat/base/sliding_window_metric.go
    • Line 38: warning: comment on exported function NewSlidingWindowMetric should be of the form "NewSlidingWindowMetric ..." (golint)
    • Line 87: warning: exported method SlidingWindowMetric.GetSum should have comment or be unexported (golint)
    • Line 96: warning: exported method SlidingWindowMetric.GetQPS should have comment or be unexported (golint)
    • Line 100: warning: exported method SlidingWindowMetric.GetPreviousQPS should have comment or be unexported (golint)
    • Line 116: warning: exported method SlidingWindowMetric.GetMaxOfSingleBucket should have comment or be unexported (golint)
    • Line 139: warning: exported method SlidingWindowMetric.MinRT should have comment or be unexported (golint)
    • Line 165: warning: exported method SlidingWindowMetric.MaxConcurrency should have comment or be unexported (golint)
    • Line 188: warning: exported method SlidingWindowMetric.AvgRT should have comment or be unexported (golint)
    • sentinel-golang/core/flow/tc_default.go
    • Line 21: warning: exported type DirectTrafficShapingCalculator should have comment or be unexported (golint)
    • Line 26: warning: exported function NewDirectTrafficShapingCalculator should have comment or be unexported (golint)
    • Line 33: warning: exported method DirectTrafficShapingCalculator.CalculateAllowedTokens should have comment or be unexported (golint)
    • Line 37: warning: exported method DirectTrafficShapingCalculator.BoundOwner should have comment or be unexported (golint)
    • Line 41: warning: exported type RejectTrafficShapingChecker should have comment or be unexported (golint)
    • Line 46: warning: exported function NewRejectTrafficShapingChecker should have comment or be unexported (golint)
    • Line 53: warning: exported method RejectTrafficShapingChecker.BoundOwner should have comment or be unexported (golint)
    • Line 57: warning: exported method RejectTrafficShapingChecker.DoCheck should have comment or be unexported (golint)
    • sentinel-golang/core/flow/tc_throttling.go
    • Line 27: warning: exported const BlockMsgQueueing should have comment (or a comment on this block) or be unexported (golint)
    • Line 40: warning: exported function NewThrottlingChecker should have comment or be unexported (golint)
    • Line 54: warning: exported method ThrottlingChecker.BoundOwner should have comment or be unexported (golint)
    • Line 58: warning: exported method ThrottlingChecker.DoCheck should have comment or be unexported (golint)
    • Line 106: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • sentinel-golang/core/log/slot.go
    • Line 22: warning: exported const StatSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported var DefaultSlot should have comment or be unexported (golint)
    • Line 29: warning: exported type Slot should have comment or be unexported (golint)
    • Line 32: warning: exported method Slot.Order should have comment or be unexported (golint)
    • Line 36: warning: exported method Slot.OnEntryPassed should have comment or be unexported (golint)
    • Line 40: warning: exported method Slot.OnEntryBlocked should have comment or be unexported (golint)
    • Line 44: warning: exported method Slot.OnCompleted should have comment or be unexported (golint)
    • sentinel-golang/core/stat/base/leap_array.go
    • Line 30: warning: exported const PtrSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 57: warning: comment on exported type AtomicBucketWrapArray should be of the form "AtomicBucketWrapArray ..." (with optional leading article) (golint)
    • Line 67: warning: exported function NewAtomicBucketWrapArrayWithTime should have comment or be unexported (golint)
    • Line 102: warning: comment on exported function NewAtomicBucketWrapArray should be of the form "NewAtomicBucketWrapArray ..." (golint)
    • Line 141: warning: comment on exported type LeapArray should be of the form "LeapArray ..." (with optional leading article) (golint)
    • Line 161: warning: exported function NewLeapArray should have comment or be unexported (golint)
    • Line 177: warning: exported method LeapArray.CurrentBucket should have comment or be unexported (golint)
    • Line 201: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 213: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 232: warning: comment on exported method LeapArray.Values should be of the form "Values ..." (golint)
    • Line 252: warning: exported method LeapArray.ValuesConditional should have comment or be unexported (golint)
    • Line 273: warning: comment on exported type BucketGenerator should be of the form "BucketGenerator ..." (with optional leading article) (golint)
    • sentinel-golang/metrics/metrics.go
    • Line 50: warning: exported var CPURatio should have comment or be unexported (golint)
    • Line 98: warning: exported function RegisterSentinelMetrics should have comment or be unexported (golint)
    • Line 113: warning: comment on exported function ResetSentinelMetrics should be of the form "ResetSentinelMetrics ..." (golint)
    • sentinel-golang/core/flow/rule.go
    • Line 45: warning: exported type TokenCalculateStrategy should have comment or be unexported (golint)
    • Line 48: warning: exported const Direct should have comment (or a comment on this block) or be unexported (golint)
    • Line 70: warning: exported const Reject should have comment (or a comment on this block) or be unexported (golint)
    • Line 167: warning: exported method Rule.ResourceName should have comment or be unexported (golint)
    • sentinel-golang/core/base/context.go
    • Line 19: warning: exported type EntryContext should have comment or be unexported (golint)
    • Line 39: warning: exported method EntryContext.SetEntry should have comment or be unexported (golint)
    • Line 43: warning: exported method EntryContext.Entry should have comment or be unexported (golint)
    • Line 47: warning: exported method EntryContext.Err should have comment or be unexported (golint)
    • Line 51: warning: exported method EntryContext.SetError should have comment or be unexported (golint)
    • Line 55: warning: exported method EntryContext.StartTime should have comment or be unexported (golint)
    • Line 59: warning: exported method EntryContext.IsBlocked should have comment or be unexported (golint)
    • Line 66: warning: exported method EntryContext.PutRt should have comment or be unexported (golint)
    • Line 70: warning: exported method EntryContext.Rt should have comment or be unexported (golint)
    • Line 78: warning: exported function NewEmptyEntryContext should have comment or be unexported (golint)
    • Line 82: warning: comment on exported type SentinelInput should be of the form "SentinelInput ..." (with optional leading article) (golint)
    • sentinel-golang/core/isolation/slot.go
    • Line 24: warning: exported const RuleCheckSlotOrder should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: exported var DefaultSlot should have comment or be unexported (golint)
    • Line 31: warning: exported type Slot should have comment or be unexported (golint)
    • Line 34: warning: exported method Slot.Order should have comment or be unexported (golint)
    • Line 38: warning: exported method Slot.Check should have comment or be unexported (golint)
    • sentinel-golang/api/api.go
    • Line 48: warning: exported method EntryOptions.Reset should have comment or be unexported (golint)
    • Line 58: warning: exported type EntryOption should have comment or be unexported (golint)
    • Line 74: warning: comment on exported function WithAcquireCount should be of the form "WithAcquireCount ..." (golint)
    • Line 120: warning: comment on exported function WithAttachments should be of the form "WithAttachments ..." (golint)
    • sentinel-golang/core/system_metric/sys_metric_stat.go
    • Line 15: warning: don't use an underscore in package name (golint)
    • Line 32: warning: exported const NotRetrievedLoadValue should have comment (or a comment on this block) or be unexported (golint)
    • Line 46: warning: exported var CurrentPID should have comment or be unexported (golint)
    • Line 79: warning: exported function InitMemoryCollector should have comment or be unexported (golint)
    • Line 135: warning: exported function InitCpuCollector should have comment or be unexported (golint)
    • Line 185: warning: exported function InitLoadCollector should have comment or be unexported (golint)
    • Line 219: warning: exported function CurrentLoad should have comment or be unexported (golint)
    • Line 227: warning: comment on exported function SetSystemLoad should be of the form "SetSystemLoad ..." (golint)
    • Line 232: warning: exported function CurrentCpuUsage should have comment or be unexported (golint)
    • Line 240: warning: comment on exported function SetSystemCpuUsage should be of the form "SetSystemCpuUsage ..." (golint)
    • Line 245: warning: exported function CurrentMemoryUsage should have comment or be unexported (golint)
    • Line 254: warning: comment on exported function SetSystemMemoryUsage should be of the form "SetSystemMemoryUsage ..." (golint)
    • sentinel-golang/ext/datasource/helper.go
    • Line 78: warning: exported function NewFlowRulesHandler should have comment or be unexported (golint)
    • Line 125: warning: exported function NewSystemRulesHandler should have comment or be unexported (golint)
    • Line 129: warning: exported function CircuitBreakerRuleJsonArrayParser should have comment or be unexported (golint)
    • Line 167: warning: exported function NewCircuitBreakerRulesHandler should have comment or be unexported (golint)
    • Line 230: warning: exported function NewHotSpotParamRulesHandler should have comment or be unexported (golint)
    • Line 277: warning: exported function NewIsolationRulesHandler should have comment or be unexported (golint)
    • sentinel-golang/core/stat/base/bucket_leap_array.go
    • Line 27: warning: comment on exported type BucketLeapArray should be of the form "BucketLeapArray ..." (with optional leading article) (golint)
    • Line 35: warning: exported method BucketLeapArray.NewEmptyBucket should have comment or be unexported (golint)
    • Line 39: warning: exported method BucketLeapArray.ResetBucketTo should have comment or be unexported (golint)
    • Line 45: warning: comment on exported function NewBucketLeapArray should be of the form "NewBucketLeapArray ..." (golint)
    • Line 65: warning: exported method BucketLeapArray.SampleCount should have comment or be unexported (golint)
    • Line 69: warning: exported method BucketLeapArray.IntervalInMs should have comment or be unexported (golint)
    • Line 73: warning: exported method BucketLeapArray.BucketLengthInMs should have comment or be unexported (golint)
    • Line 77: warning: exported method BucketLeapArray.DataType should have comment or be unexported (golint)
    • Line 81: warning: exported method BucketLeapArray.GetIntervalInSecond should have comment or be unexported (golint)
    • Line 85: warning: comment on exported method BucketLeapArray.AddCount should be of the form "AddCount ..." (golint)
    • Line 99: warning: exported method BucketLeapArray.UpdateConcurrency should have comment or be unexported (golint)
    • Line 134: warning: comment on exported method BucketLeapArray.Count should be of the form "Count ..." (golint)
    • Line 140: warning: exported method BucketLeapArray.CountWithTime should have comment or be unexported (golint)
    • Line 162: warning: comment on exported method BucketLeapArray.Values should be of the form "Values ..." (golint)
    • Line 171: warning: exported method BucketLeapArray.ValuesConditional should have comment or be unexported (golint)
    • Line 175: warning: exported method BucketLeapArray.MinRt should have comment or be unexported (golint)
    • Line 202: warning: exported method BucketLeapArray.MaxConcurrency should have comment or be unexported (golint)
    • sentinel-golang/logging/logging.go
    • Line 34: warning: exported const DebugLevel should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported const GlobalCallerDepth should have comment (or a comment on this block) or be unexported (golint)
    • Line 49: warning: exported var DefaultDirName should have comment or be unexported (golint)
    • Line 56: warning: exported var FrequentErrorOnce should have comment or be unexported (golint)
    • Line 85: warning: exported function NewConsoleLogger should have comment or be unexported (golint)
    • Line 91: warning: comment on exported function NewSimpleFileLogger should be of the form "NewSimpleFileLogger ..." (golint)
    • Line 102: warning: exported type Logger should have comment or be unexported (golint)
    • Line 122: warning: comment on exported type DefaultLogger should be of the form "DefaultLogger ..." (with optional leading article) (golint)
    • Line 147: 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 152: warning: exported function AssembleMsg should have comment or be unexported (golint)
    • Line 244: warning: exported method DefaultLogger.Debug should have comment or be unexported (golint)
    • Line 251: warning: exported method DefaultLogger.DebugEnabled should have comment or be unexported (golint)
    • Line 255: warning: exported method DefaultLogger.Info should have comment or be unexported (golint)
    • Line 262: warning: exported method DefaultLogger.InfoEnabled should have comment or be unexported (golint)
    • Line 266: warning: exported method DefaultLogger.Warn should have comment or be unexported (golint)
    • Line 274: warning: exported method DefaultLogger.WarnEnabled should have comment or be unexported (golint)
    • Line 285: warning: exported method DefaultLogger.ErrorEnabled should have comment or be unexported (golint)
    • Line 289: warning: exported function Debug should have comment or be unexported (golint)
    • Line 293: warning: exported function DebugEnabled should have comment or be unexported (golint)
    • Line 297: warning: exported function Info should have comment or be unexported (golint)
    • Line 301: warning: exported function InfoEnabled should have comment or be unexported (golint)
    • Line 305: warning: exported function Warn should have comment or be unexported (golint)
    • Line 309: warning: exported function WarnEnabled should have comment or be unexported (golint)
    • Line 313: warning: exported function Error should have comment or be unexported (golint)
    • Line 317: warning: exported function ErrorEnabled should have comment or be unexported (golint)
    • sentinel-golang/core/base/result.go
    • Line 22: warning: exported type BlockType should have comment or be unexported (golint)
    • Line 25: warning: exported const BlockTypeUnknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: error var blockTypeExisted should have name of the form errFoo (golint)
    • Line 63: warning: exported type TokenResultStatus should have comment or be unexported (golint)
    • Line 66: warning: exported const ResultStatusPass should have comment (or a comment on this block) or be unexported (golint)
    • Line 84: warning: exported type TokenResult should have comment or be unexported (golint)
    • Line 91: warning: exported method TokenResult.DeepCopyFrom should have comment or be unexported (golint)
    • Line 109: warning: exported method TokenResult.ResetToPass should have comment or be unexported (golint)
    • Line 115: warning: exported method TokenResult.ResetToBlockedWith should have comment or be unexported (golint)
    • Line 125: warning: exported method TokenResult.ResetToBlocked should have comment or be unexported (golint)
    • Line 129: warning: exported method TokenResult.ResetToBlockedWithMessage should have comment or be unexported (golint)
    • Line 133: warning: exported method TokenResult.ResetToBlockedWithCause should have comment or be unexported (golint)
    • Line 137: warning: exported method TokenResult.IsPass should have comment or be unexported (golint)
    • Line 141: warning: exported method TokenResult.IsBlocked should have comment or be unexported (golint)
    • Line 145: warning: exported method TokenResult.Status should have comment or be unexported (golint)
    • Line 149: warning: exported method TokenResult.BlockError should have comment or be unexported (golint)
    • Line 153: warning: exported method TokenResult.NanosToWait should have comment or be unexported (golint)
    • Line 167: warning: exported function NewTokenResultPass should have comment or be unexported (golint)
    • Line 171: warning: exported function NewTokenResultBlocked should have comment or be unexported (golint)
    • Line 175: warning: exported function NewTokenResultBlockedWithMessage should have comment or be unexported (golint)
    • Line 179: warning: exported function NewTokenResultBlockedWithCause should have comment or be unexported (golint)
    • Line 183: warning: exported function NewTokenResult should have comment or be unexported (golint)
    • Line 191: warning: exported function NewTokenResultShouldWait should have comment or be unexported (golint)
    • sentinel-golang/ext/datasource/property.go
    • Line 34: warning: exported type PropertyHandler should have comment or be unexported (golint)
    • Line 57: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 63: warning: exported method DefaultPropertyHandler.Handle should have comment or be unexported (golint)
    • Line 81: warning: exported function NewDefaultPropertyHandler should have comment or be unexported (golint)
    • sentinel-golang/core/stat/base/metric_bucket.go
    • Line 34: warning: exported function NewMetricBucket should have comment or be unexported (golint)
    • Line 76: warning: exported method MetricBucket.AddRt should have comment or be unexported (golint)
    • Line 84: warning: exported method MetricBucket.MinRt should have comment or be unexported (golint)
    • Line 88: warning: exported method MetricBucket.UpdateConcurrency should have comment or be unexported (golint)
    • Line 96: warning: exported method MetricBucket.MaxConcurrency should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign0%

IneffAssign detects ineffectual assignments in Go code.

An error occurred while running this test (exit status 2)


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!