Preparing report...

Report for github.com/andig/evcc

A+    Excellent!    Found 67 issues across 256 files

Tweet

gofmt98%

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!


gocyclo93%

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.

    • evcc/core/loadpoint.go
    • Line 584: warning: cyclomatic complexity 20 of function (*LoadPoint).findActiveVehicle() is high (> 15) (gocyclo)
    • Line 126: warning: cyclomatic complexity 17 of function NewLoadPointFromConfig() is high (> 15) (gocyclo)
    • Line 718: warning: cyclomatic complexity 17 of function (*LoadPoint).pvMaxCurrent() is high (> 15) (gocyclo)
    • Line 931: warning: cyclomatic complexity 16 of function (*LoadPoint).Update() is high (> 15) (gocyclo)
    • Line 450: warning: cyclomatic complexity 16 of function (*LoadPoint).setLimit() is high (> 15) (gocyclo)

golint80%

Golint is a linter for Go source code.

    • evcc/vehicle/vehicle.go
    • Line 13: warning: don't use underscores in Go names; struct field Title_ should be Title (golint)
    • Line 14: warning: don't use underscores in Go names; struct field Capacity_ should be Capacity (golint)
    • Line 15: warning: don't use underscores in Go names; struct field Identifier_ should be Identifier (golint)
    • evcc/vehicle/nissan/types.go
    • Line 19: warning: exported type Auth should have comment or be unexported (golint)
    • Line 27: warning: exported type AuthCallback should have comment or be unexported (golint)
    • Line 33: warning: exported type AuthCallbackValue should have comment or be unexported (golint)
    • Line 38: warning: exported type Token should have comment or be unexported (golint)
    • Line 44: warning: exported type Vehicles should have comment or be unexported (golint)
    • Line 48: warning: exported type Vehicle should have comment or be unexported (golint)
    • evcc/vehicle/niu/types.go
    • Line 11: warning: exported const AuthURI should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: comment on exported type Token should be of the form "Token ..." (with optional leading article) (golint)
    • evcc/detect/tasks/modbus.go
    • Line 17: warning: exported const Modbus should have comment or be unexported (golint)
    • Line 23: warning: exported type ModbusResult should have comment or be unexported (golint)
    • Line 30: warning: exported method ModbusResult.Configuration should have comment or be unexported (golint)
    • Line 41: warning: exported function ModbusHandlerFactory should have comment or be unexported (golint)
    • Line 63: warning: exported type ModbusHandler should have comment or be unexported (golint)
    • Line 172: warning: exported method ModbusHandler.Test should have comment or be unexported (golint)
    • evcc/detect/tasks/ping.go
    • Line 11: warning: exported const Ping should have comment or be unexported (golint)
    • Line 17: warning: exported function PingHandlerFactory should have comment or be unexported (golint)
    • Line 28: warning: exported type PingHandler should have comment or be unexported (golint)
    • Line 33: warning: exported method PingHandler.Test should have comment or be unexported (golint)
    • evcc/vehicle/nissan/api.go
    • Line 22: warning: exported type API should have comment or be unexported (golint)
    • Line 29: warning: exported function NewAPI should have comment or be unexported (golint)
    • Line 44: warning: exported method API.Vehicles should have comment or be unexported (golint)
    • evcc/vehicle/niu.go
    • Line 33: warning: comment on exported function NewNiuFromConfig should be of the form "NewNiuFromConfig ..." (golint)
    • evcc/util/oauth/tokensource.go
    • Line 11: warning: exported type TokenRefresher should have comment or be unexported (golint)
    • Line 15: warning: exported type TokenSource should have comment or be unexported (golint)
    • Line 20: warning: exported function RefreshTokenSource should have comment or be unexported (golint)
    • Line 24: warning: exported method TokenSource.Token should have comment or be unexported (golint)
    • evcc/detect/tasks/sma.go
    • Line 14: warning: exported const Sma should have comment or be unexported (golint)
    • Line 20: warning: exported type ShmResult should have comment or be unexported (golint)
    • Line 25: warning: exported function SMAHandlerFactory should have comment or be unexported (golint)
    • Line 35: warning: exported type SMAHandler should have comment or be unexported (golint)
    • Line 60: warning: exported method SMAHandler.Test should have comment or be unexported (golint)
    • evcc/vehicle/ovms.go
    • Line 30: warning: comment on exported type Ovms should be of the form "Ovms ..." (with optional leading article) (golint)
    • Line 42: warning: comment on exported function NewOvmsFromConfig should be of the form "NewOvmsFromConfig ..." (golint)
    • evcc/detect/analyze.go
    • Line 5: warning: exported type Criteria should have comment or be unexported (golint)
    • Line 28: warning: exported type TypeSummary should have comment or be unexported (golint)
    • Line 33: warning: exported type Summary should have comment or be unexported (golint)
    • Line 50: warning: exported function Consolidate should have comment or be unexported (golint)
    • evcc/detect/tasklist.go
    • Line 11: warning: exported type TaskList should have comment or be unexported (golint)
    • Line 16: warning: exported method TaskList.Add should have comment or be unexported (golint)
    • Line 21: warning: exported method TaskList.Count should have comment or be unexported (golint)
    • Line 84: warning: exported method TaskList.Test should have comment or be unexported (golint)
    • evcc/detect/tasks/keba.go
    • Line 11: warning: exported const Keba should have comment or be unexported (golint)
    • Line 17: warning: exported type KebaResult should have comment or be unexported (golint)
    • Line 21: warning: exported function KEBAHandlerFactory should have comment or be unexported (golint)
    • Line 31: warning: exported type KEBAHandler should have comment or be unexported (golint)
    • Line 37: warning: exported method KEBAHandler.Test should have comment or be unexported (golint)
    • evcc/detect/tasks/tcp.go
    • Line 12: warning: exported const Tcp should have comment or be unexported (golint)
    • Line 18: warning: exported function TcpHandlerFactory should have comment or be unexported (golint)
    • Line 32: warning: exported type TcpHandler should have comment or be unexported (golint)
    • Line 38: warning: exported method TcpHandler.Test should have comment or be unexported (golint)
    • evcc/vehicle/bluelink/api.go
    • Line 15: warning: exported const VehiclesURL should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: comment on exported function NewAPI should be of the form "NewAPI ..." (golint)
    • Line 55: warning: exported type VehiclesResponse should have comment or be unexported (golint)
    • Line 62: warning: exported type Vehicle should have comment or be unexported (golint)
    • Line 66: warning: exported method API.Vehicles should have comment or be unexported (golint)
    • Line 77: warning: exported type StatusResponse should have comment or be unexported (golint)
    • Line 83: warning: exported type StatusLatestResponse should have comment or be unexported (golint)
    • Line 93: warning: exported type StatusData should have comment or be unexported (golint)
    • Line 107: warning: exported method StatusData.Updated should have comment or be unexported (golint)
    • Line 111: warning: exported type DrivingDistance should have comment or be unexported (golint)
    • Line 119: warning: exported method API.Status should have comment or be unexported (golint)
    • evcc/util/sponsor/auth.go
    • Line 3: warning: exported var Subject should have comment or be unexported (golint)
    • Line 5: warning: exported function IsAuthorized should have comment or be unexported (golint)
    • evcc/vehicle/nissan/identity.go
    • Line 17: warning: exported type Identity should have comment or be unexported (golint)
    • Line 22: warning: exported function NewIdentity should have comment or be unexported (golint)
    • Line 28: warning: exported method Identity.Login should have comment or be unexported (golint)
    • Line 132: warning: exported method Identity.RefreshToken should have comment or be unexported (golint)
    • evcc/vehicle/bluelink/identity.go
    • Line 21: warning: exported const DeviceIdURL should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: comment on exported type Identity should be of the form "Identity ..." (with optional leading article) (golint)
    • Line 292: warning: comment on exported method Identity.RefreshToken should be of the form "RefreshToken ..." (golint)
    • Line 316: warning: exported method Identity.Login should have comment or be unexported (golint)
    • evcc/vehicle/porsche/identity.go
    • Line 20: warning: exported const ClientID should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported type AccessTokens should have comment or be unexported (golint)
    • Line 64: warning: exported method Identity.Login should have comment or be unexported (golint)
    • Line 194: warning: exported type Vehicle should have comment or be unexported (golint)
    • Line 199: warning: exported type VehicleResponse should have comment or be unexported (golint)
    • Line 204: warning: exported method Identity.FindVehicle should have comment or be unexported (golint)
    • evcc/detect/tasks/http.go
    • Line 15: warning: exported const Http should have comment or be unexported (golint)
    • Line 21: warning: exported type HttpResult should have comment or be unexported (golint)
    • Line 25: warning: exported function HttpHandlerFactory should have comment or be unexported (golint)
    • Line 57: warning: exported type HttpHandler should have comment or be unexported (golint)
    • Line 68: warning: exported method HttpHandler.Test should have comment or be unexported (golint)
    • evcc/detect/tasks/types.go
    • Line 8: warning: exported type ResultDetails should have comment or be unexported (golint)
    • Line 17: warning: exported method ResultDetails.Clone should have comment or be unexported (golint)
    • Line 25: warning: exported type Result should have comment or be unexported (golint)
    • Line 31: warning: exported type TaskType should have comment or be unexported (golint)
    • Line 33: warning: exported type Task should have comment or be unexported (golint)
    • Line 41: warning: exported type TaskHandler should have comment or be unexported (golint)
    • evcc/provider/config.go
    • Line 8: warning: comment on exported type BoolProvider should be of the form "BoolProvider ..." (with optional leading article) (golint)
    • Line 8: warning: comment on exported type FloatProvider should be of the form "FloatProvider ..." (with optional leading article) (golint)
    • Line 8: warning: comment on exported type IntProvider should be of the form "IntProvider ..." (with optional leading article) (golint)
    • Line 8: warning: comment on exported type SetBoolProvider should be of the form "SetBoolProvider ..." (with optional leading article) (golint)
    • Line 8: warning: comment on exported type SetIntProvider should be of the form "SetIntProvider ..." (with optional leading article) (golint)
    • Line 8: warning: comment on exported type StringProvider should be of the form "StringProvider ..." (with optional leading article) (golint)
    • evcc/charger/nrgble/nrg_linux.go
    • Line 15: warning: exported function FindDevice should have comment or be unexported (golint)
    • Line 27: warning: exported function Discover should have comment or be unexported (golint)
    • Line 65: warning: exported function Connect should have comment or be unexported (golint)
    • evcc/util/cloud/client.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 15: warning: exported var Host should have comment or be unexported (golint)
    • Line 43: warning: exported function Connection should have comment or be unexported (golint)
    • evcc/detect/tasks/mqtt.go
    • Line 12: warning: exported const Mqtt should have comment or be unexported (golint)
    • Line 18: warning: exported function MqttHandlerFactory should have comment or be unexported (golint)
    • Line 32: warning: exported type MqttHandler should have comment or be unexported (golint)
    • Line 38: warning: exported method MqttHandler.Test should have comment or be unexported (golint)
    • evcc/detect/tasks/registry.go
    • Line 7: warning: exported type TaskHandlerRegistry should have comment or be unexported (golint)
    • Line 11: warning: exported method TaskHandlerRegistry.Add should have comment or be unexported (golint)
    • Line 26: warning: exported function Get should have comment or be unexported (golint)
    • evcc/charger/nrgble/service.go
    • Line 4: warning: exported const InfoService should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported type Info should have comment or be unexported (golint)
    • Line 25: warning: exported type Energy should have comment or be unexported (golint)
    • Line 34: warning: exported type Power should have comment or be unexported (golint)
    • Line 47: warning: exported type VoltageCurrent should have comment or be unexported (golint)
    • Line 57: warning: exported type Settings 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!


misspell98%

Misspell Finds commonly misspelled English words

    • evcc/charger/fritzdect.go
    • Line 114: warning: "aproximately" is a misspelling of "approximately" (misspell)
    • Line 135: warning: "unkown" is a misspelling of "unknown" (misspell)
    • Line 153: warning: "unkown" is a misspelling of "unknown" (misspell)
    • Line 182: warning: "aproximately" is a misspelling of "approximately" (misspell)