Preparing report...

Report for github.com/cuigh/swirl

A+    Excellent!    Found 39 issues across 93 files

Tweet

gofmt95%

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!


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.

    • swirl/biz/docker/service.go
    • Line 587: warning: cyclomatic complexity 42 of function ServiceCommand() is high (> 15) (gocyclo)
    • Line 137: warning: cyclomatic complexity 40 of function ServiceUpdate() is high (> 15) (gocyclo)
    • Line 368: warning: cyclomatic complexity 38 of function ServiceCreate() is high (> 15) (gocyclo)
    • Line 25: warning: cyclomatic complexity 16 of function ServiceList() is high (> 15) (gocyclo)

golint66%

Golint is a linter for Go source code.

    • swirl/dao/mongo/setting.go
    • Line 11: warning: exported method Dao.SettingGet should have comment or be unexported (golint)
    • Line 22: warning: exported method Dao.SettingUpdate should have comment or be unexported (golint)
    • swirl/controller/volume.go
    • Line 75: 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)
    • swirl/dao/mongo/role.go
    • Line 9: warning: exported method Dao.RoleList should have comment or be unexported (golint)
    • Line 17: warning: exported method Dao.RoleCreate should have comment or be unexported (golint)
    • Line 24: warning: exported method Dao.RoleGet should have comment or be unexported (golint)
    • Line 37: warning: exported method Dao.RoleUpdate should have comment or be unexported (golint)
    • Line 52: warning: exported method Dao.RoleDelete should have comment or be unexported (golint)
    • swirl/dao/mongo/perm.go
    • Line 9: warning: exported method Dao.PermGet should have comment or be unexported (golint)
    • Line 26: warning: exported method Dao.PermUpdate should have comment or be unexported (golint)
    • Line 44: warning: exported method Dao.PermDelete should have comment or be unexported (golint)
    • swirl/dao/mongo/registry.go
    • Line 11: warning: exported method Dao.RegistryCreate should have comment or be unexported (golint)
    • Line 18: warning: exported method Dao.RegistryUpdate should have comment or be unexported (golint)
    • Line 34: warning: exported method Dao.RegistryList should have comment or be unexported (golint)
    • Line 42: warning: exported method Dao.RegistryGet should have comment or be unexported (golint)
    • Line 55: warning: exported method Dao.RegistryDelete should have comment or be unexported (golint)
    • swirl/dao/mongo/stack.go
    • Line 13: warning: exported method Dao.StackList should have comment or be unexported (golint)
    • Line 21: warning: exported method Dao.StackCreate should have comment or be unexported (golint)
    • Line 31: warning: exported method Dao.StackGet should have comment or be unexported (golint)
    • Line 44: warning: exported method Dao.StackUpdate should have comment or be unexported (golint)
    • Line 58: warning: exported method Dao.StackDelete should have comment or be unexported (golint)
    • swirl/dao/bolt/bolt.go
    • Line 13: warning: exported type Value should have comment or be unexported (golint)
    • Line 15: warning: exported method Value.Unmarshal should have comment or be unexported (golint)
    • Line 43: warning: exported method Dao.Init should have comment or be unexported (golint)
    • Line 60: warning: exported method Dao.Close should have comment or be unexported (golint)
    • swirl/dao/bolt/chart.go
    • Line 7: warning: exported method Dao.ChartList should have comment or be unexported (golint)
    • Line 19: warning: exported method Dao.ChartCreate should have comment or be unexported (golint)
    • Line 23: warning: exported method Dao.ChartGet should have comment or be unexported (golint)
    • Line 35: warning: exported method Dao.ChartBatch should have comment or be unexported (golint)
    • Line 47: warning: exported method Dao.ChartUpdate should have comment or be unexported (golint)
    • Line 51: warning: exported method Dao.ChartDelete should have comment or be unexported (golint)
    • Line 55: warning: exported method Dao.DashboardGet should have comment or be unexported (golint)
    • Line 71: warning: exported method Dao.DashboardUpdate should have comment or be unexported (golint)
    • swirl/dao/bolt/registry.go
    • Line 12: warning: exported method Dao.RegistryCreate should have comment or be unexported (golint)
    • Line 16: warning: exported method Dao.RegistryUpdate should have comment or be unexported (golint)
    • Line 45: warning: exported method Dao.RegistryList should have comment or be unexported (golint)
    • Line 58: warning: exported method Dao.RegistryGet should have comment or be unexported (golint)
    • Line 70: warning: exported method Dao.RegistryDelete should have comment or be unexported (golint)
    • swirl/dao/bolt/stack.go
    • Line 79: warning: exported method Dao.StackList should have comment or be unexported (golint)
    • Line 91: warning: exported method Dao.StackCreate should have comment or be unexported (golint)
    • Line 97: warning: exported method Dao.StackGet should have comment or be unexported (golint)
    • Line 109: warning: exported method Dao.StackUpdate should have comment or be unexported (golint)
    • Line 134: warning: exported method Dao.StackDelete should have comment or be unexported (golint)
    • swirl/dao/bolt/template.go
    • Line 13: warning: exported method Dao.TemplateList should have comment or be unexported (golint)
    • Line 34: warning: exported method Dao.TemplateCreate should have comment or be unexported (golint)
    • Line 40: warning: exported method Dao.TemplateGet should have comment or be unexported (golint)
    • Line 52: warning: exported method Dao.TemplateUpdate should have comment or be unexported (golint)
    • Line 78: warning: exported method Dao.TemplateDelete should have comment or be unexported (golint)
    • swirl/model/event.go
    • Line 8: warning: exported type EventType should have comment or be unexported (golint)
    • Line 11: warning: exported const EventTypeRegistry should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported type EventAction should have comment or be unexported (golint)
    • Line 29: warning: exported const EventActionLogin should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: comment on exported const EventActionCreate should be of the form "EventActionCreate ..." (golint)
    • Line 42: warning: exported type Event should have comment or be unexported (golint)
    • Line 53: warning: exported method Event.URL should have comment or be unexported (golint)
    • Line 77: warning: exported type EventListArgs should have comment or be unexported (golint)
    • swirl/dao/mongo/template.go
    • Line 11: warning: exported method Dao.TemplateList should have comment or be unexported (golint)
    • Line 30: warning: exported method Dao.TemplateCreate should have comment or be unexported (golint)
    • Line 40: warning: exported method Dao.TemplateGet should have comment or be unexported (golint)
    • Line 53: warning: exported method Dao.TemplateUpdate should have comment or be unexported (golint)
    • Line 68: warning: exported method Dao.TemplateDelete should have comment or be unexported (golint)
    • swirl/dao/bolt/event.go
    • Line 10: warning: exported method Dao.EventList should have comment or be unexported (golint)
    • Line 42: warning: exported method Dao.EventCreate should have comment or be unexported (golint)
    • swirl/dao/bolt/perm.go
    • Line 7: warning: exported method Dao.PermGet should have comment or be unexported (golint)
    • Line 20: warning: exported method Dao.PermUpdate should have comment or be unexported (golint)
    • Line 25: warning: exported method Dao.PermDelete should have comment or be unexported (golint)
    • swirl/dao/bolt/user.go
    • Line 13: warning: exported method Dao.UserCount should have comment or be unexported (golint)
    • Line 17: warning: exported method Dao.UserCreate should have comment or be unexported (golint)
    • Line 21: warning: exported method Dao.UserUpdate should have comment or be unexported (golint)
    • Line 31: warning: exported method Dao.UserBlock should have comment or be unexported (golint)
    • Line 41: warning: exported method Dao.UserDelete should have comment or be unexported (golint)
    • Line 45: warning: exported method Dao.UserList should have comment or be unexported (golint)
    • Line 81: warning: exported method Dao.UserGetByID should have comment or be unexported (golint)
    • Line 93: warning: exported method Dao.UserGetByName should have comment or be unexported (golint)
    • Line 113: warning: exported method Dao.ProfileUpdateInfo should have comment or be unexported (golint)
    • Line 120: warning: exported method Dao.ProfileUpdatePassword should have comment or be unexported (golint)
    • Line 151: warning: exported method Dao.SessionGet should have comment or be unexported (golint)
    • Line 171: warning: exported method Dao.SessionUpdate should have comment or be unexported (golint)
    • swirl/model/docker.go
    • Line 19: warning: exported type Registry should have comment or be unexported (golint)
    • Line 29: warning: exported method Registry.Match should have comment or be unexported (golint)
    • Line 33: warning: exported method Registry.GetEncodedAuth should have comment or be unexported (golint)
    • Line 45: warning: exported type Option should have comment or be unexported (golint)
    • Line 50: warning: exported type Options should have comment or be unexported (golint)
    • Line 52: warning: exported function NewOptions should have comment or be unexported (golint)
    • Line 67: warning: exported method Options.ToMap should have comment or be unexported (golint)
    • Line 81: warning: exported method Options.Compress should have comment or be unexported (golint)
    • Line 94: warning: exported type ServiceListInfo should have comment or be unexported (golint)
    • Line 105: warning: exported function NewServiceListInfo should have comment or be unexported (golint)
    • Line 126: warning: exported type ServiceDetailInfo should have comment or be unexported (golint)
    • Line 140: warning: exported type Network should have comment or be unexported (golint)
    • Line 146: warning: exported function NewServiceDetailInfo should have comment or be unexported (golint)
    • Line 167: warning: exported type ServiceInfo should have comment or be unexported (golint)
    • Line 242: warning: exported function NewServiceInfo should have comment or be unexported (golint)
    • Line 362: warning: comment on exported method ServiceInfo.ToServiceSpec should be of the form "ToServiceSpec ..." (golint)
    • Line 367: warning: exported method ServiceInfo.Normalize should have comment or be unexported (golint)
    • Line 392: warning: exported method ServiceInfo.GetDNSConfig should have comment or be unexported (golint)
    • Line 410: warning: exported type EndpointPort should have comment or be unexported (golint)
    • Line 421: warning: exported type Mount should have comment or be unexported (golint)
    • Line 429: warning: exported type ResourceInfo should have comment or be unexported (golint)
    • Line 434: warning: exported function NewResourceInfo should have comment or be unexported (golint)
    • Line 445: warning: exported method ResourceInfo.IsSet should have comment or be unexported (golint)
    • Line 449: warning: exported method ResourceInfo.ToResources should have comment or be unexported (golint)
    • Line 463: warning: exported type ConfigInfo should have comment or be unexported (golint)
    • Line 472: warning: exported function NewSecretInfo should have comment or be unexported (golint)
    • Line 484: warning: exported function NewConfigInfo should have comment or be unexported (golint)
    • Line 496: warning: exported method ConfigInfo.ToSecret should have comment or be unexported (golint)
    • Line 510: warning: exported method ConfigInfo.ToConfig should have comment or be unexported (golint)
    • Line 524: warning: exported type PlacementPreference should have comment or be unexported (golint)
    • Line 528: warning: exported type PlacementConstraint should have comment or be unexported (golint)
    • Line 534: warning: exported function NewPlacementConstraint should have comment or be unexported (golint)
    • Line 553: warning: exported method PlacementConstraint.ToConstraint should have comment or be unexported (golint)
    • Line 560: warning: exported type Driver should have comment or be unexported (golint)
    • Line 565: warning: exported type ConfigCreateInfo should have comment or be unexported (golint)
    • Line 573: warning: exported type ConfigUpdateInfo should have comment or be unexported (golint)
    • Line 579: warning: exported type TaskListArgs should have comment or be unexported (golint)
    • Line 588: warning: exported type TaskInfo should have comment or be unexported (golint)
    • Line 594: warning: exported function NewTaskInfo should have comment or be unexported (golint)
    • Line 602: warning: exported type NodeListInfo should have comment or be unexported (golint)
    • Line 614: warning: exported function NewNodeListInfo should have comment or be unexported (golint)
    • Line 632: warning: exported type NodeUpdateInfo should have comment or be unexported (golint)
    • Line 640: warning: exported type NetworkCreateInfo should have comment or be unexported (golint)
    • Line 664: warning: exported type VolumeCreateInfo should have comment or be unexported (golint)
    • Line 672: warning: exported type ImageListInfo should have comment or be unexported (golint)
    • Line 677: warning: exported function NewImageListInfo should have comment or be unexported (golint)
    • Line 685: warning: exported type ContainerListArgs should have comment or be unexported (golint)
    • Line 693: warning: exported type ContainerListInfo should have comment or be unexported (golint)
    • Line 698: warning: exported function NewContainerListInfo should have comment or be unexported (golint)
    • swirl/dao/mongo/user.go
    • Line 11: warning: exported method Dao.UserCount should have comment or be unexported (golint)
    • Line 18: warning: exported method Dao.UserCreate should have comment or be unexported (golint)
    • Line 25: warning: exported method Dao.UserUpdate should have comment or be unexported (golint)
    • Line 42: warning: exported method Dao.UserBlock should have comment or be unexported (golint)
    • Line 61: warning: exported method Dao.UserDelete should have comment or be unexported (golint)
    • Line 68: warning: exported method Dao.UserList should have comment or be unexported (golint)
    • Line 99: warning: exported method Dao.UserGetByID should have comment or be unexported (golint)
    • Line 110: warning: exported method Dao.UserGetByName should have comment or be unexported (golint)
    • Line 121: warning: exported method Dao.ProfileUpdateInfo should have comment or be unexported (golint)
    • Line 135: warning: exported method Dao.ProfileUpdatePassword should have comment or be unexported (golint)
    • Line 149: warning: exported method Dao.SessionGet should have comment or be unexported (golint)
    • Line 160: warning: exported method Dao.SessionUpdate should have comment or be unexported (golint)
    • swirl/misc/util.go
    • Line 15: warning: exported var Funcs should have comment or be unexported (golint)
    • Line 39: warning: exported function NewID should have comment or be unexported (golint)
    • Line 43: warning: exported function Message should have comment or be unexported (golint)
    • Line 60: warning: exported function FormatTime should have comment or be unexported (golint)
    • Line 75: warning: exported function Page should have comment or be unexported (golint)
    • Line 86: warning: exported function JSONIndent should have comment or be unexported (golint)
    • swirl/dao/mongo/mongo.go
    • Line 56: warning: exported type Dao should have comment or be unexported (golint)
    • Line 61: warning: exported function New should have comment or be unexported (golint)
    • Line 78: warning: exported method Dao.Init should have comment or be unexported (golint)
    • Line 93: warning: exported method Dao.Close should have comment or be unexported (golint)
    • swirl/dao/bolt/role.go
    • Line 12: warning: exported method Dao.RoleList should have comment or be unexported (golint)
    • Line 24: warning: exported method Dao.RoleCreate should have comment or be unexported (golint)
    • Line 28: warning: exported method Dao.RoleGet should have comment or be unexported (golint)
    • Line 40: warning: exported method Dao.RoleUpdate should have comment or be unexported (golint)
    • Line 66: warning: exported method Dao.RoleDelete should have comment or be unexported (golint)
    • swirl/model/service.go
    • Line 5: warning: exported type Archive should have comment or be unexported (golint)
    • Line 15: warning: exported type ArchiveListArgs should have comment or be unexported (golint)
    • Line 21: warning: exported type Stack should have comment or be unexported (golint)
    • Line 32: warning: exported type StackListArgs should have comment or be unexported (golint)
    • Line 37: warning: exported type Template should have comment or be unexported (golint)
    • Line 47: warning: exported type TemplateListArgs should have comment or be unexported (golint)
    • swirl/dao/mongo/chart.go
    • Line 9: warning: exported method Dao.ChartList should have comment or be unexported (golint)
    • Line 17: warning: exported method Dao.ChartCreate should have comment or be unexported (golint)
    • Line 24: warning: exported method Dao.ChartGet should have comment or be unexported (golint)
    • Line 37: warning: exported method Dao.ChartBatch should have comment or be unexported (golint)
    • Line 46: warning: exported method Dao.ChartUpdate should have comment or be unexported (golint)
    • Line 53: warning: exported method Dao.ChartDelete should have comment or be unexported (golint)
    • Line 60: warning: exported method Dao.DashboardGet should have comment or be unexported (golint)
    • Line 76: warning: exported method Dao.DashboardUpdate should have comment or be unexported (golint)
    • swirl/dao/mongo/event.go
    • Line 8: warning: exported method Dao.EventList should have comment or be unexported (golint)
    • Line 30: warning: exported method Dao.EventCreate should have comment or be unexported (golint)
    • swirl/dao/bolt/setting.go
    • Line 9: warning: exported method Dao.SettingGet should have comment or be unexported (golint)
    • Line 21: warning: exported method Dao.SettingUpdate should have comment or be unexported (golint)
    • swirl/model/auth.go
    • Line 9: warning: exported type UserType should have comment or be unexported (golint)
    • Line 18: warning: exported type UserStatus should have comment or be unexported (golint)
    • Line 27: warning: exported type Role should have comment or be unexported (golint)
    • Line 36: warning: exported type User should have comment or be unexported (golint)
    • Line 51: warning: exported type UserListArgs should have comment or be unexported (golint)
    • Line 59: warning: exported type Session should have comment or be unexported (golint)
    • Line 66: warning: exported type AuthUser should have comment or be unexported (golint)
    • Line 72: warning: exported function NewAuthUser should have comment or be unexported (golint)
    • Line 89: warning: exported method AuthUser.ID should have comment or be unexported (golint)
    • Line 93: warning: exported method AuthUser.Name should have comment or be unexported (golint)
    • Line 97: warning: exported method AuthUser.Anonymous should have comment or be unexported (golint)
    • Line 101: warning: exported method AuthUser.Admin should have comment or be unexported (golint)
    • Line 105: warning: exported method AuthUser.IsInRole should have comment or be unexported (golint)
    • Line 114: warning: exported method AuthUser.IsAllowed should have comment or be unexported (golint)
    • swirl/model/metric.go
    • Line 28: warning: exported function NewChart should have comment or be unexported (golint)
    • Line 44: warning: exported type ChartMetric should have comment or be unexported (golint)
    • Line 49: warning: exported type ChartOption should have comment or be unexported (golint)
    • Line 56: warning: exported type ChartDashboard should have comment or be unexported (golint)
    • Line 64: warning: exported method ChartDashboard.ID should have comment or be unexported (golint)
    • Line 71: warning: exported type ChartPoint should have comment or be unexported (golint)
    • Line 76: warning: exported method ChartPoint.MarshalJSON should have comment or be unexported (golint)
    • Line 80: warning: exported type ChartLine should have comment or be unexported (golint)
    • Line 85: warning: exported type ChartMatrixData should have comment or be unexported (golint)
    • Line 90: warning: exported type ChartValue should have comment or be unexported (golint)
    • Line 95: warning: exported type ChartVectorData 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!