Preparing report...

Report for github.com/fromanirh/kubevirt-metrics-collector

A+    Excellent!    Found 11 issues across 20 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!


gocyclo100%

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.

No problems detected. Good job!


golint45%

Golint is a linter for Go source code.

    • kubevirt-metrics-collector/internal/pkg/k8sutils/tlsinfo.go
    • Line 12: warning: exported type TLSInfo should have comment or be unexported (golint)
    • Line 18: warning: exported method TLSInfo.Clean should have comment or be unexported (golint)
    • Line 26: warning: exported method TLSInfo.IsEnabled should have comment or be unexported (golint)
    • Line 30: warning: exported method TLSInfo.UpdateFromK8S should have comment or be unexported (golint)
    • kubevirt-metrics-collector/pkg/monitoring/processes/finder_cri.go
    • Line 38: warning: exported const DefaultTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type CRIPodFinder should have comment or be unexported (golint)
    • Line 51: warning: exported function NewCRIPodFinder should have comment or be unexported (golint)
    • Line 73: warning: exported method CRIPodFinder.FindPods should have comment or be unexported (golint)
    • Line 158: warning: exported method CRIPodFinder.FindPodByPID should have comment or be unexported (golint)
    • kubevirt-metrics-collector/internal/pkg/service/service.go
    • Line 30: warning: exported type Service should have comment or be unexported (golint)
    • Line 35: warning: exported type ServiceListen should have comment or be unexported (golint)
    • Line 41: warning: exported method ServiceListen.Address should have comment or be unexported (golint)
    • Line 45: warning: exported method ServiceListen.InitFlags should have comment or be unexported (golint)
    • Line 49: warning: exported method ServiceListen.AddCommonFlags should have comment or be unexported (golint)
    • Line 54: warning: exported function Setup should have comment or be unexported (golint)
    • kubevirt-metrics-collector/internal/pkg/log/log.go
    • Line 38: warning: exported type LogLevel should have comment or be unexported (golint)
    • Line 41: warning: exported const INFO should have comment (or a comment on this block) or be unexported (golint)
    • Line 47: warning: exported var LogLevelNames should have comment or be unexported (golint)
    • Line 54: warning: exported type FilteredLogger should have comment or be unexported (golint)
    • Line 64: warning: exported var Log should have comment or be unexported (golint)
    • Line 66: warning: exported function InitializeLogging should have comment or be unexported (golint)
    • Line 78: 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 85: warning: comment on exported function MakeLogger should be of the form "MakeLogger ..." (golint)
    • Line 121: warning: exported function Logger should have comment or be unexported (golint)
    • Line 129: warning: exported function DefaultLogger should have comment or be unexported (golint)
    • Line 133: warning: exported method FilteredLogger.SetLogger should have comment or be unexported (golint)
    • Line 138: warning: exported type LogError should have comment or be unexported (golint)
    • Line 154: warning: exported method FilteredLogger.Log should have comment or be unexported (golint)
    • Line 183: warning: exported method FilteredLogger.With should have comment or be unexported (golint)
    • Line 188: warning: exported method FilteredLogger.WithPrefix should have comment or be unexported (golint)
    • Line 193: warning: exported method FilteredLogger.SetLogLevel should have comment or be unexported (golint)
    • Line 201: warning: exported method FilteredLogger.SetVerbosityLevel should have comment or be unexported (golint)
    • Line 210: warning: comment on exported method FilteredLogger.V should be of the form "V ..." (golint)
    • Line 219: warning: exported method FilteredLogger.Level should have comment or be unexported (golint)
    • Line 224: warning: exported method FilteredLogger.Info should have comment or be unexported (golint)
    • Line 228: warning: exported method FilteredLogger.Infof should have comment or be unexported (golint)
    • Line 232: warning: exported method FilteredLogger.Warning should have comment or be unexported (golint)
    • Line 236: warning: exported method FilteredLogger.Warningf should have comment or be unexported (golint)
    • Line 244: warning: exported method FilteredLogger.Errorf should have comment or be unexported (golint)
    • Line 248: warning: exported method FilteredLogger.Critical should have comment or be unexported (golint)
    • Line 252: warning: exported method FilteredLogger.Criticalf should have comment or be unexported (golint)
    • kubevirt-metrics-collector/pkg/monitoring/processes/collector.go
    • Line 72: warning: exported type Collector should have comment or be unexported (golint)
    • Line 77: warning: exported function NewSelfCollector should have comment or be unexported (golint)
    • Line 90: warning: exported function NewCollectorFromConf should have comment or be unexported (golint)
    • Line 111: warning: exported method Collector.Describe should have comment or be unexported (golint)
    • Line 115: warning: comment on exported method Collector.Collect should be of the form "Collect ..." (golint)
    • kubevirt-metrics-collector/pkg/monitoring/processes/monitor.go
    • Line 32: warning: exported type PodInfoMap should have comment or be unexported (golint)
    • Line 34: warning: exported type Monitor should have comment or be unexported (golint)
    • Line 38: warning: exported const FreshnessThreshold should have comment or be unexported (golint)
    • Line 40: warning: exported type DomainMonitor should have comment or be unexported (golint)
    • Line 47: warning: exported type SelfMonitor should have comment or be unexported (golint)
    • Line 51: warning: exported function NewSelfMonitor should have comment or be unexported (golint)
    • Line 65: warning: exported method SelfMonitor.Update should have comment or be unexported (golint)
    • Line 69: warning: exported function NewDomainMonitor should have comment or be unexported (golint)
    • Line 76: warning: exported method DomainMonitor.Update should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign60%

