gogjango/gjango

View on GitHub
repository/auth/auth.go

Summary

Maintainability
A
1 hr
Test Coverage

Method Service.MobileVerify has 6 return statements (exceeds 4 allowed).
Open

func (s *Service) MobileVerify(c context.Context, countryCode, mobile, code string, signup bool) (*model.AuthToken, error) {
    // send code to twilio
    err := s.mob.CheckCode(countryCode, mobile, code)
    if err != nil {
        return nil, err
Severity: Major
Found in repository/auth/auth.go - About 40 mins to fix

    Method Service.Authenticate has 6 return statements (exceeds 4 allowed).
    Open

    func (s *Service) Authenticate(c context.Context, email, password string) (*model.AuthToken, error) {
        u, err := s.userRepo.FindByEmail(email)
        if err != nil {
            return nil, apperr.Unauthorized
        }
    Severity: Major
    Found in repository/auth/auth.go - About 40 mins to fix

      Function NewAuthService has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func NewAuthService(userRepo model.UserRepo, accountRepo model.AccountRepo, jwt JWT, m mail.Service, mob mobile.Service) *Service {
      Severity: Minor
      Found in repository/auth/auth.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status