RuboCop: Lint/DuplicateMethods
all manual Change-Id: Ib24846f21531d23d4908f40c037ad073613516fc Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277545 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Jacob Burroughs <jburroughs@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
40abc7176b
commit
9652bee370
|
@ -49,6 +49,8 @@ Lint/DeprecatedOpenSSLConstant:
|
|||
Severity: error
|
||||
Lint/DuplicateBranch:
|
||||
Severity: error
|
||||
Lint/DuplicateMethods:
|
||||
Severity: error
|
||||
Lint/EmptyBlock:
|
||||
Severity: error
|
||||
Lint/NonDeterministicRequireOrder:
|
||||
|
|
|
@ -1038,7 +1038,6 @@ class Assignment < ActiveRecord::Base
|
|||
self.wiki_page = page
|
||||
end
|
||||
end
|
||||
attr_writer :saved_by
|
||||
|
||||
def save_submittable(submittable)
|
||||
submittable.assignment_id = self.id
|
||||
|
|
|
@ -41,7 +41,8 @@ class ContentMigration < ActiveRecord::Base
|
|||
|
||||
DATE_FORMAT = "%m/%d/%Y"
|
||||
|
||||
attr_accessor :imported_migration_items, :outcome_to_id_map, :attachment_path_id_lookup, :attachment_path_id_lookup_lower, :last_module_position, :skipped_master_course_items
|
||||
attr_accessor :outcome_to_id_map, :attachment_path_id_lookup, :attachment_path_id_lookup_lower, :last_module_position, :skipped_master_course_items
|
||||
attr_writer :imported_migration_items
|
||||
|
||||
has_a_broadcast_policy
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class ContextExternalTool < ActiveRecord::Base
|
|||
validate :url_or_domain_is_set
|
||||
validate :validate_urls
|
||||
serialize :settings
|
||||
attr_accessor :config_type, :config_url, :config_xml
|
||||
attr_reader :config_type, :config_url, :config_xml
|
||||
|
||||
before_save :infer_defaults, :validate_vendor_help_link
|
||||
after_save :touch_context, :check_global_navigation_cache, :clear_tool_domain_cache
|
||||
|
|
|
@ -320,8 +320,6 @@ class DiscussionTopic < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
attr_accessor :saved_by
|
||||
|
||||
def update_assignment
|
||||
return if self.deleted?
|
||||
|
||||
|
|
|
@ -455,10 +455,6 @@ class Group < ActiveRecord::Base
|
|||
self.group_category.groups.where("id<>?", self).to_a
|
||||
end
|
||||
|
||||
def student_organized?
|
||||
self.group_category && self.group_category.student_organized?
|
||||
end
|
||||
|
||||
def ensure_defaults
|
||||
self.name ||= CanvasSlug.generate_securish_uuid
|
||||
self.uuid ||= CanvasSlug.generate_securish_uuid
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
class GroupCategory < ActiveRecord::Base
|
||||
attr_reader :create_group_count
|
||||
attr_reader :create_group_member_count
|
||||
attr_accessor :assign_unassigned_members, :group_by_section
|
||||
attr_accessor :group_by_section
|
||||
attr_writer :assign_unassigned_members
|
||||
|
||||
belongs_to :context, polymorphic: [:course, :account]
|
||||
belongs_to :sis_batch
|
||||
|
|
|
@ -23,8 +23,8 @@ module Lti
|
|||
class Launch
|
||||
FRAME_ALLOWANCES = ['geolocation', 'microphone', 'camera', 'midi', 'encrypted-media', 'autoplay'].freeze
|
||||
|
||||
attr_writer :analytics_id, :analytics_message_type
|
||||
attr_accessor :link_text, :resource_url, :params, :launch_type, :tool_dimensions, :base_string
|
||||
attr_writer :analytics_id, :analytics_message_type, :resource_url
|
||||
attr_accessor :link_text, :params, :launch_type, :tool_dimensions, :base_string
|
||||
|
||||
def self.iframe_allowances(user_agent = nil)
|
||||
browser = Browser.new(user_agent)
|
||||
|
|
|
@ -22,7 +22,7 @@ class UserService < ActiveRecord::Base
|
|||
include Workflow
|
||||
|
||||
belongs_to :user
|
||||
attr_accessor :password
|
||||
attr_reader :password
|
||||
|
||||
validates_presence_of :user_id, :service, :service_user_id, :workflow_state
|
||||
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
|
||||
module IncomingMailProcessor
|
||||
class MailboxAccount
|
||||
attr_accessor :protocol, :config, :address, :error_folder
|
||||
attr_writer :address
|
||||
attr_accessor :protocol, :config, :error_folder
|
||||
|
||||
class << self
|
||||
attr_accessor :default_outgoing_email, :reply_to_enabled
|
||||
|
|
|
@ -47,12 +47,9 @@ module LtiAdvantage::Messages
|
|||
:custom,
|
||||
:email,
|
||||
:email_verified,
|
||||
:extensions,
|
||||
:family_name,
|
||||
:gender,
|
||||
:given_name,
|
||||
:launch_presentation,
|
||||
:lis,
|
||||
:locale,
|
||||
:middle_name,
|
||||
:name,
|
||||
|
@ -60,15 +57,18 @@ module LtiAdvantage::Messages
|
|||
:phone_number,
|
||||
:phone_number_verified,
|
||||
:picture,
|
||||
:tool_platform,
|
||||
:preferred_username,
|
||||
:profile,
|
||||
:roles,
|
||||
:role_scope_mentor,
|
||||
:updated_at,
|
||||
:website,
|
||||
:zoneinfo,
|
||||
:id
|
||||
attr_writer :extensions,
|
||||
:launch_presentation,
|
||||
:list,
|
||||
:roles,
|
||||
:role_scope_mentor,
|
||||
:tool_platform
|
||||
|
||||
def self.create_jws(body, private_key, alg = :RS256)
|
||||
JSON::JWT.new(body).sign(private_key, alg).to_s
|
||||
|
|
|
@ -138,7 +138,7 @@ module Canvas::ICU
|
|||
# in test, this will reveal system configuration problems
|
||||
throw if Rails.env.test?
|
||||
|
||||
def self.collator
|
||||
def self.collator # rubocop:disable Lint/DuplicateMethods
|
||||
NaiveCollator
|
||||
end
|
||||
end
|
||||
|
|
|
@ -32,8 +32,6 @@ module Canvas::Migration
|
|||
|
||||
QUIZ_FILE_DIRECTORY = "Quiz Files"
|
||||
|
||||
attr_reader :overview
|
||||
|
||||
def self.get_utc_time_from_timestamp(timestamp)
|
||||
return nil if timestamp.nil?
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ module Canvas::OAuth
|
|||
class Provider
|
||||
OAUTH2_OOB_URI = 'urn:ietf:wg:oauth:2.0:oob'
|
||||
|
||||
attr_reader :client_id, :redirect_uri, :scopes, :purpose
|
||||
attr_reader :client_id, :scopes, :purpose
|
||||
|
||||
def initialize(client_id, redirect_uri = "", scopes = [], purpose = nil)
|
||||
@client_id = client_id
|
||||
|
|
|
@ -26,7 +26,7 @@ module Canvas
|
|||
class Plugin
|
||||
@registered_plugins = {}
|
||||
|
||||
attr_accessor :meta, :settings
|
||||
attr_accessor :meta
|
||||
attr_reader :id, :tag
|
||||
|
||||
def initialize(id, tag = nil)
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
|
||||
class HostUrl
|
||||
class << self
|
||||
attr_accessor :outgoing_email_address, :outgoing_email_domain, :outgoing_email_default_name
|
||||
attr_accessor :outgoing_email_domain
|
||||
attr_writer :outgoing_email_address, :outgoing_email_default_name
|
||||
|
||||
# See ActionDispatch::HostAuthorization; HostUrl is added as an object to config.hosts
|
||||
def ===(host)
|
||||
|
|
|
@ -60,8 +60,6 @@ module Stats
|
|||
alias_method :count, :size
|
||||
def empty?; @items.size == 0; end
|
||||
|
||||
def sum_of_squares; @sum_of_squares; end
|
||||
|
||||
def mean; @items.empty? ? nil : (sum.to_f / @items.size); end
|
||||
alias_method :avg, :mean
|
||||
|
||||
|
|
|
@ -234,24 +234,6 @@ module CustomWaitMethods
|
|||
tiny_frame
|
||||
end
|
||||
|
||||
# a slightly modified version of wait_for_tiny
|
||||
# that's simpler for the normal case where
|
||||
# the RCE is created via serviceRCELoader, which
|
||||
# adds the 'ic-RichContentEditor' class name
|
||||
def wait_for_rce(element = nil)
|
||||
element ||= f('.ic-RichContentEditor')
|
||||
tiny_frame = nil
|
||||
keep_trying_until do
|
||||
begin
|
||||
tiny_frame = disable_implicit_wait { element.find_element(:css, 'iframe') }
|
||||
rescue => e
|
||||
puts "#{e.inspect}"
|
||||
false
|
||||
end
|
||||
end
|
||||
tiny_frame
|
||||
end
|
||||
|
||||
# a slightly modified version of wait_for_tiny
|
||||
# that's simpler for the normal case where
|
||||
# there's only 1 RCE on the pge
|
||||
|
|
|
@ -90,8 +90,6 @@ module SeleniumDriverSetup
|
|||
:server_ip,
|
||||
:server_port
|
||||
|
||||
attr_reader :driver
|
||||
|
||||
def reset!
|
||||
dump_browser_log if browser_log
|
||||
@driver = nil
|
||||
|
|
Loading…
Reference in New Issue