discourse/discourse

View on GitHub

Showing 2 of 1,545 total issues

Consider simplifying this complex logical expression.
Open

    result = if authenticated? && post && !@user.anonymous?
      # post made by staff, but we don't allow staff flags
      return false if is_flag &&
        (!SiteSetting.allow_flagging_staff?) &&
        post.user.staff?
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