Preparing report...

Report for github.com/ovsinc/resources-rate-limits

A+    Excellent!    Found 32 issues across 58 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.


golint46%

Golint is a linter for Go source code.

    • resources-rate-limits/internal/utils/common.go
    • Line 12: warning: exported const CG2Max should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported var ErrMax should have comment or be unexported (golint)
    • Line 19: warning: exported function CPUPercent should have comment or be unexported (golint)
    • Line 31: warning: exported function Percent should have comment or be unexported (golint)
    • Line 38: warning: comment on exported function ParseUint should be of the form "ParseUint ..." (golint)
    • Line 66: warning: exported function ReadUintFromF should have comment or be unexported (golint)
    • resources-rate-limits/pkg/resources/cg1/mem_simple.go
    • Line 10: warning: exported type MemCG1Simple should have comment or be unexported (golint)
    • Line 12: warning: exported function NewMemSimple should have comment or be unexported (golint)
    • Line 42: warning: exported method MemCG1Simple.Stop should have comment or be unexported (golint)
    • Line 44: warning: exported method MemCG1Simple.Used should have comment or be unexported (golint)
    • resources-rate-limits/pkg/middlewares/common.go
    • Line 11: warning: comment on exported const HeaderRetryAfter should be of the form "HeaderRetryAfter ..." (golint)
    • Line 16: warning: exported const DefaultRetryAfter should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported type CommonConfig should have comment or be unexported (golint)
    • Line 33: warning: exported var DefaultCommonConfig should have comment or be unexported (golint)
    • Line 39: warning: exported type Client should have comment or be unexported (golint)
    • Line 44: warning: exported function LimitHandler should have comment or be unexported (golint)
    • Line 55: warning: exported function ThrottleHandler should have comment or be unexported (golint)
    • Line 64: warning: exported function ErrorThrottleHandler should have comment or be unexported (golint)
    • Line 73: warning: exported function ErrorLimitHandler should have comment or be unexported (golint)
    • resources-rate-limits/pkg/resources/common/moc/config_moc.go
    • Line 11: warning: exported type ResourceConfigMoc should have comment or be unexported (golint)
    • Line 16: warning: exported method ResourceConfigMoc.Init should have comment or be unexported (golint)
    • Line 20: warning: exported method ResourceConfigMoc.Type should have comment or be unexported (golint)
    • Line 24: warning: exported method ResourceConfigMoc.File should have comment or be unexported (golint)
    • Line 28: warning: exported method ResourceConfigMoc.Stop should have comment or be unexported (golint)
    • resources-rate-limits/pkg/resources/cg1/cpu_simple.go
    • Line 12: warning: exported type CPUCG1Simple should have comment or be unexported (golint)
    • Line 17: warning: exported function NewCPUSimple should have comment or be unexported (golint)
    • Line 45: warning: receiver name cpu should be consistent with previous receiver name cg for CPUCG1Simple (golint)
    • Line 71: warning: exported method CPUCG1Simple.Stop should have comment or be unexported (golint)
    • Line 73: warning: exported method CPUCG1Simple.Used should have comment or be unexported (golint)
    • resources-rate-limits/pkg/resources/common/consts.go
    • Line 10: warning: exported const RAMFilenameInfoProc should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: comment on exported const CGroup2MemUsagePath should be of the form "CGroup2MemUsagePath ..." (golint)
    • Line 34: warning: exported var ErrAllIsZero should have comment or be unexported (golint)
    • resources-rate-limits/pkg/resources/common/resource.go
    • Line 7: warning: exported var ErrNoResourcer should have comment or be unexported (golint)
    • Line 9: warning: exported type ResourceType should have comment or be unexported (golint)
    • Line 12: warning: don't use underscores in Go names; const ResourceType_UNKNOWN should be ResourceTypeUNKNOWN (golint)
    • Line 12: warning: exported const ResourceType_UNKNOWN should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: don't use underscores in Go names; const ResourceType_CG1 should be ResourceTypeCG1 (golint)
    • Line 15: warning: don't use underscores in Go names; const ResourceType_CG2 should be ResourceTypeCG2 (golint)
    • Line 16: warning: don't use underscores in Go names; const ResourceType_OS should be ResourceTypeOS (golint)
    • Line 18: warning: don't use underscores in Go names; const ResourceType_ENDS should be ResourceTypeENDS (golint)
    • Line 22: warning: exported var CGroupFiles should have comment or be unexported (golint)
    • resources-rate-limits/options.go
    • Line 10: warning: exported const DefaultMemoryUsageBarrierPercentage should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported type Option should have comment or be unexported (golint)
    • Line 18: warning: exported var AppendCPUResourcer should have comment or be unexported (golint)
    • Line 35: warning: exported function NewSimple should have comment or be unexported (golint)
    • Line 51: warning: exported function MustNewSimple should have comment or be unexported (golint)
    • Line 60: warning: exported function NewLazy should have comment or be unexported (golint)
    • Line 91: warning: exported function MustNewLazy should have comment or be unexported (golint)
    • resources-rate-limits/rate.go
    • Line 10: warning: exported var ErrCPUUtilizationIsZero should have comment or be unexported (golint)
    • Line 18: warning: exported type RateReply should have comment or be unexported (golint)
    • Line 24: warning: exported type Limiter should have comment or be unexported (golint)
    • Line 33: warning: exported function New should have comment or be unexported (golint)
    • Line 53: warning: exported function MustNew should have comment or be unexported (golint)
    • resources-rate-limits/pkg/resources/common/debug.go
    • Line 11: warning: exported var IsDebug should have comment or be unexported (golint)
    • Line 15: warning: exported function Debug should have comment or be unexported (golint)
    • Line 22: warning: exported const FmtErr should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported function DbgErrCommon should have comment or be unexported (golint)
    • Line 31: warning: exported function DbgInfCPU should have comment or be unexported (golint)
    • Line 35: warning: exported function DbgInfRAM should have comment or be unexported (golint)
    • resources-rate-limits/auto.go
    • Line 12: warning: exported type Resourcer should have comment or be unexported (golint)
    • Line 13: warning: exported type ResourceViewer should have comment or be unexported (golint)
    • Line 16: warning: exported function AutoCPUSimple should have comment or be unexported (golint)
    • Line 32: warning: exported function AutoRAMSimple should have comment or be unexported (golint)
    • Line 48: warning: exported function AutoLazyRAM should have comment or be unexported (golint)
    • Line 70: warning: exported function AutoLazyCPU 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!


misspell98%

Misspell Finds commonly misspelled English words