Showing 8 of 99 total issues
Function TestUser
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestUser(t *testing.T) {
ts := httptest.NewServer(r)
defer ts.Close()
Function Create
has 6 return statements (exceeds 4 allowed). Open
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()
Function RecoveryByToken
has 6 return statements (exceeds 4 allowed). Open
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()
Function VerifyCaptcha
has 6 return statements (exceeds 4 allowed). Open
Open
func VerifyCaptcha(captchaResponse []byte) error {
var captcha Captcha
err := json.Unmarshal(captchaResponse, &captcha)
if err != nil {
return err
Function Recovery
has 5 return statements (exceeds 4 allowed). Open
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()
Function Update
has 5 return statements (exceeds 4 allowed). Open
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()
Function Login
has 5 return statements (exceeds 4 allowed). Open
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()
Function googleCallback
has 5 return statements (exceeds 4 allowed). Open
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()