Skip to content

Commit

Permalink
Correct Rubocop Style/RedundantReturn when returning without arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
saraycp committed Aug 24, 2020
1 parent 24743a7 commit ef25351
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/api/app/controllers/attribute_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ def validate_xml

render_error status: 400, errorcode: 'illegal_request',
message: "Illegal request: PUT/POST #{request.path}: path does not match content"
return
nil
end
end
4 changes: 2 additions & 2 deletions src/api/app/controllers/build/file_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def destroy
message: 'Delete operation of build results is not allowed'
end

return
nil
end

private
Expand Down Expand Up @@ -76,7 +76,7 @@ def check_user_has_permission

render_error status: 403, errorcode: 'download_binary_no_permission',
message: "No permission to download binaries from package #{params[:package]}, project #{params[:project]}"
return
nil
end

def path
Expand Down
8 changes: 4 additions & 4 deletions src/api/app/controllers/build_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def project_index

if request.get?
pass_to_backend
return
nil
elsif request.post?
# check if user has project modify rights
allowed = false
Expand Down Expand Up @@ -78,19 +78,19 @@ def project_index
end

pass_to_backend
return
nil
elsif request.put?
if User.admin_session?
pass_to_backend
else
render_error status: 403, errorcode: 'execute_cmd_no_permission',
message: "No permission to execute command on project #{params[:project]}"
end
return
nil
else
render_error status: 400, errorcode: 'illegal_request',
message: "Illegal request: #{request.method.to_s.upcase} #{request.path}"
return
nil
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/main_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def index

def notfound
render_error message: 'Page not found', status: 404, errorcode: 'not_found'
return
nil
end
end
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/apidocs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ def file
flash[:error] = "File not found: #{params[:filename]}"
redirect_back(fallback_location: { controller: 'apidocs', action: 'index' })
end
return
nil
end
end
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/package_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ def find_last_req
comment: last_req.comment
}
end
return
nil
end

def get_diff(project, package, options = {})
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def set_superseded_request
return if @diff_to_superseded

flash[:error] = "Request #{params[:diff_to_superseded]} does not exist or is not superseded by request #{@bs_request.number}."
return
nil
end

def require_request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def set_staging_workflow

redirect_back(fallback_location: root_path)
flash[:error] = 'Staging project not found'
return
nil
end

def set_request_exclusion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def set_staging_workflow

redirect_back(fallback_location: root_path)
flash[:error] = 'Staging project not found'
return
nil
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def set_staging_workflow

redirect_back(fallback_location: root_path)
flash[:error] = "Project #{@project} doesn't have a Staging Workflow associated"
return
nil
end

def project_weight(project)
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def change_password
else
flash[:error] = 'The value of current password does not match your current password. Please enter the password and try again.'
redirect_back fallback_location: root_path
return
nil
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/webui_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def kerberos_auth
# Demand kerberos negotiation
response.headers['WWW-Authenticate'] = 'Negotiate'
render :new, status: 401
return
nil
else
begin
authenticator.extract_user
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/lib/authenticator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def authorization_infos
['X-HTTP_AUTHORIZATION', 'Authorization', 'HTTP_AUTHORIZATION'].each do |header|
return request.env[header].to_s.split if request.env.key?(header)
end
return
nil
end

private
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/bs_request_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def expand_targets(ignore_build_state, ignore_delegate)
per_package_locking
end

return
nil
end

# Follow project links for a target project that delegates requests
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/event/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def calculate_diff(a)
begin
action.sourcediff(view: nil, withissues: 0)
rescue BsRequestAction::Errors::DiffError
return # can't help
nil # can't help
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def self.check_cache(project, package, opts)

Rails.cache.delete(@key) # outdated anyway
end
return
nil
end

def self.internal_get_project(project)
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def find_remote_project(name, skip_access = false)
return project, remote_project
end
end
return
nil
end

# Returns a list of pairs (full name, short name) for each parent
Expand Down Expand Up @@ -919,7 +919,7 @@ def find_package(package_name, check_update_project = nil, processed = {})

# no package found
processed.delete(self)
return
nil
end

def expand_all_repositories
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/project_log_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def self.username_from(payload)
username = User.find_by(id: payload[key]).try(:login) if key == 'commenter'
return username unless username.blank? || username == 'unknown'
end
return
nil
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def self.find_by_project_and_name(project, repo)
local_project, remote_project = Project.find_remote_project(project)
return local_project.repositories.find_or_create_by(name: repo, remote_project_name: remote_project) if local_project

return
nil
end

def self.find_by_project_and_path(project, path)
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def self.create_ldap_user(attributes = {})
return user if user.errors.empty?

logger.info("Cannot create ldap userid: '#{login}' on OBS. Full log: #{user.errors.full_messages.to_sentence}")
return
nil
end

# This static method tries to find a user with the given login and password
Expand Down

0 comments on commit ef25351

Please sign in to comment.