Skip to content

Commit

Permalink
Remove unnecessary rubocop:disables
Browse files Browse the repository at this point in the history
  • Loading branch information
kxmbrian committed Apr 3, 2018
1 parent 2a5c9a1 commit f7e9458
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def show
end
end

def create # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
def create # rubocop:disable Metrics/MethodLength
if file_is_pdf?
respond_to do |format|
if pdf_import_service.save
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def log_service

# Check for zombie jobs, create new grading jobs if there's any zombie jobs.
# TODO: Remove this method after found the cause of the dead jobs.
def check_zombie_jobs # rubocop:disable MethodLength, Metrics/AbcSize
def check_zombie_jobs # rubocop:disable Metrics/AbcSize
return unless @submission.attempting?

submitted_answers = @submission.answers.latest_answers.select(&:submitted?)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/course/enrol_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def destroy
end

# Approve the given role request and creates the course user.
def approve # rubocop:disable Metrics/AbcSize
def approve
course_user = create_course_user
if course_user.persisted?
flash.now[:success] = t('.success', name: course_user.name, role: course_user.role)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/course/forum/forums_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def search
@search = Course::Forum::Search.new(search_params)
end

def next_unread # rubocop:disable Metrics/AbcSize
def next_unread
topic = Course::Forum::Topic.from_course(current_course).
accessible_by(current_ability).unread_by(current_user).first

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def errored_import_alert(json: false)
#
# @param [Hash] error The error object in the +TrackableJobs+ table.
# @return [String]
def import_error_message(error) # rubocop:disable Metrics/MethodLength
def import_error_message(error)
case error['class']
when InvalidDataError.name
t('course.assessment.question.programming.form.import_result.errors.invalid_package')
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/course/search_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module ClassMethods
# @param [String] keyword The keywords for filtering courses.
# @return [Array<Course>] The courses which match the keyword. All courses will be returned if
# keyword is blank.
def search(keyword) # rubocop:disable Metrics/AbcSize
def search(keyword)
return all if keyword.blank?

condition = "%#{keyword}%"
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/course_user/staff_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def self.order_by_average_marking_time(staff)
# Returns the published submissions for the purpose of calculating marking statistics.
#
# This inlcudes only submissions from non-phantom, student course_users.
def published_submissions # rubocop:disable Metrics/AbcSize
def published_submissions
@published_submissions ||=
Course::Assessment::Submission.
joins(experience_points_record: :course_user).
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/instance_user_search_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module ClassMethods
# @param [String] keyword The keywords for filtering users.
# @return [Array<User>] The users which match the keyword. All users will be returned if
# keyword is blank.
def search(keyword) # rubocop:disable Metrics/AbcSize
def search(keyword)
return all if keyword.blank?

condition = "%#{keyword}%"
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/user_search_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module ClassMethods
# @param [String] keyword The keywords for filtering users.
# @return [Array<User>] The users which match the keyword. All users will be returned if
# keyword is blank.
def search(keyword) # rubocop:disable Metrics/AbcSize
def search(keyword)
return all if keyword.blank?

condition = "%#{keyword}%"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ def execute(language, memory_limit, time_limit, package, timeout = nil)

private

def initialize(language, memory_limit, # rubocop:disable Metrics/ParameterLists
time_limit, package, timeout)
def initialize(language, memory_limit, time_limit, package, timeout)
@language = language
@memory_limit = memory_limit || MEMORY_LIMIT
@time_limit = time_limit || CPU_TIMEOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def get_file_path(filename)
File.join(File.expand_path(File.dirname(__FILE__)), filename).freeze
end

def zip_test_files(test_type, zip) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
def zip_test_files(test_type, zip) # rubocop:disable Metrics/AbcSize
tests = @test_params[:test_cases]
tests[test_type]&.each&.with_index(1) do |test, index|
# String types should be displayed with quotes, other types will be converted to string
Expand Down

0 comments on commit f7e9458

Please sign in to comment.