Preparing report...

Report for github.com/DoodleScheduling/k8sdb-controller

(v0.0.9-pre)

A    Great!    Found 17 issues across 20 files

Tweet

gofmt90%

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!


gocyclo100%

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.

No problems detected. Good job!


golint25%

Golint is a linter for Go source code.

    • api/v1beta1/database_types.go
    • Line 75: warning: exported type Role should have comment or be unexported (golint)
    • Line 95: warning: exported function DatabaseNotReadyCondition should have comment or be unexported (golint)
    • Line 99: warning: exported function DatabaseReadyCondition should have comment or be unexported (golint)
    • Line 103: warning: exported function ExtensionNotReadyCondition should have comment or be unexported (golint)
    • Line 107: warning: exported function UserNotReadyCondition should have comment or be unexported (golint)
    • Line 111: warning: exported function UserReadyCondition should have comment or be unexported (golint)
    • common/db/db.go
    • Line 7: warning: exported type Roles should have comment or be unexported (golint)
    • Line 8: warning: exported type Role should have comment or be unexported (golint)
    • Line 13: warning: exported type Users should have comment or be unexported (golint)
    • Line 14: warning: exported type User should have comment or be unexported (golint)
    • controllers/common_handler.go
    • Line 76: 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 82: 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)
    • controllers/postgresqluser_controller.go
    • Line 47: warning: exported method PostgreSQLUserReconciler.SetupWithManager should have comment or be unexported (golint)
    • Line 136: warning: exported method PostgreSQLUserReconciler.Reconcile should have comment or be unexported (golint)
    • common/stringutils/utils.go
    • Line 3: warning: comment on exported function ContainsString should be of the form "ContainsString ..." (golint)
    • Line 13: warning: exported function RemoveString should have comment or be unexported (golint)
    • api/v1beta1/mongodbuser_type.go
    • Line 24: warning: exported type MongoDBUserSpec should have comment or be unexported (golint)
    • Line 71: warning: exported method MongoDBUser.GetDatabase should have comment or be unexported (golint)
    • Line 75: warning: exported method MongoDBUser.GetCredentials should have comment or be unexported (golint)
    • Line 79: warning: exported method MongoDBUser.GetRoles should have comment or be unexported (golint)
    • Line 96: warning: comment on exported method MongoDBUser.SetFinalizer should be of the form "SetFinalizer ..." (golint)
    • Line 98: warning: receiver name d should be consistent with previous receiver name in for MongoDBUser (golint)
    • Line 112: warning: receiver name d should be consistent with previous receiver name in for MongoDBUser (golint)
    • api/v1beta1/postgresqldatabase_types.go
    • Line 60: warning: exported method PostgreSQLDatabase.GetAtlasGroupId should have comment or be unexported (golint)
    • Line 64: warning: exported method PostgreSQLDatabase.GetAddress should have comment or be unexported (golint)
    • Line 68: warning: exported method PostgreSQLDatabase.GetRootSecret should have comment or be unexported (golint)
    • Line 72: warning: exported method PostgreSQLDatabase.GetDatabaseName should have comment or be unexported (golint)
    • Line 80: warning: exported method PostgreSQLDatabase.GetRootDatabaseName should have comment or be unexported (golint)
    • Line 84: warning: exported method PostgreSQLDatabase.GetExtensions should have comment or be unexported (golint)
    • Line 97: warning: comment on exported method PostgreSQLDatabase.SetFinalizer should be of the form "SetFinalizer ..." (golint)
    • Line 99: warning: receiver name d should be consistent with previous receiver name in for PostgreSQLDatabase (golint)
    • Line 113: warning: receiver name d should be consistent with previous receiver name in for PostgreSQLDatabase (golint)
    • Line 125: warning: exported method PostgreSQLDatabase.SetDefaults should have comment or be unexported (golint)
    • Line 125: warning: receiver name d should be consistent with previous receiver name in for PostgreSQLDatabase (golint)
    • common/db/atlas.go
    • Line 11: warning: exported type AtlasRepository should have comment or be unexported (golint)
    • Line 16: warning: exported function NewAtlasRepository should have comment or be unexported (golint)
    • Line 29: warning: exported method AtlasRepository.Close should have comment or be unexported (golint)
    • Line 39: warning: exported method AtlasRepository.SetupUser should have comment or be unexported (golint)
    • Line 63: warning: exported method AtlasRepository.DropUser should have comment or be unexported (golint)
    • Line 68: warning: exported method AtlasRepository.EnableExtension should have comment or be unexported (golint)
    • controllers/mongodbuser_controller.go
    • Line 47: warning: exported method MongoDBUserReconciler.SetupWithManager should have comment or be unexported (golint)
    • Line 136: warning: exported method MongoDBUserReconciler.Reconcile should have comment or be unexported (golint)
    • api/v1beta1/postgresqluser_type.go
    • Line 24: warning: exported type PostgreSQLUserSpec should have comment or be unexported (golint)
    • Line 63: warning: exported method PostgreSQLUser.GetDatabase should have comment or be unexported (golint)
    • Line 67: warning: exported method PostgreSQLUser.GetCredentials should have comment or be unexported (golint)
    • Line 71: warning: exported method PostgreSQLUser.GetRoles should have comment or be unexported (golint)
    • Line 85: warning: comment on exported method PostgreSQLUser.SetFinalizer should be of the form "SetFinalizer ..." (golint)
    • Line 87: warning: receiver name d should be consistent with previous receiver name in for PostgreSQLUser (golint)
    • Line 101: warning: receiver name d should be consistent with previous receiver name in for PostgreSQLUser (golint)
    • common/db/postgresql.go
    • Line 13: warning: exported type PostgreSQLRepository should have comment or be unexported (golint)
    • Line 18: warning: exported const DefaultPostgreSQLReadRole should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported function NewPostgreSQLRepository should have comment or be unexported (golint)
    • Line 32: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 59: warning: exported method PostgreSQLRepository.Close should have comment or be unexported (golint)
    • Line 64: warning: comment on exported method PostgreSQLRepository.CreateDatabaseIfNotExists should be of the form "CreateDatabaseIfNotExists ..." (golint)
    • Line 68: 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 74: 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 77: 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 80: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 88: warning: exported method PostgreSQLRepository.SetupUser should have comment or be unexported (golint)
    • Line 101: warning: exported method PostgreSQLRepository.DropUser should have comment or be unexported (golint)
    • Line 111: warning: exported method PostgreSQLRepository.EnableExtension should have comment or be unexported (golint)
    • Line 123: 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 129: 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 132: 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 135: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 151: 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 157: 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 160: 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 163: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • controllers/postgresqldatabase_controller.go
    • Line 47: warning: exported method PostgreSQLDatabaseReconciler.SetupWithManager should have comment or be unexported (golint)
    • Line 97: warning: exported method PostgreSQLDatabaseReconciler.Reconcile should have comment or be unexported (golint)
    • api/v1beta1/mongodbdatabase_types.go
    • Line 61: warning: exported method MongoDBDatabase.GetAtlasGroupId should have comment or be unexported (golint)
    • Line 65: warning: exported method MongoDBDatabase.GetAddress should have comment or be unexported (golint)
    • Line 69: warning: exported method MongoDBDatabase.GetRootSecret should have comment or be unexported (golint)
    • Line 73: warning: exported method MongoDBDatabase.GetDatabaseName should have comment or be unexported (golint)
    • Line 81: warning: exported method MongoDBDatabase.GetRootDatabaseName should have comment or be unexported (golint)
    • Line 85: warning: exported method MongoDBDatabase.GetExtensions should have comment or be unexported (golint)
    • Line 98: warning: comment on exported method MongoDBDatabase.SetFinalizer should be of the form "SetFinalizer ..." (golint)
    • Line 100: warning: receiver name d should be consistent with previous receiver name in for MongoDBDatabase (golint)
    • Line 114: warning: receiver name d should be consistent with previous receiver name in for MongoDBDatabase (golint)
    • Line 126: warning: exported method MongoDBDatabase.SetDefaults should have comment or be unexported (golint)
    • Line 126: warning: receiver name d should be consistent with previous receiver name in for MongoDBDatabase (golint)
    • common/db/mongodb.go
    • Line 20: warning: exported type MongoDBRepository should have comment or be unexported (golint)
    • Line 24: warning: exported function NewMongoDBRepository should have comment or be unexported (golint)
    • Line 48: warning: exported method MongoDBRepository.Close should have comment or be unexported (golint)
    • Line 58: warning: exported method MongoDBRepository.SetupUser should have comment or be unexported (golint)
    • Line 82: warning: exported method MongoDBRepository.DropUser should have comment or be unexported (golint)
    • Line 91: warning: exported method MongoDBRepository.EnableExtension should have comment or be unexported (golint)
    • controllers/mongodbdatabase_controller.go
    • Line 47: warning: exported method MongoDBDatabaseReconciler.SetupWithManager should have comment or be unexported (golint)
    • Line 97: warning: exported method MongoDBDatabaseReconciler.Reconcile should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell90%

Misspell Finds commonly misspelled English words