DEV: Fix Lint/DuplicateMethods (#24746)

This commit is contained in:
Jarek Radosz 2023-12-06 13:18:34 +01:00 committed by GitHub
parent 4280c01153
commit 138bf486d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 5 additions and 64 deletions

View File

@ -18,8 +18,6 @@ class About
include ActiveModel::Serialization
include StatsCacheable
attr_accessor :moderators, :admins
def self.stats_cache_key
"about-stats"
end

View File

@ -3,8 +3,6 @@
class EmailStyle
include ActiveModel::Serialization
attr_accessor :html, :css, :default_html, :default_css
def id
"email-style"
end

View File

@ -76,8 +76,6 @@ class Report
:icon,
:modes,
:prev_data,
:prev_start_date,
:prev_end_date,
:dates_filtering,
:error,
:primary_color,

View File

@ -5,8 +5,6 @@ class SearchLog < ActiveRecord::Base
belongs_to :user
attr_reader :ctr
def ctr
return 0 if click_through == 0 || searches == 0

View File

@ -22,7 +22,7 @@ class TagGroup < ActiveRecord::Base
after_commit { DiscourseTagging.clear_cache! }
attr_accessor :permissions
attr_reader :permissions
def tag_names=(tag_names_arg)
DiscourseTagging.add_or_create_tags_by_name(self, tag_names_arg, unlimited: true)

View File

@ -40,7 +40,6 @@ class TopicList
:filter,
:for_period,
:per_page,
:top_tags,
:current_user,
:tags,
:shared_drafts,

View File

@ -26,33 +26,6 @@ class TrustLevel3Requirements
LOW_WATER_MARK = 0.9
FORGIVENESS_PERIOD = 6.months
attr_accessor :days_visited,
:min_days_visited,
:num_topics_replied_to,
:min_topics_replied_to,
:topics_viewed,
:min_topics_viewed,
:posts_read,
:min_posts_read,
:topics_viewed_all_time,
:min_topics_viewed_all_time,
:posts_read_all_time,
:min_posts_read_all_time,
:num_flagged_posts,
:max_flagged_posts,
:num_likes_given,
:min_likes_given,
:num_likes_received,
:min_likes_received,
:num_likes_received,
:min_likes_received,
:num_likes_received_days,
:min_likes_received_days,
:num_likes_received_users,
:min_likes_received_users,
:trust_level_locked,
:on_grace_period
def initialize(user)
@user = user
end

View File

@ -1,8 +1,6 @@
# frozen_string_literal: true
class UserPostBookmarkSerializer < UserPostTopicBookmarkBaseSerializer
attr_reader :post_id
def post_id
post.id
end

View File

@ -3,7 +3,6 @@
# Helper functions for dealing with errors and objects that have
# child objects with errors
module HasErrors
attr_reader :errors
attr_accessor :forbidden, :not_found, :conflict
def errors

View File

@ -2,7 +2,7 @@
module ImportExport
class BaseExporter
attr_reader :export_data, :categories
attr_reader :export_data
CATEGORY_ATTRS = %i[
id

View File

@ -2,8 +2,6 @@
module Chat
class UserMessageBookmarkSerializer < UserBookmarkBaseSerializer
attr_reader :chat_message
def title
fancy_title
end

View File

@ -16,10 +16,6 @@ module PageObjects
page.find(context)
end
def flag(message)
find(message).secondary_action("flag")
end
def copy_link(message)
find(message).secondary_action("copyLink")
end

View File

@ -43,10 +43,6 @@ module PageObjects
".chat-thread-list-item__last-reply-timestamp .relative-date[data-time='#{(last_reply.created_at.iso8601.to_time.to_f * 1000).to_i}']"
end
def has_no_unread_item?(id)
component.has_no_css?(item_by_id_selector(id) + ".-is-unread")
end
def has_unread_item?(id, count: nil)
if count.nil?
component.has_css?(item_by_id_selector(id) + ".-is-unread")

View File

@ -14,10 +14,6 @@ module PageObjects
find(PUBLIC_CHANNELS_SECTION_SELECTOR)
end
def channels_section
find(PUBLIC_CHANNELS_SECTION_SELECTOR)
end
def dms_section
find(DM_CHANNELS_SECTION_SELECTOR)
end

View File

@ -1,11 +1,11 @@
# frozen_string_literal: true
class FakeLogger
attr_reader :debug, :infos, :warnings, :errors, :fatals
attr_reader :debugs, :infos, :warnings, :errors, :fatals
attr_accessor :level
def initialize
@debug = []
@debugs = []
@infos = []
@warnings = []
@errors = []
@ -14,7 +14,7 @@ class FakeLogger
end
def debug(message)
@debug << message
@debugs << message
end
def debug?

View File

@ -39,12 +39,6 @@ module PageObjects
expect(categories.map(&:text)).to eq(category_names)
end
def has_checkbox?(category, disabled: false)
has_selector?(
".sidebar-categories-form .sidebar-categories-form__category-row[data-category-id='#{category.id}'] .sidebar-categories-form__input#{disabled ? "[disabled]" : ""}",
)
end
def toggle_category_checkbox(category)
find(
".sidebar-categories-form .sidebar-categories-form__category-row[data-category-id='#{category.id}'] .sidebar-categories-form__input",