Preparing report...

Report for github.com/nange/gospider

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


gocyclo94%

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.

    • gospider/spider/spider.go
    • Line 143: warning: cyclomatic complexity 26 of function addCallback() is high (> 15) (gocyclo)
    • Line 36: warning: cyclomatic complexity 20 of function (*Spider).Run() is high (> 15) (gocyclo)

golint50%

Golint is a linter for Go source code.

    • gospider/web/router/task/task_lock.go
    • Line 9: warning: exported type TaskLock should have comment or be unexported (golint)
    • Line 20: warning: exported method TaskLock.IsRunning should have comment or be unexported (golint)
    • Line 30: warning: exported method TaskLock.Complete should have comment or be unexported (golint)
    • gospider/web/router/task/update_task.go
    • Line 16: warning: exported type UpdateTaskReq should have comment or be unexported (golint)
    • Line 21: warning: exported type UpdateTaskResp should have comment or be unexported (golint)
    • Line 26: warning: exported function UpdateTask should have comment or be unexported (golint)
    • gospider/common/enu.go
    • Line 13: warning: exported const TaskStatusUnknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: error var InvalidTaskStatus should have name of the form ErrFoo (golint)
    • Line 32: warning: exported var InvalidTaskStatus should have comment or be unexported (golint)
    • Line 42: warning: exported function ParseTaskStatusFromString should have comment or be unexported (golint)
    • Line 62: warning: exported method TaskStatus.MarshalJSON should have comment or be unexported (golint)
    • Line 66: warning: exported method TaskStatus.UnmarshalJSON should have comment or be unexported (golint)
    • gospider/common/types.go
    • Line 4: warning: exported const OutputTypeMySQL should have comment (or a comment on this block) or be unexported (golint)
    • Line 9: warning: exported type MTS should have comment or be unexported (golint)
    • gospider/web/web.go
    • Line 14: warning: exported type Server should have comment or be unexported (golint)
    • Line 19: warning: exported method Server.Run should have comment or be unexported (golint)
    • gospider/web/router/rule/get_rules.go
    • Line 17: warning: exported type GetRuleListResp should have comment or be unexported (golint)
    • Line 22: warning: exported function GetRuleList should have comment or be unexported (golint)
    • Line 36: warning: exported type Pinyin should have comment or be unexported (golint)
    • Line 55: warning: exported function UTF82GB18030 should have comment or be unexported (golint)
    • gospider/web/router/exportdb/create.go
    • Line 13: warning: exported type CreateExportDBReq should have comment or be unexported (golint)
    • Line 17: warning: exported type CreateExportDBResp should have comment or be unexported (golint)
    • Line 22: warning: exported function CreateExportDB should have comment or be unexported (golint)
    • gospider/web/model/task.go
    • Line 12: warning: comment on exported type Task should be of the form "Task ..." (with optional leading article) (golint)
    • Line 46: warning: exported method Task.TableName should have comment or be unexported (golint)
    • Line 54: warning: exported function GetTaskList should have comment or be unexported (golint)
    • gospider/web/router/exportdb/get_list.go
    • Line 12: warning: exported type GetExportDBListReq should have comment or be unexported (golint)
    • Line 17: warning: exported type GetExportDBListResp should have comment or be unexported (golint)
    • Line 22: warning: exported function GetExportDBList should have comment or be unexported (golint)
    • gospider/spider/output.go
    • Line 17: warning: exported type Outputer should have comment or be unexported (golint)
    • Line 21: warning: exported method Context.Output should have comment or be unexported (golint)
    • Line 32: warning: comment on exported method Context.OutputCustom should be of the form "OutputCustom ..." (golint)
    • Line 37: warning: comment on exported method Context.OutputDefault should be of the form "OutputDefault ..." (golint)
    • gospider/web/router/task/get_task_list.go
    • Line 12: warning: exported type GetTaskListReq should have comment or be unexported (golint)
    • Line 17: warning: exported type GetTaskListResp should have comment or be unexported (golint)
    • Line 22: warning: exported function GetTaskList should have comment or be unexported (golint)
    • gospider/web/service/cron.go
    • Line 17: warning: exported var ErrCronTaskDuplicated should have comment or be unexported (golint)
    • Line 22: warning: exported type CronTask should have comment or be unexported (golint)
    • Line 29: warning: exported function NewCronTask should have comment or be unexported (golint)
    • Line 44: warning: exported method CronTask.Run should have comment or be unexported (golint)
    • Line 71: warning: exported method CronTask.Start should have comment or be unexported (golint)
    • Line 79: warning: exported method CronTask.Stop should have comment or be unexported (golint)
    • Line 89: warning: exported function GetCronTask should have comment or be unexported (golint)
    • Line 97: warning: exported function AddCronTask should have comment or be unexported (golint)
    • gospider/web/model/user.go
    • Line 12: warning: comment on exported type User should be of the form "User ..." (with optional leading article) (golint)
    • Line 26: warning: exported method User.TableName should have comment or be unexported (golint)
    • Line 34: warning: exported function IsValidUser should have comment or be unexported (golint)
    • Line 52: warning: exported function GenUserHashPassword should have comment or be unexported (golint)
    • Line 60: warning: exported function InitAdminUserIfNeeded should have comment or be unexported (golint)
    • gospider/web/service/checktask.go
    • Line 11: warning: comment on exported function CheckTask should be of the form "CheckTask ..." (golint)
    • Line 50: warning: exported function CreateCronTask should have comment or be unexported (golint)
    • gospider/web/core/db.go
    • Line 15: warning: exported function SetGormDB should have comment or be unexported (golint)
    • Line 19: warning: exported function GetGormDB should have comment or be unexported (golint)
    • Line 23: warning: exported function GetDB should have comment or be unexported (golint)
    • Line 27: warning: exported type Model should have comment or be unexported (golint)
    • Line 31: warning: exported function Register should have comment or be unexported (golint)
    • Line 44: warning: exported function AutoMigrate should have comment or be unexported (golint)
    • gospider/web/model/exportdb.go
    • Line 11: warning: comment on exported type ExportDB should be of the form "ExportDB ..." (with optional leading article) (golint)
    • Line 25: warning: exported method ExportDB.TableName should have comment or be unexported (golint)
    • Line 33: warning: exported function GetExportDBList should have comment or be unexported (golint)
    • gospider/web/router/task/create_task.go
    • Line 16: warning: exported type CreateTaskReq should have comment or be unexported (golint)
    • Line 20: warning: exported type CreateTaskResp should have comment or be unexported (golint)
    • Line 25: warning: exported function CreateTask 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!