Preparing report...

Report for github.com/rij12/Authentication-Microservice

C    Needs some work    Found 10 issues across 10 files

Tweet

gofmt50%

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!


golint10%

Golint is a linter for Go source code.

    • Authentication-Microservice/models/model.go
    • Line 5: warning: exported type User should have comment or be unexported (golint)
    • Line 11: warning: exported type UserResult should have comment or be unexported (golint)
    • Line 16: warning: exported type JWT should have comment or be unexported (golint)
    • Line 20: warning: exported type Error should have comment or be unexported (golint)
    • Line 25: warning: exported type Config should have comment or be unexported (golint)
    • Authentication-Microservice/repository/UserRepositoryImpl.go
    • Line 13: warning: exported type UserRepositoryImpl should have comment or be unexported (golint)
    • Line 17: warning: exported method UserRepositoryImpl.SaveUser should have comment or be unexported (golint)
    • Line 39: warning: exported method UserRepositoryImpl.GetUserByEmail should have comment or be unexported (golint)
    • Line 58: warning: exported method UserRepositoryImpl.GetUser should have comment or be unexported (golint)
    • Authentication-Microservice/repository/dbRepo.go
    • Line 18: warning: exported type MongoRepository should have comment or be unexported (golint)
    • Line 22: warning: exported method MongoRepository.Init should have comment or be unexported (golint)
    • Line 27: warning: exported method MongoRepository.ConnectDB should have comment or be unexported (golint)
    • Line 52: warning: exported method MongoRepository.PingDb should have comment or be unexported (golint)
    • Line 70: warning: exported method MongoRepository.ListDatabases should have comment or be unexported (golint)
    • Line 86: warning: exported method MongoRepository.GetDb should have comment or be unexported (golint)
    • Line 93: warning: exported method MongoRepository.CloseConnection should have comment or be unexported (golint)
    • Authentication-Microservice/utils/utils.go
    • Line 13: warning: exported function RespondWithErrorWithMessage should have comment or be unexported (golint)
    • Line 19: warning: exported function RespondWithError should have comment or be unexported (golint)
    • Line 23: warning: exported function ResponseJSON should have comment or be unexported (golint)
    • Line 28: warning: exported function Response should have comment or be unexported (golint)
    • Line 32: warning: comment on exported function ValidateUser should be of the form "ValidateUser ..." (golint)
    • Authentication-Microservice/controllers/UserController.go
    • Line 18: warning: exported type UserController should have comment or be unexported (golint)
    • Line 23: warning: exported method UserController.LoginController should have comment or be unexported (golint)
    • Line 48: warning: exported method UserController.RegisterController should have comment or be unexported (golint)
    • Line 89: warning: exported method UserController.ProtectedEndpointTest should have comment or be unexported (golint)
    • Line 97: warning: exported method UserController.GetUserByEmailController should have comment or be unexported (golint)
    • Authentication-Microservice/service/cryptoService.go
    • Line 14: warning: exported type CryptoService should have comment or be unexported (golint)
    • Line 18: warning: exported method CryptoService.Init should have comment or be unexported (golint)
    • Line 22: warning: comment on exported method CryptoService.GenerateToken should be of the form "GenerateToken ..." (golint)
    • Line 48: warning: exported method CryptoService.TokenVerifyMiddleWare should have comment or be unexported (golint)
    • Authentication-Microservice/service/userService.go
    • Line 15: warning: exported type UserService should have comment or be unexported (golint)
    • Line 21: warning: exported method UserService.RegisterUser should have comment or be unexported (golint)
    • Line 35: warning: exported method UserService.GetUserByEmail should have comment or be unexported (golint)
    • Line 43: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 49: warning: exported method UserService.Login should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign20%

