Preparing report...

Report for github.com/ansible-semaphore/semaphore

B    Not bad!    Found 50 issues across 77 files

Tweet

gofmt49%

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!


gocyclo96%

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.


golint63%

Golint is a linter for Go source code.

    • semaphore/db/sql/event.go
    • Line 42: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 82: warning: exported method SqlDb.CreateEvent should have comment or be unexported (golint)
    • Line 102: warning: exported method SqlDb.GetUserEvents should have comment or be unexported (golint)
    • Line 113: warning: exported method SqlDb.GetEvents should have comment or be unexported (golint)
    • semaphore/db/sql/project.go
    • Line 9: warning: exported method SqlDb.CreateProject should have comment or be unexported (golint)
    • Line 27: warning: exported method SqlDb.GetProjects should have comment or be unexported (golint)
    • Line 44: warning: exported method SqlDb.GetProject should have comment or be unexported (golint)
    • Line 59: warning: exported method SqlDb.DeleteProject should have comment or be unexported (golint)
    • Line 87: warning: exported method SqlDb.UpdateProject should have comment or be unexported (golint)
    • semaphore/db/bolt/project.go
    • Line 8: warning: exported method BoltDb.CreateProject should have comment or be unexported (golint)
    • Line 20: warning: exported method BoltDb.GetProjects should have comment or be unexported (golint)
    • Line 44: warning: exported method BoltDb.GetProject should have comment or be unexported (golint)
    • Line 49: warning: exported method BoltDb.DeleteProject should have comment or be unexported (golint)
    • Line 53: warning: exported method BoltDb.UpdateProject should have comment or be unexported (golint)
    • semaphore/db/sql/environment.go
    • Line 5: warning: exported method SqlDb.GetEnvironment should have comment or be unexported (golint)
    • Line 11: warning: exported method SqlDb.GetEnvironments should have comment or be unexported (golint)
    • Line 17: warning: exported method SqlDb.UpdateEnvironment should have comment or be unexported (golint)
    • Line 26: warning: exported method SqlDb.CreateEnvironment should have comment or be unexported (golint)
    • Line 49: warning: exported method SqlDb.DeleteEnvironment should have comment or be unexported (golint)
    • Line 53: warning: exported method SqlDb.DeleteEnvironmentSoft should have comment or be unexported (golint)
    • semaphore/db/bolt/repository.go
    • Line 7: warning: exported method BoltDb.GetRepository should have comment or be unexported (golint)
    • Line 16: warning: exported method BoltDb.GetRepositories should have comment or be unexported (golint)
    • Line 21: warning: exported method BoltDb.UpdateRepository should have comment or be unexported (golint)
    • Line 25: warning: exported method BoltDb.CreateRepository should have comment or be unexported (golint)
    • Line 30: warning: exported method BoltDb.DeleteRepository should have comment or be unexported (golint)
    • Line 34: warning: exported method BoltDb.DeleteRepositorySoft should have comment or be unexported (golint)
    • semaphore/db/bolt/task.go
    • Line 9: warning: exported method BoltDb.CreateTask should have comment or be unexported (golint)
    • Line 19: warning: exported method BoltDb.UpdateTask should have comment or be unexported (golint)
    • Line 23: warning: exported method BoltDb.CreateTaskOutput should have comment or be unexported (golint)
    • Line 80: warning: exported method BoltDb.GetTask should have comment or be unexported (golint)
    • Line 92: warning: exported method BoltDb.GetTemplateTasks should have comment or be unexported (golint)
    • Line 96: warning: exported method BoltDb.GetProjectTasks should have comment or be unexported (golint)
    • Line 100: warning: exported method BoltDb.DeleteTaskWithOutputs should have comment or be unexported (golint)
    • Line 120: warning: exported method BoltDb.GetTaskOutputs should have comment or be unexported (golint)
    • semaphore/db/bolt/access_key.go
    • Line 7: warning: exported method BoltDb.GetAccessKey should have comment or be unexported (golint)
    • Line 13: warning: exported method BoltDb.GetAccessKeys should have comment or be unexported (golint)
    • Line 19: warning: exported method BoltDb.UpdateAccessKey should have comment or be unexported (golint)
    • Line 23: warning: exported method BoltDb.CreateAccessKey should have comment or be unexported (golint)
    • Line 28: warning: exported method BoltDb.DeleteAccessKey should have comment or be unexported (golint)
    • Line 32: warning: exported method BoltDb.DeleteAccessKeySoft should have comment or be unexported (golint)
    • Line 36: warning: exported method BoltDb.GetGlobalAccessKey should have comment or be unexported (golint)
    • Line 41: warning: exported method BoltDb.GetGlobalAccessKeys should have comment or be unexported (golint)
    • Line 46: warning: exported method BoltDb.UpdateGlobalAccessKey should have comment or be unexported (golint)
    • Line 50: warning: exported method BoltDb.CreateGlobalAccessKey should have comment or be unexported (golint)
    • Line 55: warning: exported method BoltDb.DeleteGlobalAccessKey should have comment or be unexported (golint)
    • Line 59: warning: exported method BoltDb.DeleteGlobalAccessKeySoft should have comment or be unexported (golint)
    • semaphore/db/sql/inventory.go
    • Line 5: warning: exported method SqlDb.GetInventory should have comment or be unexported (golint)
    • Line 25: warning: exported method SqlDb.GetInventories should have comment or be unexported (golint)
    • Line 31: warning: exported method SqlDb.DeleteInventory should have comment or be unexported (golint)
    • Line 35: warning: exported method SqlDb.DeleteInventorySoft should have comment or be unexported (golint)
    • Line 39: warning: exported method SqlDb.UpdateInventory should have comment or be unexported (golint)
    • Line 52: warning: exported method SqlDb.CreateInventory should have comment or be unexported (golint)
    • semaphore/db/bolt/template.go
    • Line 7: warning: exported method BoltDb.CreateTemplate should have comment or be unexported (golint)
    • Line 12: warning: exported method BoltDb.UpdateTemplate should have comment or be unexported (golint)
    • Line 16: warning: exported method BoltDb.GetTemplates should have comment or be unexported (golint)
    • Line 21: warning: exported method BoltDb.GetTemplate should have comment or be unexported (golint)
    • Line 26: warning: exported method BoltDb.DeleteTemplate should have comment or be unexported (golint)
    • semaphore/db/sql/repository.go
    • Line 8: warning: exported method SqlDb.GetRepository should have comment or be unexported (golint)
    • Line 21: warning: exported method SqlDb.GetRepositories should have comment or be unexported (golint)
    • Line 54: warning: exported method SqlDb.UpdateRepository should have comment or be unexported (golint)
    • Line 65: warning: exported method SqlDb.CreateRepository should have comment or be unexported (golint)
    • Line 87: warning: exported method SqlDb.DeleteRepository should have comment or be unexported (golint)
    • Line 91: warning: exported method SqlDb.DeleteRepositorySoft should have comment or be unexported (golint)
    • semaphore/db/bolt/BoltDb.go
    • Line 14: warning: exported const MaxID should have comment or be unexported (golint)
    • Line 31: warning: exported type BoltDb should have comment or be unexported (golint)
    • Line 65: warning: exported method BoltDb.Migrate should have comment or be unexported (golint)
    • Line 69: warning: exported method BoltDb.Connect should have comment or be unexported (golint)
    • Line 90: warning: exported method BoltDb.Close should have comment or be unexported (golint)
    • semaphore/db/bolt/session.go
    • Line 19: warning: exported method BoltDb.CreateSession should have comment or be unexported (golint)
    • Line 27: warning: exported method BoltDb.CreateAPIToken should have comment or be unexported (golint)
    • Line 43: warning: exported method BoltDb.GetAPIToken should have comment or be unexported (golint)
    • Line 53: warning: exported method BoltDb.ExpireAPIToken should have comment or be unexported (golint)
    • Line 64: warning: exported method BoltDb.GetSession should have comment or be unexported (golint)
    • Line 69: warning: exported method BoltDb.ExpireSession should have comment or be unexported (golint)
    • Line 80: warning: exported method BoltDb.TouchSession should have comment or be unexported (golint)
    • Line 91: warning: exported method BoltDb.GetAPITokens should have comment or be unexported (golint)
    • semaphore/db/bolt/user.go
    • Line 10: warning: exported method BoltDb.CreateUserWithoutPassword should have comment or be unexported (golint)
    • Line 30: warning: exported method BoltDb.CreateUser should have comment or be unexported (golint)
    • Line 56: warning: exported method BoltDb.DeleteUser should have comment or be unexported (golint)
    • Line 71: warning: exported method BoltDb.UpdateUser should have comment or be unexported (golint)
    • Line 94: warning: exported method BoltDb.SetUserPassword should have comment or be unexported (golint)
    • Line 107: warning: exported method BoltDb.CreateProjectUser should have comment or be unexported (golint)
    • Line 117: warning: exported method BoltDb.GetProjectUser should have comment or be unexported (golint)
    • Line 123: warning: exported method BoltDb.GetProjectUsers should have comment or be unexported (golint)
    • Line 141: warning: exported method BoltDb.UpdateProjectUser should have comment or be unexported (golint)
    • Line 145: warning: exported method BoltDb.DeleteProjectUser should have comment or be unexported (golint)
    • Line 155: warning: exported method BoltDb.GetUsers should have comment or be unexported (golint)
    • Line 160: warning: exported method BoltDb.GetUserByLoginOrEmail should have comment or be unexported (golint)
    • semaphore/db/sql/SqlDb.go
    • Line 17: warning: exported type SqlDb should have comment or be unexported (golint)
    • Line 284: warning: exported method SqlDb.Migrate should have comment or be unexported (golint)
    • Line 313: warning: exported method SqlDb.Close should have comment or be unexported (golint)
    • Line 317: warning: exported method SqlDb.Connect should have comment or be unexported (golint)
    • Line 396: warning: exported method SqlDb.Sql should have comment or be unexported (golint)
    • semaphore/db/sql/access_key.go
    • Line 5: warning: exported method SqlDb.GetAccessKey should have comment or be unexported (golint)
    • Line 11: warning: exported method SqlDb.GetAccessKeys should have comment or be unexported (golint)
    • Line 17: warning: exported method SqlDb.UpdateAccessKey should have comment or be unexported (golint)
    • Line 30: warning: exported method SqlDb.CreateAccessKey should have comment or be unexported (golint)
    • Line 53: warning: exported method SqlDb.DeleteAccessKey should have comment or be unexported (golint)
    • Line 57: warning: exported method SqlDb.DeleteAccessKeySoft should have comment or be unexported (golint)
    • Line 62: warning: exported method SqlDb.GetGlobalAccessKey should have comment or be unexported (golint)
    • Line 68: warning: exported method SqlDb.GetGlobalAccessKeys should have comment or be unexported (golint)
    • Line 74: warning: exported method SqlDb.UpdateGlobalAccessKey should have comment or be unexported (golint)
    • Line 86: warning: exported method SqlDb.CreateGlobalAccessKey should have comment or be unexported (golint)
    • Line 108: warning: exported method SqlDb.DeleteGlobalAccessKey should have comment or be unexported (golint)
    • Line 112: warning: exported method SqlDb.DeleteGlobalAccessKeySoft should have comment or be unexported (golint)
    • semaphore/db/sql/user.go
    • Line 12: warning: exported method SqlDb.CreateUserWithoutPassword should have comment or be unexported (golint)
    • Line 32: warning: exported method SqlDb.CreateUser should have comment or be unexported (golint)
    • Line 58: warning: exported method SqlDb.DeleteUser should have comment or be unexported (golint)
    • Line 63: warning: exported method SqlDb.UpdateUser should have comment or be unexported (golint)
    • Line 94: warning: exported method SqlDb.SetUserPassword should have comment or be unexported (golint)
    • Line 103: warning: exported method SqlDb.CreateProjectUser should have comment or be unexported (golint)
    • Line 117: warning: exported method SqlDb.GetProjectUser should have comment or be unexported (golint)
    • Line 132: warning: exported method SqlDb.GetProjectUsers should have comment or be unexported (golint)
    • Line 163: warning: exported method SqlDb.UpdateProjectUser should have comment or be unexported (golint)
    • Line 172: warning: exported method SqlDb.DeleteProjectUser should have comment or be unexported (golint)
    • Line 190: warning: exported method SqlDb.GetUsers should have comment or be unexported (golint)
    • Line 202: warning: exported method SqlDb.GetUserByLoginOrEmail should have comment or be unexported (golint)
    • semaphore/db/sql/task.go
    • Line 9: warning: exported method SqlDb.CreateTask should have comment or be unexported (golint)
    • Line 14: warning: exported method SqlDb.UpdateTask should have comment or be unexported (golint)
    • Line 25: warning: exported method SqlDb.CreateTaskOutput should have comment or be unexported (golint)
    • Line 58: warning: exported method SqlDb.GetTask should have comment or be unexported (golint)
    • Line 79: warning: exported method SqlDb.GetTemplateTasks should have comment or be unexported (golint)
    • Line 83: warning: exported method SqlDb.GetProjectTasks should have comment or be unexported (golint)
    • Line 87: warning: exported method SqlDb.DeleteTaskWithOutputs should have comment or be unexported (golint)
    • Line 105: warning: exported method SqlDb.GetTaskOutputs should have comment or be unexported (golint)
    • semaphore/db/bolt/event.go
    • Line 84: warning: exported method BoltDb.CreateEvent should have comment or be unexported (golint)
    • Line 112: warning: exported method BoltDb.GetUserEvents should have comment or be unexported (golint)
    • Line 134: warning: exported method BoltDb.GetEvents should have comment or be unexported (golint)
    • semaphore/db/bolt/inventory.go
    • Line 8: warning: exported method BoltDb.GetInventory should have comment or be unexported (golint)
    • Line 29: warning: exported method BoltDb.GetInventories should have comment or be unexported (golint)
    • Line 34: warning: exported method BoltDb.DeleteInventory should have comment or be unexported (golint)
    • Line 39: warning: exported method BoltDb.DeleteInventorySoft should have comment or be unexported (golint)
    • Line 43: warning: exported method BoltDb.UpdateInventory should have comment or be unexported (golint)
    • Line 47: warning: exported method BoltDb.CreateInventory should have comment or be unexported (golint)
    • semaphore/util/config.go
    • Line 43: warning: exported type DbDriver should have comment or be unexported (golint)
    • Line 46: warning: exported const DbDriverMySQL should have comment (or a comment on this block) or be unexported (golint)
    • Line 50: warning: exported type DbConfig should have comment or be unexported (golint)
    • Line 277: warning: exported method DbConfig.HasSupportMultipleDatabases should have comment or be unexported (golint)
    • Line 281: warning: exported method DbConfig.GetConnectionString should have comment or be unexported (golint)
    • Line 306: warning: exported method ConfigType.GetDBConfig should have comment or be unexported (golint)
    • Line 329: warning: exported method ConfigType.ScanBoltDb should have comment or be unexported (golint)
    • Line 340: warning: exported method ConfigType.ScanMySQL should have comment or be unexported (golint)
    • Line 364: warning: comment on exported method ConfigType.Scan should be of the form "Scan ..." (golint)
    • semaphore/db/Store.go
    • Line 21: warning: exported type RetrieveQueryParams should have comment or be unexported (golint)
    • Line 28: warning: exported type ObjectScope should have comment or be unexported (golint)
    • Line 30: warning: exported type ObjectProperties should have comment or be unexported (golint)
    • Line 39: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 40: warning: exported var ErrInvalidOperation should have comment or be unexported (golint)
    • Line 42: warning: exported function ValidateUsername should have comment or be unexported (golint)
    • Line 46: warning: exported type Store should have comment or be unexported (golint)
    • Line 138: warning: exported var AccessKeyProps should have comment or be unexported (golint)
    • Line 145: warning: exported var GlobalAccessKeyProps should have comment or be unexported (golint)
    • Line 153: warning: exported var EnvironmentProps should have comment or be unexported (golint)
    • Line 160: warning: exported var InventoryProps should have comment or be unexported (golint)
    • Line 167: warning: exported var RepositoryProps should have comment or be unexported (golint)
    • Line 173: warning: exported var TemplateProps should have comment or be unexported (golint)
    • Line 179: warning: exported var ProjectUserProps should have comment or be unexported (golint)
    • Line 184: warning: exported var ProjectProps should have comment or be unexported (golint)
    • Line 190: warning: exported var UserProps should have comment or be unexported (golint)
    • Line 196: warning: exported var SessionProps should have comment or be unexported (golint)
    • Line 201: warning: exported var TokenProps should have comment or be unexported (golint)
    • Line 206: warning: exported var TaskProps should have comment or be unexported (golint)
    • Line 213: warning: exported var TaskOutputProps should have comment or be unexported (golint)
    • semaphore/api/helpers/helpers.go
    • Line 22: warning: exported function Store should have comment or be unexported (golint)
    • Line 72: warning: exported function WriteError should have comment or be unexported (golint)
    • Line 88: warning: exported function GetMD5Hash should have comment or be unexported (golint)
    • semaphore/db/bolt/environment.go
    • Line 5: warning: exported method BoltDb.GetEnvironment should have comment or be unexported (golint)
    • Line 10: warning: exported method BoltDb.GetEnvironments should have comment or be unexported (golint)
    • Line 15: warning: exported method BoltDb.UpdateEnvironment should have comment or be unexported (golint)
    • Line 19: warning: exported method BoltDb.CreateEnvironment should have comment or be unexported (golint)
    • Line 24: warning: exported method BoltDb.DeleteEnvironment should have comment or be unexported (golint)
    • Line 28: warning: exported method BoltDb.DeleteEnvironmentSoft should have comment or be unexported (golint)
    • semaphore/db/sql/session.go
    • Line 9: warning: exported method SqlDb.CreateSession should have comment or be unexported (golint)
    • Line 14: warning: exported method SqlDb.CreateAPIToken should have comment or be unexported (golint)
    • Line 20: warning: exported method SqlDb.GetAPIToken should have comment or be unexported (golint)
    • Line 30: warning: exported method SqlDb.ExpireAPIToken should have comment or be unexported (golint)
    • Line 36: warning: exported method SqlDb.GetSession should have comment or be unexported (golint)
    • Line 46: warning: exported method SqlDb.ExpireSession should have comment or be unexported (golint)
    • Line 52: warning: exported method SqlDb.TouchSession should have comment or be unexported (golint)
    • Line 58: warning: exported method SqlDb.GetAPITokens should have comment or be unexported (golint)
    • semaphore/db/sql/template.go
    • Line 9: warning: exported method SqlDb.CreateTemplate should have comment or be unexported (golint)
    • Line 35: warning: exported method SqlDb.UpdateTemplate should have comment or be unexported (golint)
    • Line 50: warning: exported method SqlDb.GetTemplates should have comment or be unexported (golint)
    • Line 103: warning: exported method SqlDb.GetTemplate should have comment or be unexported (golint)
    • Line 119: warning: exported method SqlDb.DeleteTemplate should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.

    • semaphore/cli/main.go
    • Line 43: warning: Version not declared by package util (ineffassign)
    • Line 50: warning: Version not declared by package util (ineffassign)
    • Line 226: warning: Version not declared by package util (ineffassign)
    • Line 231: warning: Version not declared by package util (ineffassign)
    • semaphore/api/router.go
    • Line 314: warning: Version not declared by package util (ineffassign)
    • Line 333: warning: Version not declared by package util (ineffassign)
    • Line 347: warning: Version not declared by package util (ineffassign)
    • Line 314: warning: Version not declared by package util (ineffassign)
    • Line 333: warning: Version not declared by package util (ineffassign)
    • Line 347: warning: Version not declared by package util (ineffassign)

misspell98%

Misspell Finds commonly misspelled English words