discourse/discourse

View on GitHub

Showing 2 of 1,608 total issues

Consider simplifying this complex logical expression.
Open

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

      # Silenced users can't flag
      return false if is_flag && @user.silenced?

Severity: Critical
Found in lib/guardian/post_guardian.rb - About 2 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
      Language