batazor/go-auth

View on GitHub

Showing 8 of 99 total issues

Function TestUser has 63 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func TestUser(t *testing.T) {

    ts := httptest.NewServer(r)
    defer ts.Close()

Severity: Minor
Found in handlers/user/user_test.go - About 1 hr to fix

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

    func Create(w http.ResponseWriter, r *http.Request) {
        w.Header().Set("Content-Type", "application/json")
    
        parent := opentracing.GlobalTracer().StartSpan("POST /users")
        defer parent.Finish()
    Severity: Major
    Found in handlers/user/user.go - About 40 mins to fix

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

      func RecoveryByToken(w http.ResponseWriter, r *http.Request) {
          w.Header().Set("Content-Type", "application/json")
      
          b, err := ioutil.ReadAll(r.Body)
          defer r.Body.Close()
      Severity: Major
      Found in handlers/session/session.go - About 40 mins to fix

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

        func VerifyCaptcha(captchaResponse []byte) error {
            var captcha Captcha
            err := json.Unmarshal(captchaResponse, &captcha)
            if err != nil {
                return err
        Severity: Major
        Found in utils/recaptcha/recaptcha.go - About 40 mins to fix

          Function Recovery has 5 return statements (exceeds 4 allowed).
          Open

          func Recovery(w http.ResponseWriter, r *http.Request) {
              w.Header().Set("Content-Type", "application/json")
          
              b, err := ioutil.ReadAll(r.Body)
              defer r.Body.Close()
          Severity: Major
          Found in handlers/session/session.go - About 35 mins to fix

            Function Update has 5 return statements (exceeds 4 allowed).
            Open

            func Update(w http.ResponseWriter, r *http.Request) {
                w.Header().Set("Content-Type", "application/json")
            
                parent := opentracing.GlobalTracer().StartSpan("PUT /users")
                defer parent.Finish()
            Severity: Major
            Found in handlers/user/user.go - About 35 mins to fix

              Function Login has 5 return statements (exceeds 4 allowed).
              Open

              func Login(w http.ResponseWriter, r *http.Request) {
                  w.Header().Set("Content-Type", "application/json")
              
                  b, err := ioutil.ReadAll(r.Body)
                  defer r.Body.Close()
              Severity: Major
              Found in handlers/session/session.go - About 35 mins to fix

                Function googleCallback has 5 return statements (exceeds 4 allowed).
                Open

                func googleCallback(w http.ResponseWriter, r *http.Request) {
                    w.Header().Set("Content-Type", "application/json")
                
                    b, err := ioutil.ReadAll(r.Body)
                    defer r.Body.Close()
                Severity: Major
                Found in handlers/oauth/google.go - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language