IneffAssign detects ineffectual assignments in Go code.

    • kubevirt-metrics-collector/cmd/kubevirt-metrics-collector/main.go
    • Line 24: warning: cannot find package "." in: (ineffassign)
    • Line 25: warning: cannot find package "." in: (ineffassign)
    • Line 26: warning: cannot find package "." in: (ineffassign)
    • Line 28: warning: cannot find package "." in: (ineffassign)
    • Line 24: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/k8sutils (invalid package name: "") (ineffassign)
    • Line 25: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/log (invalid package name: "") (ineffassign)
    • Line 26: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/service (invalid package name: "") (ineffassign)
    • Line 28: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/pkg/monitoring (invalid package name: "") (ineffassign)
    • kubevirt-metrics-collector/internal/pkg/log/log.go
    • Line 33: warning: cannot find package "." in: (ineffassign)
    • Line 34: warning: cannot find package "." in: (ineffassign)
    • Line 35: warning: cannot find package "." in: (ineffassign)
    • Line 33: warning: could not import github.com/go-kit/kit/log (invalid package name: "") (ineffassign)
    • Line 34: warning: could not import github.com/golang/glog (invalid package name: "") (ineffassign)
    • Line 35: warning: could not import github.com/spf13/pflag (invalid package name: "") (ineffassign)
    • kubevirt-metrics-collector/pkg/monitoring/app.go
    • Line 26: warning: cannot find package "." in: (ineffassign)
    • Line 31: warning: cannot find package "." in: (ineffassign)
    • Line 32: warning: cannot find package "." in: (ineffassign)
    • Line 33: warning: cannot find package "." in: (ineffassign)
    • Line 35: warning: cannot find package "." in: (ineffassign)
    • Line 29: warning: cannot find package "." in: (ineffassign)
    • Line 26: warning: could not import github.com/davecgh/go-spew/spew (invalid package name: "") (ineffassign)
    • Line 29: warning: could not import github.com/spf13/pflag (invalid package name: "") (ineffassign)
    • Line 31: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/k8sutils (invalid package name: "") (ineffassign)
    • Line 32: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/log (invalid package name: "") (ineffassign)
    • Line 33: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/service (invalid package name: "") (ineffassign)
    • Line 35: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/pkg/monitoring/processes (invalid package name: "") (ineffassign)
    • Line 55: warning: app.InitFlags undefined (type *App has no field or method InitFlags) (ineffassign)
    • Line 57: warning: app.BindAddress undefined (type *App has no field or method BindAddress) (ineffassign)
    • Line 58: warning: app.Port undefined (type *App has no field or method Port) (ineffassign)
    • Line 60: warning: app.AddCommonFlags undefined (type *App has no field or method AddCommonFlags) (ineffassign)
    • kubevirt-metrics-collector/pkg/monitoring/processes/collector.go
    • Line 31: warning: cannot find package "." in: (ineffassign)
    • Line 32: warning: cannot find package "." in: (ineffassign)
    • Line 29: warning: cannot find package "." in: (ineffassign)
    • Line 27: warning: cannot find package "." in: (ineffassign)
    • Line 27: warning: could not import github.com/shirou/gopsutil/process (invalid package name: "") (ineffassign)
    • Line 29: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/pkg/procscanner (invalid package name: "") (ineffassign)
    • Line 31: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/log (invalid package name: "") (ineffassign)
    • Line 32: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/version (invalid package name: "") (ineffassign)
    • Line 112: warning: DescribeByCollect not declared by package prometheus (ineffassign)
    • Line 27: warning: could not import github.com/shirou/gopsutil/process (invalid package name: "") (ineffassign)
    • Line 29: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/pkg/procscanner (invalid package name: "") (ineffassign)
    • Line 31: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/log (invalid package name: "") (ineffassign)
    • Line 32: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/version (invalid package name: "") (ineffassign)
    • Line 112: warning: DescribeByCollect not declared by package prometheus (ineffassign)
    • kubevirt-metrics-collector/pkg/monitoring/processes/finder_cri.go
    • Line 28: warning: cannot find package "." in: (ineffassign)
    • Line 30: warning: cannot find package "." in: (ineffassign)
    • Line 31: warning: cannot find package "." in: (ineffassign)
    • Line 28: warning: could not import google.golang.org/grpc (invalid package name: "") (ineffassign)
    • Line 30: warning: could not import k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2 (invalid package name: "") (ineffassign)
    • Line 31: warning: could not import k8s.io/kubernetes/pkg/kubelet/util (invalid package name: "") (ineffassign)
    • Line 28: warning: could not import google.golang.org/grpc (invalid package name: "") (ineffassign)
    • Line 30: warning: could not import k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2 (invalid package name: "") (ineffassign)
    • Line 31: warning: could not import k8s.io/kubernetes/pkg/kubelet/util (invalid package name: "") (ineffassign)
    • kubevirt-metrics-collector/internal/pkg/k8sutils/tlsinfo.go
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 7: warning: cannot find package "." in: (ineffassign)
    • Line 7: warning: could not import k8s.io/client-go/rest (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/fromanirh/kubevirt-metrics-collector/internal/pkg/log (invalid package name: "") (ineffassign)
    • kubevirt-metrics-collector/internal/pkg/k8sutils/certs.go
    • Line 4: warning: cannot find package "." in: (ineffassign)
    • Line 5: warning: cannot find package "." in: (ineffassign)
    • Line 6: warning: cannot find package "." in: (ineffassign)
    • Line 4: warning: could not import k8s.io/client-go/util/cert (invalid package name: "") (ineffassign)
    • Line 5: warning: could not import k8s.io/client-go/util/cert/triple (invalid package name: "") (ineffassign)
    • Line 6: warning: could not import k8s.io/client-go/util/certificate (invalid package name: "") (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!