Preparing report...

Report for github.com/ScottKGregory/tonic

A    Great!    Found 34 issues across 37 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!


gocyclo97%

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.


golint10%

Golint is a linter for Go source code.

    • tonic/pkg/handlers/home.go
    • Line 10: warning: exported type HomeHandler should have comment or be unexported (golint)
    • Line 14: warning: exported function NewHomeHandler should have comment or be unexported (golint)
    • Line 52: warning: exported method HomeHandler.Home should have comment or be unexported (golint)
    • tonic/pkg/handlers/errors.go
    • Line 21: warning: exported type ErrorHandler should have comment or be unexported (golint)
    • Line 25: warning: exported function NewErrorHandler should have comment or be unexported (golint)
    • tonic/pkg/handlers/users.go
    • Line 13: warning: exported type UserHandler should have comment or be unexported (golint)
    • Line 17: warning: exported function NewUserHandler should have comment or be unexported (golint)
    • tonic/internal/api/errors/generic-error.go
    • Line 5: warning: exported type GenericErr should have comment or be unexported (golint)
    • Line 9: warning: exported function NewGenericError should have comment or be unexported (golint)
    • Line 22: warning: exported method GenericErr.Is should have comment or be unexported (golint)
    • Line 27: warning: exported method GenericErr.External should have comment or be unexported (golint)
    • tonic/internal/api/errors/validation.go
    • Line 11: warning: error var InvalidErr should have name of the form ErrFoo (golint)
    • Line 11: warning: exported var InvalidErr should have comment or be unexported (golint)
    • Line 13: warning: exported type ValidationErr should have comment or be unexported (golint)
    • Line 18: warning: exported function NewValidationError should have comment or be unexported (golint)
    • Line 44: warning: exported method ValidationErr.Is should have comment or be unexported (golint)
    • Line 49: warning: exported method ValidationErr.External should have comment or be unexported (golint)
    • tonic/internal/models/options.go
    • Line 15: warning: exported type LogOptions should have comment or be unexported (golint)
    • Line 21: warning: exported type AuthOptions should have comment or be unexported (golint)
    • Line 28: warning: exported type PermissionsOptions should have comment or be unexported (golint)
    • Line 33: warning: exported type JWTOptions should have comment or be unexported (golint)
    • Line 41: warning: exported type OIDCOptions should have comment or be unexported (golint)
    • Line 48: warning: exported type CookieOptions should have comment or be unexported (golint)
    • Line 56: warning: exported type BackendOptions should have comment or be unexported (golint)
    • tonic/internal/api/response.go
    • Line 11: warning: exported type ResponseModel should have comment or be unexported (golint)
    • Line 17: warning: exported function SmartResponse should have comment or be unexported (golint)
    • Line 43: warning: exported function NoContentResponse should have comment or be unexported (golint)
    • Line 47: warning: exported function SuccessResponse should have comment or be unexported (golint)
    • Line 51: warning: exported function UnauthorisedResponse should have comment or be unexported (golint)
    • Line 60: warning: exported function ForbiddenResponse should have comment or be unexported (golint)
    • Line 69: warning: exported function NotFoundResponse should have comment or be unexported (golint)
    • Line 78: warning: exported function ValidationErrorResponse should have comment or be unexported (golint)
    • Line 87: warning: exported function ErrorResponse should have comment or be unexported (golint)
    • tonic/pkg/handlers/permissions.go
    • Line 11: warning: exported type PermissionsHandler should have comment or be unexported (golint)
    • Line 15: warning: exported function NewPermissionsHandler should have comment or be unexported (golint)
    • Line 19: warning: exported method PermissionsHandler.ListPermissions should have comment or be unexported (golint)
    • tonic/internal/services/permissions.go
    • Line 10: warning: exported type PermissionsService should have comment or be unexported (golint)
    • Line 16: warning: comment on exported function NewPermissionsService should be of the form "NewPermissionsService ..." (golint)
    • Line 33: warning: exported method PermissionsService.ListPermissions should have comment or be unexported (golint)
    • Line 41: warning: exported method PermissionsService.DefaultPermissions should have comment or be unexported (golint)
    • Line 49: warning: exported function ValidatePermissions should have comment or be unexported (golint)
    • tonic/pkg/handlers/auth.go
    • Line 24: warning: exported type AuthHandler should have comment or be unexported (golint)
    • Line 30: warning: exported function NewAuthHandler should have comment or be unexported (golint)
    • Line 34: warning: exported method AuthHandler.Login should have comment or be unexported (golint)
    • Line 50: warning: exported method AuthHandler.Callback should have comment or be unexported (golint)
    • Line 87: warning: exported method AuthHandler.Logout should have comment or be unexported (golint)
    • Line 102: warning: exported method AuthHandler.Token should have comment or be unexported (golint)
    • tonic/internal/backends/memory.go
    • Line 8: warning: exported type Memory should have comment or be unexported (golint)
    • Line 16: warning: exported function NewMemoryBackend should have comment or be unexported (golint)
    • Line 20: warning: exported method Memory.CreateUser should have comment or be unexported (golint)
    • Line 33: warning: exported method Memory.UpdateUser should have comment or be unexported (golint)
    • Line 44: warning: exported method Memory.GetUser should have comment or be unexported (golint)
    • Line 54: warning: exported method Memory.ListUsers should have comment or be unexported (golint)
    • Line 58: warning: exported method Memory.Ping should have comment or be unexported (golint)
    • tonic/internal/api/errors/unauthorised.go
    • Line 3: warning: exported type UnauthorisedErr should have comment or be unexported (golint)
    • Line 6: warning: exported function NewUnauthorisedError should have comment or be unexported (golint)
    • Line 14: warning: exported method UnauthorisedErr.Is should have comment or be unexported (golint)
    • Line 19: warning: exported method UnauthorisedErr.External should have comment or be unexported (golint)
    • tonic/internal/helpers/crypto.go
    • Line 11: warning: exported function GenerateRsaKeyPair should have comment or be unexported (golint)
    • Line 16: warning: exported function ExportPrivateKey should have comment or be unexported (golint)
    • Line 22: warning: exported function ExportPublicKey should have comment or be unexported (golint)
    • Line 30: warning: exported function ParsePrivateKey should have comment or be unexported (golint)
    • Line 39: warning: exported function ParsePublicKey should have comment or be unexported (golint)
    • tonic/internal/helpers/strings.go
    • Line 5: warning: exported function IsEmptyOrWhitespace should have comment or be unexported (golint)
    • Line 10: warning: exported function IsNilEmptyOrWhitespace should have comment or be unexported (golint)
    • tonic/main.go
    • Line 123: warning: comment on exported type ForbiddenErr should be of the form "ForbiddenErr ..." (with optional leading article) (golint)
    • Line 125: warning: exported type NotFoundErr should have comment or be unexported (golint)
    • Line 126: warning: exported type UnauthorisedErr should have comment or be unexported (golint)
    • Line 127: warning: exported type ValidationErr should have comment or be unexported (golint)
    • Line 128: warning: exported type GenericErr should have comment or be unexported (golint)
    • Line 155: warning: comment on exported type Options should be of the form "Options ..." (with optional leading article) (golint)
    • Line 157: warning: exported type LogOptions should have comment or be unexported (golint)
    • Line 158: warning: exported type AuthOptions should have comment or be unexported (golint)
    • Line 159: warning: exported type PermissionsOptions should have comment or be unexported (golint)
    • Line 160: warning: exported type JWTOptions should have comment or be unexported (golint)
    • Line 161: warning: exported type OIDCOptions should have comment or be unexported (golint)
    • Line 162: warning: exported type CookieOptions should have comment or be unexported (golint)
    • Line 163: warning: exported type BackendOptions should have comment or be unexported (golint)
    • Line 189: warning: comment on exported function HasAll should be of the form "HasAll ..." (golint)
    • Line 196: warning: exported type ResponseModel should have comment or be unexported (golint)
    • tonic/internal/backends/mongo.go
    • Line 15: warning: exported type Mongo should have comment or be unexported (golint)
    • Line 21: warning: exported function NewMongoBackend should have comment or be unexported (golint)
    • Line 41: warning: exported method Mongo.CreateUser should have comment or be unexported (golint)
    • Line 50: warning: exported method Mongo.UpdateUser should have comment or be unexported (golint)
    • Line 64: warning: exported method Mongo.GetUser should have comment or be unexported (golint)
    • Line 78: warning: exported method Mongo.ListUsers should have comment or be unexported (golint)
    • Line 95: warning: exported method Mongo.Ping should have comment or be unexported (golint)
    • tonic/internal/api/errors/forbidden.go
    • Line 3: warning: exported type ForbiddenErr should have comment or be unexported (golint)
    • Line 7: warning: exported function NewForbiddenError should have comment or be unexported (golint)
    • Line 15: warning: exported method ForbiddenErr.Is should have comment or be unexported (golint)
    • Line 20: warning: exported method ForbiddenErr.External should have comment or be unexported (golint)
    • tonic/internal/services/users.go
    • Line 12: warning: exported type UserService should have comment or be unexported (golint)
    • Line 32: warning: comment on exported method UserService.UpdateUser should be of the form "UpdateUser ..." (golint)
    • tonic/pkg/handlers/probes.go
    • Line 12: warning: exported type ProbeHandler should have comment or be unexported (golint)
    • Line 16: warning: exported function NewProbeHandler should have comment or be unexported (golint)
    • Line 20: warning: exported method ProbeHandler.Health should have comment or be unexported (golint)
    • Line 31: warning: exported method ProbeHandler.Liveliness should have comment or be unexported (golint)
    • Line 42: warning: exported method ProbeHandler.Readiness should have comment or be unexported (golint)
    • tonic/pkg/models/users.go
    • Line 3: warning: exported type User should have comment or be unexported (golint)
    • Line 9: warning: exported type StandardClaims should have comment or be unexported (golint)
    • tonic/internal/api/errors/not-found.go
    • Line 9: warning: exported type NotFoundErr should have comment or be unexported (golint)
    • Line 13: warning: exported function NewNotFoundError should have comment or be unexported (golint)
    • Line 25: warning: exported method NotFoundErr.Is should have comment or be unexported (golint)
    • Line 30: warning: exported method NotFoundErr.External 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!