IneffAssign detects ineffectual assignments in Go code.

    • Authentication-Microservice/main.go
    • Line 5: warning: cannot find package "." in: (ineffassign)
    • Line 6: warning: cannot find package "." in: (ineffassign)
    • Line 7: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 5: warning: could not import github.com/alexcesaro/log/stdlog (invalid package name: "") (ineffassign)
    • Line 6: warning: could not import github.com/gorilla/mux (invalid package name: "") (ineffassign)
    • Line 7: warning: could not import github.com/rij12/Authentication-Microservice/controllers (invalid package name: "") (ineffassign)
    • Line 8: warning: could not import github.com/rij12/Authentication-Microservice/repository (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/rij12/Authentication-Microservice/service (invalid package name: "") (ineffassign)
    • Authentication-Microservice/utils/utils.go
    • Line 6: warning: cannot find package "." in: (ineffassign)
    • Line 7: warning: cannot find package "." in: (ineffassign)
    • Line 6: warning: could not import github.com/alexcesaro/log/stdlog (invalid package name: "") (ineffassign)
    • Line 7: warning: could not import github.com/rij12/Authentication-Microservice/models (invalid package name: "") (ineffassign)
    • Authentication-Microservice/service/userService.go
    • Line 6: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 6: warning: could not import github.com/alexcesaro/log/stdlog (invalid package name: "") (ineffassign)
    • Line 8: warning: could not import github.com/rij12/Authentication-Microservice/repository (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import golang.org/x/crypto/bcrypt (invalid package name: "") (ineffassign)
    • Authentication-Microservice/service/cryptoService.go
    • Line 5: warning: cannot find package "." in: (ineffassign)
    • Line 7: warning: cannot find package "." in: (ineffassign)
    • Line 5: warning: could not import github.com/dgrijalva/jwt-go (invalid package name: "") (ineffassign)
    • Line 7: warning: could not import github.com/rij12/Authentication-Microservice/utils (invalid package name: "") (ineffassign)
    • Line 29: warning: undeclared name: jwt (ineffassign)
    • Line 29: warning: undeclared name: jwt (ineffassign)
    • Line 29: warning: undeclared name: jwt (ineffassign)
    • Line 57: warning: undeclared name: jwt (ineffassign)
    • Line 57: warning: undeclared name: jwt (ineffassign)
    • Line 5: warning: "github.com/dgrijalva/jwt-go" imported but not used (ineffassign)
    • Authentication-Microservice/service/configService.go
    • Line 4: warning: cannot find package "." in: (ineffassign)
    • Line 5: warning: cannot find package "." in: (ineffassign)
    • Line 6: warning: cannot find package "." in: (ineffassign)
    • Line 4: warning: could not import github.com/kelseyhightower/envconfig (invalid package name: "") (ineffassign)
    • Line 5: warning: could not import github.com/rij12/Authentication-Microservice/models (invalid package name: "") (ineffassign)
    • Line 6: warning: could not import gopkg.in/yaml.v2 (invalid package name: "") (ineffassign)
    • Line 29: warning: undeclared name: yaml (ineffassign)
    • Line 6: warning: "gopkg.in/yaml.v2" imported but not used (ineffassign)
    • Authentication-Microservice/controllers/UserController.go
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 10: warning: cannot find package "." in: (ineffassign)
    • Line 11: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 6: warning: cannot find package "." in: (ineffassign)
    • Line 13: warning: cannot find package "." in: (ineffassign)
    • Line 6: warning: could not import github.com/rij12/Authentication-Microservice/utils (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/alexcesaro/log/stdlog (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/google/uuid (invalid package name: "") (ineffassign)
    • Line 11: warning: could not import github.com/rij12/Authentication-Microservice/models (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/rij12/Authentication-Microservice/service (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import golang.org/x/crypto/bcrypt (invalid package name: "") (ineffassign)
    • Authentication-Microservice/repository/UserRepositoryImpl.go
    • Line 6: warning: cannot find package "." in: (ineffassign)
    • Line 7: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 6: warning: could not import github.com/alexcesaro/log/stdlog (invalid package name: "") (ineffassign)
    • Line 7: warning: could not import github.com/rij12/Authentication-Microservice/models (invalid package name: "") (ineffassign)
    • Line 8: warning: could not import go.mongodb.org/mongo-driver/bson (invalid package name: "") (ineffassign)
    • Authentication-Microservice/repository/dbRepo.go
    • Line 11: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 13: warning: cannot find package "." in: (ineffassign)
    • Line 11: warning: could not import go.mongodb.org/mongo-driver/mongo (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import go.mongodb.org/mongo-driver/mongo/options (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import go.mongodb.org/mongo-driver/mongo/readpref (invalid package name: "") (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!