Preparing report...

Report for github.com/mtraver/environmental-sensor

A+    Excellent!    Found 30 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!


gocyclo95%

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.


golint56%

Golint is a linter for Go source code.

    • environmental-sensor/cmd/iotcorelogger/jobs.go
    • Line 17: warning: exported type SetupJob should have comment or be unexported (golint)
    • Line 21: warning: exported method SetupJob.Run should have comment or be unexported (golint)
    • Line 35: warning: exported type SenseJob should have comment or be unexported (golint)
    • Line 42: warning: exported method SenseJob.Run should have comment or be unexported (golint)
    • Line 100: warning: exported type ShutdownJob should have comment or be unexported (golint)
    • Line 104: warning: exported method ShutdownJob.Run should have comment or be unexported (golint)
    • environmental-sensor/web/root.go
    • Line 131: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 160: warning: should omit 2nd value from range; this loop is equivalent to `for metricName := range ...` (golint)
    • Line 165: warning: should omit 2nd value from range; this loop is equivalent to `for metricName := range ...` (golint)
    • Line 230: warning: should omit 2nd value from range; this loop is equivalent to `for metric := range ...` (golint)
    • Line 235: warning: should omit 2nd value from range; this loop is equivalent to `for metric := range ...` (golint)
    • Line 318: warning: should omit 2nd value from range; this loop is equivalent to `for metricName := range ...` (golint)
    • Line 327: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • environmental-sensor/sensor/sds011/sds011.go
    • Line 16: warning: exported type SDS011 should have comment or be unexported (golint)
    • Line 20: warning: exported function New should have comment or be unexported (golint)
    • Line 31: warning: exported method SDS011.Init should have comment or be unexported (golint)
    • Line 41: warning: exported method SDS011.Sense should have comment or be unexported (golint)
    • Line 61: warning: exported method SDS011.Shutdown should have comment or be unexported (golint)
    • environmental-sensor/web/cache/local.go
    • Line 10: warning: exported type Local should have comment or be unexported (golint)
    • Line 17: warning: exported function NewLocal should have comment or be unexported (golint)
    • Line 23: warning: exported method Local.Get should have comment or be unexported (golint)
    • Line 39: warning: exported method Local.Add should have comment or be unexported (golint)
    • Line 51: warning: exported method Local.Set should have comment or be unexported (golint)
    • Line 59: warning: exported method Local.Stats should have comment or be unexported (golint)
    • environmental-sensor/measurement/stats.go
    • Line 7: warning: exported function Mean should have comment or be unexported (golint)
    • Line 37: warning: exported function StdDev should have comment or be unexported (golint)
    • Line 69: warning: exported function Min should have comment or be unexported (golint)
    • Line 91: warning: exported function Max should have comment or be unexported (golint)
    • environmental-sensor/sensor/dummy/dummy.go
    • Line 9: warning: exported type Dummy should have comment or be unexported (golint)
    • Line 11: warning: exported method Dummy.Init should have comment or be unexported (golint)
    • Line 16: warning: exported method Dummy.Sense should have comment or be unexported (golint)
    • Line 21: warning: exported method Dummy.Shutdown should have comment or be unexported (golint)
    • environmental-sensor/web/db/influxdb.go
    • Line 34: warning: exported type InfluxDB should have comment or be unexported (golint)
    • Line 41: warning: exported function NewInfluxDB should have comment or be unexported (golint)
    • Line 50: warning: exported method InfluxDB.Save should have comment or be unexported (golint)
    • environmental-sensor/web/cache/memcache.go
    • Line 12: warning: exported type Memcache should have comment or be unexported (golint)
    • Line 21: warning: exported method Memcache.Get should have comment or be unexported (golint)
    • Line 53: warning: exported method Memcache.Add should have comment or be unexported (golint)
    • Line 57: warning: exported method Memcache.Set should have comment or be unexported (golint)
    • Line 61: warning: exported method Memcache.Stats should have comment or be unexported (golint)
    • environmental-sensor/measurement/measurement.go
    • Line 69: warning: exported type Metric should have comment or be unexported (golint)
    • Line 75: warning: exported function GetMetric should have comment or be unexported (golint)
    • Line 110: warning: exported method StorableMeasurement.MarshalJSON should have comment or be unexported (golint)
    • Line 292: warning: exported method StorableMeasurement.FillDerivedMetrics should have comment or be unexported (golint)
    • environmental-sensor/sensor/mcp9808/mcp9808.go
    • Line 18: warning: exported type MCP9808 should have comment or be unexported (golint)
    • Line 22: warning: exported function New should have comment or be unexported (golint)
    • Line 33: warning: exported method MCP9808.Init should have comment or be unexported (golint)
    • Line 37: warning: exported method MCP9808.Sense should have comment or be unexported (golint)
    • Line 47: warning: exported method MCP9808.Shutdown should have comment or be unexported (golint)
    • environmental-sensor/aqi/aqi.go
    • Line 54: warning: exported function PM25 should have comment or be unexported (golint)
    • Line 58: warning: exported function PM10 should have comment or be unexported (golint)
    • Line 62: warning: exported function String should have comment or be unexported (golint)
    • Line 78: warning: exported function Abbrv should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign43%

IneffAssign detects ineffectual assignments in Go code.

    • environmental-sensor/sensor/dummy/dummy.go
    • Line 6: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 6: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/sensor/sensor.go
    • Line 7: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 7: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/cmd/iotcorelogger/main.go
    • Line 19: warning: no required module provides package github.com/mtraver/environmental-sensor/configpb; to add it: (ineffassign)
    • Line 19: warning: could not import github.com/mtraver/environmental-sensor/configpb (invalid package name: "") (ineffassign)
    • environmental-sensor/web/cache/cache.go
    • Line 7: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 7: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 7: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 7: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/measurementpbutil/measurementpbutil.go
    • Line 11: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 11: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 11: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • /home/shawn/mygo/src/github.com/gojp/goreportcard/_repos/src/github.com/mtraver/environmental-sensor/measurement/measurement.go
    • Line 12: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 12: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 12: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 12: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 12: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 12: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/web/db/datastore.go
    • Line 12: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/sensor/mcp9808/mcp9808.go
    • Line 6: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 6: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/sensor/sds011/sds011.go
    • Line 6: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 6: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 6: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/cmd/iotcorelogger/jobs.go
    • Line 9: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 9: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/cmd/apiclient/main.go
    • Line 16: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 16: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/web/main.go
    • Line 14: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 14: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/measurement/measurement.go
    • Line 12: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 12: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/cmd/readtemp/main.go
    • Line 13: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 13: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • environmental-sensor/cmd/csvtogcp/main.go
    • Line 16: warning: no required module provides package github.com/mtraver/environmental-sensor/measurementpb; to add it: (ineffassign)
    • Line 16: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)
    • Line 16: warning: could not import github.com/mtraver/environmental-sensor/measurementpb (invalid package name: "") (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!