Preparing report...

Report for github.com/wgliang/metrics

A+    Excellent!    Found 15 issues across 26 files

Tweet

gofmt92%

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!


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.

    • metrics/ewma_test.go
    • Line 15: warning: cyclomatic complexity 17 of function TestEWMA1() is high (> 15) (gocyclo)
    • Line 153: warning: cyclomatic complexity 17 of function TestEWMA15() is high (> 15) (gocyclo)
    • Line 84: warning: cyclomatic complexity 17 of function TestEWMA5() is high (> 15) (gocyclo)

golint46%

Golint is a linter for Go source code.

    • metrics/timer.go
    • Line 5: warning: comment on exported type Timer should be of the form "Timer ..." (with optional leading article) (golint)
    • Line 73: warning: comment on exported function NewCustomTimer should be of the form "NewCustomTimer ..." (golint)
    • Line 78: warning: comment on exported function NewTimer should be of the form "NewTimer ..." (golint)
    • metrics/health.go
    • Line 3: warning: exported var UseNilMetrics should have comment or be unexported (golint)
    • Line 5: warning: comment on exported type Healthcheck should be of the form "Healthcheck ..." (with optional leading article) (golint)
    • metrics/meter.go
    • Line 8: warning: comment on exported type Meter should be of the form "Meter ..." (with optional leading article) (golint)
    • Line 43: warning: comment on exported function NewMeter should be of the form "NewMeter ..." (golint)
    • metrics/gauge_float64.go
    • Line 5: warning: comment on exported type GaugeFloat64 should be of the form "GaugeFloat64 ..." (with optional leading article) (golint)
    • Line 21: warning: comment on exported function NewGaugeFloat64 should be of the form "NewGaugeFloat64 ..." (golint)
    • metrics/metrics.go
    • Line 16: warning: comment on exported type Options should be of the form "Options ..." (with optional leading article) (golint)
    • Line 23: warning: comment on exported type Metrics should be of the form "Metrics ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported function InitMetrics should be of the form "InitMetrics ..." (golint)
    • Line 48: warning: exported function NewMetrics should have comment or be unexported (golint)
    • Line 61: warning: comment on exported method Metrics.RegMetric should be of the form "RegMetric ..." (golint)
    • Line 74: warning: comment on exported method Metrics.RegHandler should be of the form "RegHandler ..." (golint)
    • Line 79: warning: comment on exported method Metrics.MetricsResponse should be of the form "MetricsResponse ..." (golint)
    • Line 93: warning: exported method Metrics.Metrics2string should have comment or be unexported (golint)
    • metrics/mstring.go
    • Line 5: warning: comment on exported type Mstring should be of the form "Mstring ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported function NewMString should be of the form "NewMString ..." (golint)
    • metrics/sample.go
    • Line 13: warning: comment on exported type Sample should be of the form "Sample ..." (with optional leading article) (golint)
    • Line 42: warning: comment on exported function NewExpDecaySample should be of the form "NewExpDecaySample ..." (golint)
    • Line 112: warning: comment on exported function NewUniformSample should be of the form "NewUniformSample ..." (golint)
    • metrics/collectry.go
    • Line 55: warning: comment on exported type StandardCollectry should be of the form "StandardCollectry ..." (with optional leading article) (golint)
    • Line 62: warning: comment on exported function NewCollectry should be of the form "NewCollectry ..." (golint)
    • Line 67: warning: comment on exported method StandardCollectry.Each should be of the form "Each ..." (golint)
    • Line 84: warning: comment on exported method StandardCollectry.GetOrCollector should be of the form "GetOrCollector ..." (golint)
    • Line 109: warning: comment on exported method StandardCollectry.RunHealthchecks should be of the form "RunHealthchecks ..." (golint)
    • Line 120: warning: comment on exported method StandardCollectry.Uncollector should be of the form "Uncollector ..." (golint)
    • Line 127: warning: comment on exported method StandardCollectry.UncollectorAll should be of the form "UncollectorAll ..." (golint)
    • Line 131: warning: should omit 2nd value from range; this loop is equivalent to `for name := range ...` (golint)
    • Line 136: warning: comment on exported method StandardCollectry.Size should be of the form "Size ..." (golint)
    • Line 162: warning: exported type PrefixedCollectry should have comment or be unexported (golint)
    • Line 167: warning: exported function NewPrefixedCollectry should have comment or be unexported (golint)
    • Line 174: warning: exported function NewPrefixedChildCollectry should have comment or be unexported (golint)
    • Line 181: warning: comment on exported method PrefixedCollectry.Each should be of the form "Each ..." (golint)
    • Line 191: warning: comment on exported method PrefixedCollectry.GetOrCollector should be of the form "GetOrCollector ..." (golint)
    • Line 205: warning: comment on exported method PrefixedCollectry.RunHealthchecks should be of the form "RunHealthchecks ..." (golint)
    • Line 210: warning: comment on exported method PrefixedCollectry.Uncollector should be of the form "Uncollector ..." (golint)
    • Line 216: warning: comment on exported method PrefixedCollectry.UncollectorAll should be of the form "UncollectorAll ..." (golint)
    • Line 221: warning: exported method PrefixedCollectry.Values should have comment or be unexported (golint)
    • Line 225: warning: comment on exported method PrefixedCollectry.Size should be of the form "Size ..." (golint)
    • Line 230: warning: exported var DefaultCollectry should have comment or be unexported (golint)
    • Line 232: warning: comment on exported function Each should be of the form "Each ..." (golint)
    • Line 242: warning: comment on exported function GetOrCollector should be of the form "GetOrCollector ..." (golint)
    • Line 254: warning: comment on exported function MustCollector should be of the form "MustCollector ..." (golint)
    • Line 262: warning: comment on exported function RunHealthchecks should be of the form "RunHealthchecks ..." (golint)
    • Line 272: warning: comment on exported function Size should be of the form "Size ..." (golint)
    • Line 277: warning: exported method StandardCollectry.Values should have comment or be unexported (golint)
    • metrics/ewma.go
    • Line 9: warning: comment on exported type EWMA should be of the form "EWMA ..." (with optional leading article) (golint)
    • Line 33: warning: comment on exported function NewEWMA should be of the form "NewEWMA ..." (golint)
    • Line 38: warning: comment on exported function NewEWMA1 should be of the form "NewEWMA1 ..." (golint)
    • Line 43: warning: comment on exported function NewEWMA5 should be of the form "NewEWMA5 ..." (golint)
    • Line 48: warning: comment on exported function NewEWMA15 should be of the form "NewEWMA15 ..." (golint)
    • metrics/gauge.go
    • Line 5: warning: comment on exported type Gauge should be of the form "Gauge ..." (with optional leading article) (golint)
    • Line 20: warning: comment on exported function NewGauge should be of the form "NewGauge ..." (golint)
    • metrics/counter.go
    • Line 5: warning: comment on exported type Counter should be of the form "Counter ..." (with optional leading article) (golint)
    • Line 26: warning: comment on exported function NewCounter should be of the form "NewCounter ..." (golint)
    • metrics/flow.go
    • Line 1: warning: package comment should be of the form "Package metrics ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 12: warning: exported type Flow should have comment or be unexported (golint)
    • Line 43: warning: comment on exported function NewFlow should be of the form "NewFlow ..." (golint)
    • metrics/histogram.go
    • Line 10: warning: comment on exported type Histogram should be of the form "Histogram ..." (with optional leading article) (golint)
    • Line 58: warning: comment on exported function NewHistogram should be of the form "NewHistogram ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.

    • metrics/metrics.go
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 13: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: could not import github.com/gorilla/mux (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import github.com/urfave/negroni (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/gorilla/mux (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import github.com/urfave/negroni (invalid package name: "") (ineffassign)

misspell96%

Misspell Finds commonly misspelled English words