Preparing report...

Report for github.com/lwolf/konsumerator

A+    Excellent!    Found 25 issues across 41 files

Tweet

gofmt97%

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!


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.


golint46%

Golint is a linter for Go source code.

    • konsumerator/pkg/providers/provider.go
    • Line 10: warning: exported type MetricsProvider should have comment or be unexported (golint)
    • Line 19: warning: exported function DumpSyncState should have comment or be unexported (golint)
    • Line 31: warning: exported function LoadSyncState should have comment or be unexported (golint)
    • konsumerator/pkg/helpers/util.go
    • Line 21: warning: exported const TimeLayout should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported function Ptr2Int32 should have comment or be unexported (golint)
    • Line 28: warning: exported function Ptr2Int64 should have comment or be unexported (golint)
    • Line 32: warning: exported function MapToArray should have comment or be unexported (golint)
    • Line 41: warning: exported function ParseTimeAnnotation should have comment or be unexported (golint)
    • Line 49: warning: exported function ParseIntAnnotation should have comment or be unexported (golint)
    • Line 57: warning: exported function ParsePartitionsListAnnotation should have comment or be unexported (golint)
    • Line 73: warning: exported function GomaxprocsFromResource should have comment or be unexported (golint)
    • Line 81: warning: exported function SetEnv should have comment or be unexported (golint)
    • Line 95: warning: exported function PopulateEnv should have comment or be unexported (golint)
    • Line 113: warning: exported function CmpResourceList should have comment or be unexported (golint)
    • Line 126: warning: exported function CmpResourceRequirements should have comment or be unexported (golint)
    • Line 183: warning: exported function Int2Str should have comment or be unexported (golint)
    • Line 205: warning: exported function EnsureValidLabelValue should have comment or be unexported (golint)
    • konsumerator/pkg/predictors/naive.go
    • Line 14: warning: exported type NaivePredictor should have comment or be unexported (golint)
    • Line 20: warning: exported function NewNaivePredictor should have comment or be unexported (golint)
    • Line 49: warning: exported method NaivePredictor.Estimate should have comment or be unexported (golint)
    • konsumerator/pkg/errors/errors.go
    • Line 7: warning: exported function IgnoreNotFound should have comment or be unexported (golint)
    • Line 14: warning: exported function IgnoreAlreadyExists should have comment or be unexported (golint)
    • Line 21: warning: exported function IgnoreConflict should have comment or be unexported (golint)
    • konsumerator/pkg/limiters/instance_limiter.go
    • Line 11: warning: exported type InstanceLimiter should have comment or be unexported (golint)
    • Line 16: warning: exported function NewInstanceLimiter should have comment or be unexported (golint)
    • Line 30: warning: exported method InstanceLimiter.MinAllowed should have comment or be unexported (golint)
    • Line 38: warning: exported method InstanceLimiter.MaxAllowed should have comment or be unexported (golint)
    • Line 46: warning: exported method InstanceLimiter.ApplyLimits should have comment or be unexported (golint)
    • konsumerator/hack/faker/lib/redis.go
    • Line 11: warning: exported const ConsumptionOffsetKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported function NewRedisClient should have comment or be unexported (golint)
    • Line 27: warning: exported function GetOffset should have comment or be unexported (golint)
    • Line 38: warning: exported function SetOffset should have comment or be unexported (golint)
    • konsumerator/pkg/providers/dummy.go
    • Line 7: warning: exported type DummyMP should have comment or be unexported (golint)
    • Line 12: warning: exported method DummyMP.GetLagByPartition should have comment or be unexported (golint)
    • Line 19: warning: exported method DummyMP.Update should have comment or be unexported (golint)
    • Line 25: warning: exported method DummyMP.Load should have comment or be unexported (golint)
    • Line 29: warning: exported method DummyMP.GetProductionRate should have comment or be unexported (golint)
    • Line 32: warning: exported method DummyMP.GetConsumptionRate should have comment or be unexported (golint)
    • Line 35: warning: exported method DummyMP.GetMessagesBehind should have comment or be unexported (golint)
    • Line 39: warning: exported function NewDummyMP should have comment or be unexported (golint)
    • konsumerator/api/v1/consumer_types.go
    • Line 25: warning: exported type AutoscalerType should have comment or be unexported (golint)
    • Line 32: warning: exported const AutoscalerTypePrometheus should have comment (or a comment on this block) or be unexported (golint)
    • Line 57: warning: exported type ResourcePolicy should have comment or be unexported (golint)
    • Line 67: warning: exported type GlobalResourcePolicy should have comment or be unexported (golint)
    • Line 94: warning: exported type AutoscalerSpec should have comment or be unexported (golint)
    • Line 104: warning: exported type PrometheusAutoscalerSpec should have comment or be unexported (golint)
    • Line 121: warning: exported type OffsetQuerySpec should have comment or be unexported (golint)
    • Line 126: warning: exported type ProductionQuerySpec should have comment or be unexported (golint)
    • Line 131: warning: exported type ConsumptionQuerySpec should have comment or be unexported (golint)
    • Line 161: warning: exported type InstanceState should have comment or be unexported (golint)
    • konsumerator/controllers/configmap.go
    • Line 44: warning: exported const AnnotationIsManaged should have comment (or a comment on this block) or be unexported (golint)
    • Line 66: warning: exported method ConfigMapReconciler.SetupWithManager should have comment or be unexported (golint)
    • Line 94: warning: exported method ConfigMapReconciler.Reconcile should have comment or be unexported (golint)
    • konsumerator/controllers/consumer.go
    • Line 49: warning: comment on exported type ConsumerReconciler should be of the form "ConsumerReconciler ..." (with optional leading article) (golint)
    • Line 59: warning: exported method ConsumerReconciler.SetupWithManager should have comment or be unexported (golint)
    • Line 90: warning: exported method ConsumerReconciler.Reconcile should have comment or be unexported (golint)
    • konsumerator/pkg/helpers/tests/constructors.go
    • Line 9: warning: exported function NewResourceList should have comment or be unexported (golint)
    • Line 16: warning: exported function NewContainerResourcePolicy should have comment or be unexported (golint)
    • Line 24: warning: exported function NewResourceRequirements should have comment or be unexported (golint)
    • konsumerator/pkg/limiters/global_limiter.go
    • Line 10: warning: exported type GlobalLimiter should have comment or be unexported (golint)
    • Line 16: warning: exported function NewGlobalLimiter should have comment or be unexported (golint)
    • Line 51: warning: comment on exported method GlobalLimiter.MinAllowed should be of the form "MinAllowed ..." (golint)
    • Line 56: warning: exported method GlobalLimiter.MaxAllowed should have comment or be unexported (golint)
    • Line 63: warning: exported method GlobalLimiter.ApplyLimits should have comment or be unexported (golint)
    • konsumerator/controllers/utils.go
    • Line 110: warning: exported function PopulateStatusFromAnnotation should have comment or be unexported (golint)
    • Line 122: warning: exported function UpdateStatusAnnotations should have comment or be unexported (golint)
    • konsumerator/pkg/providers/prometheus.go
    • Line 22: warning: exported type PrometheusMP should have comment or be unexported (golint)
    • Line 45: warning: error var allConsFailedErr should have name of the form errFoo (golint)
    • Line 49: warning: comment on exported function NewPrometheusMP should be of the form "NewPrometheusMP ..." (golint)
    • Line 161: warning: context.Context should be the first parameter of a function (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell95%

Misspell Finds commonly misspelled English words