discourse/discourse

View on GitHub

Showing 2 of 1,401 total issues

Consider simplifying this complex logical expression.
Open

    result = if authenticated? && post && !@user.anonymous?

      return false if [:notify_user, :notify_moderators].include?(action_key) &&
        !SiteSetting.enable_private_messages?

Severity: Critical
Found in lib/guardian/post_guardian.rb - About 4 hrs to fix

    Consider simplifying this complex logical expression.
    Open

          if (saved = (!save_options || user.user_option.save) && user_profile.save && user.save) &&
             (attributes[:name].present? && old_user_name.casecmp(attributes.fetch(:name)) != 0) ||
             (attributes[:name].blank? && old_user_name.present?)
    
            StaffActionLogger.new(@actor).log_name_change(
    Severity: Critical
    Found in app/services/user_updater.rb - About 1 hr to fix
      Severity
      Category
      Status
      Source