Preparing report...

Report for github.com/gy-games/smartping

A    Great!    Found 12 issues across 13 files

Tweet

gofmt84%

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!


gocyclo76%

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.


golint7%

Golint is a linter for Go source code.

    • smartping/src/http/api.go
    • Line 438: 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 450: 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 462: 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 474: 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)
    • smartping/src/funcs/alert.go
    • Line 8: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 17: warning: exported function StartAlert should have comment or be unexported (golint)
    • Line 60: warning: exported function CheckAlertStatus should have comment or be unexported (golint)
    • Line 84: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 91: warning: exported function AlertStorage should have comment or be unexported (golint)
    • Line 104: warning: exported function AlertSendMail should have comment or be unexported (golint)
    • Line 130: warning: exported function SendMail should have comment or be unexported (golint)
    • Line 135: warning: don't use underscores in Go names; var content_type should be contentType (golint)
    • Line 137: warning: don't use underscores in Go names; var send_to should be sendTo (golint)
    • smartping/src/funcs/mapping.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 18: warning: exported var MapLock should have comment or be unexported (golint)
    • Line 22: warning: exported function Mapping should have comment or be unexported (golint)
    • Line 27: warning: should omit 2nd value from range; this loop is equivalent to `for prov := range ...` (golint)
    • Line 39: warning: comment on exported function MappingTask should be of the form "MappingTask ..." (golint)
    • Line 115: warning: exported function MapPingStorage should have comment or be unexported (golint)
    • smartping/src/g/config.go
    • Line 20: warning: exported var Root should have comment or be unexported (golint)
    • Line 22: warning: comment on exported var SelfCfg should be of the form "SelfCfg ..." (golint)
    • Line 32: warning: exported function IsExist should have comment or be unexported (golint)
    • Line 37: warning: exported function ReadConfig should have comment or be unexported (golint)
    • Line 52: warning: exported function GetRoot should have comment or be unexported (golint)
    • Line 67: warning: exported function ParseConfig should have comment or be unexported (golint)
    • Line 116: warning: exported function SaveCloudConfig should have comment or be unexported (golint)
    • Line 154: warning: exported function SaveConfig should have comment or be unexported (golint)
    • smartping/src/http/http.go
    • Line 17: warning: exported function ValidIP4 should have comment or be unexported (golint)
    • Line 26: warning: exported function RenderJson should have comment or be unexported (golint)
    • Line 36: warning: exported function AuthUserIp should have comment or be unexported (golint)
    • Line 49: warning: exported function AuthAgentIp should have comment or be unexported (golint)
    • Line 67: warning: exported function GraphText should have comment or be unexported (golint)
    • Line 78: warning: exported function StartHttp should have comment or be unexported (golint)
    • smartping/src/funcs/ping.go
    • Line 5: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 14: warning: exported function Ping should have comment or be unexported (golint)
    • Line 24: warning: comment on exported function PingTask should be of the form "PingTask ..." (golint)
    • Line 74: warning: comment on exported function PingStorage should be of the form "PingStorage ..." (golint)
    • smartping/src/g/struct.go
    • Line 3: warning: exported type Config should have comment or be unexported (golint)
    • Line 19: warning: exported type NetworkMember should have comment or be unexported (golint)
    • Line 28: warning: comment on exported type PingSt should be of the form "PingSt ..." (with optional leading article) (golint)
    • Line 38: warning: comment on exported type PingStMini should be of the form "PingStMini ..." (with optional leading article) (golint)
    • Line 45: warning: exported type PingLog should have comment or be unexported (golint)
    • Line 53: warning: exported type AlertLog should have comment or be unexported (golint)
    • Line 62: warning: exported type ChinaMp should have comment or be unexported (golint)
    • Line 68: warning: exported type MapVal should have comment or be unexported (golint)
    • Line 73: warning: exported type ToolsRes should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign84%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!