bnkamalesh/verifier

View on GitHub

Showing 6 of 8 total issues

Method Postgres.ReadLastPending has 70 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (pgs *Postgres) ReadLastPending(ctype verifier.CommType, recipient string) (*verifier.Request, error) {
    query, args, err := pgs.qbuilder.Select(
        "id",
        "type",
        "sender",
Severity: Minor
Found in stores/postgres.go - About 1 hr to fix

    Function notifyWithCustomRequest has 51 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func notifyWithCustomRequest(vsvc *verifier.Verifier) {
        req, err := vsvc.NewRequest(
            verifier.CommTypeMobile,
            "+919876543210",
        )
    Severity: Minor
    Found in cmd/main.go - About 1 hr to fix

      Function notifyWithCustomRequest has 6 return statements (exceeds 4 allowed).
      Open

      func notifyWithCustomRequest(vsvc *verifier.Verifier) {
          req, err := vsvc.NewRequest(
              verifier.CommTypeMobile,
              "+919876543210",
          )
      Severity: Major
      Found in cmd/main.go - About 40 mins to fix

        Method Verifier.verifyAndUpdate has 6 return statements (exceeds 4 allowed).
        Open

        func (ver *Verifier) verifyAndUpdate(secret string, verreq *Request) error {
            var err error
            now := time.Now()
            verreq.UpdatedAt = &now
            verreq.Attempts++
        Severity: Major
        Found in verifier.go - About 40 mins to fix

          Method Verifier.NewMobileWithReq has 5 return statements (exceeds 4 allowed).
          Open

          func (ver *Verifier) NewMobileWithReq(verreq *Request, body string) error {
              err := validateMobile(verreq.Recipient)
              if err != nil {
                  return err
              }
          Severity: Major
          Found in verifier.go - About 35 mins to fix

            Method Verifier.NewEmailWithReq has 5 return statements (exceeds 4 allowed).
            Open

            func (ver *Verifier) NewEmailWithReq(verreq *Request, subject, body string) error {
                err := validateEmailAddress(verreq.Recipient)
                if err != nil {
                    return err
                }
            Severity: Major
            Found in verifier.go - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language