publiclab/plots2

View on GitHub

Showing 71 of 688 total issues

Avoid deeply nested control flow statements.
Open

              unless tag.subscriptions.empty? || isStatusValid || !isMonthOld
                SubscriptionMailer.notify_tag_added(self, tag, user).deliver_later
              end
Severity: Major
Found in app/models/node.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              if oidreq.immediate
                oidresp = oidreq.answer(false)
              elsif session[:username]
                # The user hasn't logged in.
                # show_decision_page(oidreq) # this doesnt make sense... it was in the example though
Severity: Major
Found in app/controllers/openid_controller.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                tagnames = params[:tagnames].class == Array ? params[:tagnames].join(', ') : params[:tagnames]
Severity: Major
Found in app/controllers/subscription_controller.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              unless params[:hash_params].to_s.empty?
                hash_params = URI.parse("#" + params[:hash_params]).to_s
              end
Severity: Major
Found in app/controllers/user_sessions_controller.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            render json: { status: status, message: message, id: tag.tid, tagname: params[:name], url: "/tags" + "?_=" + Time.now.to_i.to_s } if current_user
Severity: Major
Found in app/controllers/subscription_controller.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            params[:user_session][:openid_identifier] = 'https://old.publiclab.org/people/' + username + '/identity' if username
Severity: Major
Found in app/controllers/user_sessions_controller.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              if current_user.crypted_password.nil? # the user has not created a pwd in the new site
                flash[:warning] = I18n.t('user_sessions_controller.create_password_for_new_site')
                redirect_to '/profile/edit'
              else
                flash[:notice] = I18n.t('user_sessions_controller.logged_in')
Severity: Major
Found in app/controllers/user_sessions_controller.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if session[:openid_return_to] # for openid login, redirects back to openid auth process
              return_to = session[:openid_return_to]
              session[:openid_return_to] = nil
              redirect_to return_to + hash_params
            elsif params[:return_to] && params[:return_to].split('/')[0..3] == ["", "subscribe", "multiple", "tag"]
Severity: Major
Found in app/controllers/user_sessions_controller.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if session[:openid_return_to] # for openid login, redirects back to openid auth process
              return_to = session[:openid_return_to]
              session[:openid_return_to] = nil
              redirect_to return_to + hash_params
            else
Severity: Major
Found in app/controllers/user_sessions_controller.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            PasswordResetMailer.reset_notify(user, key).deliver_later unless user.nil? # respond the same to both successes and failures; security
Severity: Major
Found in app/controllers/user_sessions_controller.rb - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              rescue ActiveRecord::RecordInvalid
                flash[:error] = tag.errors.full_messages
                redirect_to return_to
                return false
Severity: Major
Found in app/controllers/subscription_controller.rb - About 45 mins to fix
Severity
Category
Status
Source
Language