Preparing report...

Report for github.com/knative/pkg

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

    • pkg/test/gcs/mock/mock_test.go
    • Line 32: warning: cyclomatic complexity 47 of function TestSetError() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 37 of function TestClearError() is high (> 15) (gocyclo)
    • pkg/metrics/memstats.go
    • Line 371: warning: cyclomatic complexity 31 of function (*MemStatsProvider).Start() is high (> 15) (gocyclo)
    • Line 468: warning: cyclomatic complexity 28 of function (*MemStatsProvider).DefaultViews() is high (> 15) (gocyclo)
    • pkg/tracker/enqueue_test.go
    • Line 479: warning: cyclomatic complexity 30 of function TestHappyPathsInexact() is high (> 15) (gocyclo)
    • Line 33: warning: cyclomatic complexity 22 of function TestHappyPathsExact() is high (> 15) (gocyclo)

golint92%

Golint is a linter for Go source code.

    • pkg/webhook/admission.go
    • Line 150: warning: exported method StatelessAdmissionImpl.ThisTypeDoesNotDependOnInformerState should have comment or be unexported (golint)
    • pkg/reconciler/testing/sorter.go
    • Line 1: warning: package comment should be of the form "Package testing ..." (golint)
    • Line 27: warning: exported function NewObjectSorter should have comment or be unexported (golint)
    • Line 41: warning: exported type ObjectSorter should have comment or be unexported (golint)
    • Line 45: warning: exported method ObjectSorter.AddObjects should have comment or be unexported (golint)
    • Line 56: warning: exported method ObjectSorter.ObjectsForScheme should have comment or be unexported (golint)
    • Line 69: warning: exported method ObjectSorter.ObjectsForSchemeFunc should have comment or be unexported (golint)
    • Line 79: warning: exported method ObjectSorter.IndexerForObjectType should have comment or be unexported (golint)
    • pkg/apis/duck/v1beta1/destination.go
    • Line 49: warning: exported method Destination.Validate should have comment or be unexported (golint)
    • Line 56: warning: exported method Destination.ValidateDisallowDeprecated should have comment or be unexported (golint)
    • pkg/test/gcs/gcs.go
    • Line 34: warning: comment on exported type GCSClient should be of the form "GCSClient ..." (with optional leading article) (golint)
    • pkg/test/logstream/v2/stream.go
    • Line 37: warning: exported function FromNamespaces should have comment or be unexported (golint)
    • Line 46: warning: exported function FromNamespace should have comment or be unexported (golint)
    • pkg/tracing/opencensus.go
    • Line 53: warning: exported function NewOpenCensusTracer should have comment or be unexported (golint)
    • Line 59: warning: exported method OpenCensusTracer.ApplyConfig should have comment or be unexported (golint)
    • Line 84: warning: exported method OpenCensusTracer.Finish should have comment or be unexported (golint)
    • pkg/testing/resource.go
    • Line 69: warning: exported method Resource.Validate should have comment or be unexported (golint)
    • Line 107: warning: exported method ResourceSpec.Validate should have comment or be unexported (golint)
    • Line 114: warning: exported method Resource.CheckImmutableFields should have comment or be unexported (golint)
    • pkg/test/gcs/mock/errors.go
    • Line 31: warning: exported function NewNotEmptyBucketError should have comment or be unexported (golint)
    • Line 39: warning: exported function NewNoBucketError should have comment or be unexported (golint)
    • Line 51: warning: exported function NewBucketExistError should have comment or be unexported (golint)
    • Line 65: warning: exported function NewNoObjectError should have comment or be unexported (golint)
    • pkg/apis/duck/patch.go
    • Line 69: warning: exported type JSONPatch should have comment or be unexported (golint)
    • Line 71: warning: exported method JSONPatch.MarshalJSON should have comment or be unexported (golint)
    • pkg/kflag/set.go
    • Line 26: warning: exported type StringSet should have comment or be unexported (golint)
    • Line 36: warning: exported method StringSet.Set should have comment or be unexported (golint)
    • pkg/apis/duck/verify.go
    • Line 27: warning: exported type Implementable should have comment or be unexported (golint)
    • Line 28: warning: exported type Populatable should have comment or be unexported (golint)
    • pkg/kvstore/kvstore_cm.go
    • Line 17: warning: package comment should be of the form "Package kvstore ..." (golint)
    • Line 46: warning: exported function NewConfigMapKVStore 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!