Corrected with rubocop cop 'Lint/UnusedMethodArgument'.

This commit is contained in:
Thorsten Eckel 2015-05-07 10:01:35 +02:00
parent b3b76acc89
commit 7efe34e53b
16 changed files with 22 additions and 27 deletions

View file

@ -205,11 +205,6 @@ Lint/UnusedBlockArgument:
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
Enabled: false Enabled: false
Lint/UnusedMethodArgument:
Description: 'Checks for unused method arguments.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
Enabled: false
Style/SignalException: Style/SignalException:
Description: 'Checks for proper usage of fail and raise.' Description: 'Checks for proper usage of fail and raise.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'

View file

@ -363,7 +363,7 @@ class ApplicationController < ActionController::Base
render json: generic_object.attributes_with_associations, status: :ok render json: generic_object.attributes_with_associations, status: :ok
end end
def model_index_render (object, params) def model_index_render (object, _params)
begin begin
generic_objects = object.all generic_objects = object.all
model_index_render_result( generic_objects ) model_index_render_result( generic_objects )

View file

@ -1,7 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
module ExtraCollection module ExtraCollection
def session( collections, assets, user ) def session( collections, assets, _user )
collections[ Network.to_app_model ] = Network.all collections[ Network.to_app_model ] = Network.all
collections[ Network::Category.to_app_model ] = Network::Category.all collections[ Network::Category.to_app_model ] = Network::Category.all

View file

@ -3,7 +3,7 @@
# process all database filter # process all database filter
module Channel::Filter::Database module Channel::Filter::Database
def self.run( channel, mail ) def self.run( _channel, mail )
# process postmaster filter # process postmaster filter
filters = PostmasterFilter.where( active: true, channel: 'email' ) filters = PostmasterFilter.where( active: true, channel: 'email' )

View file

@ -1,7 +1,7 @@
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
class Channel::Sendmail class Channel::Sendmail
def send(attr, channel, notification = false) def send(attr, _channel, notification = false)
# return if we run import mode # return if we run import mode
return if Setting.get('import_mode') return if Setting.get('import_mode')

View file

@ -137,7 +137,7 @@ class Channel::TWITTER2
[user, ticket, article] [user, ticket, article]
end end
def fetch_user_create(tweet, sender) def fetch_user_create(_tweet, sender)
# create sender in db # create sender in db
# puts tweet.inspect # puts tweet.inspect
# user = User.where( :login => tweet.sender.screen_name ).first # user = User.where( :login => tweet.sender.screen_name ).first
@ -180,7 +180,7 @@ class Channel::TWITTER2
user user
end end
def fetch_ticket_create(user, tweet, sender, channel, group) def fetch_ticket_create(user, tweet, _sender, _channel, group)
#Rails.logger.info '+++++++++++++++++++++++++++' + tweet.inspect #Rails.logger.info '+++++++++++++++++++++++++++' + tweet.inspect
# check if ticket exists # check if ticket exists
@ -237,7 +237,7 @@ class Channel::TWITTER2
ticket ticket
end end
def fetch_article_create( user, ticket, tweet, sender ) def fetch_article_create( _user, ticket, tweet, sender )
# find if record already exists # find if record already exists
article = Ticket::Article.where( message_id: tweet.id.to_s ).first article = Ticket::Article.where( message_id: tweet.id.to_s ).first
@ -268,7 +268,7 @@ class Channel::TWITTER2
end end
def send(attr, notification = false) def send(attr, _notification = false)
# Rails.logger.debug('tweeeeettttt!!!!!!') # Rails.logger.debug('tweeeeettttt!!!!!!')
channel = Channel.where( area: 'Twitter::Inbound', active: true ).first channel = Channel.where( area: 'Twitter::Inbound', active: true ).first

View file

@ -158,7 +158,7 @@ class Observer::Ticket::Notification < ActiveRecord::Observer
EventBuffer.add(e) EventBuffer.add(e)
end end
def after_update(record) def after_update(_record)
# return if we run import mode # return if we run import mode
return if Setting.get('import_mode') return if Setting.get('import_mode')

View file

@ -225,7 +225,7 @@ class Observer::Ticket::Notification::BackgroundJob
changes changes
end end
def template_create(user, ticket, article, ticket_changes) def template_create(user, ticket, article, _ticket_changes)
article_content = '' article_content = ''
if article if article
article_content = '&lt;snip&gt; article_content = '&lt;snip&gt;
@ -348,7 +348,7 @@ Changes:<br>
template template
end end
def template_header(user) def template_header(_user)
' '
<style type="text/css"> <style type="text/css">
.header { .header {
@ -385,7 +385,7 @@ Changes:<br>
' '
end end
def template_footer(user, ticket, article) def template_footer(_user, _ticket, _article)
' '
<p> <p>
<a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">i18n(View this directly here)</a> <a href="#{config.http_type}://#{config.fqdn}/#ticket/zoom/#{ticket.id}">i18n(View this directly here)</a>

View file

@ -416,7 +416,7 @@ class Package < ApplicationModel
true true
end end
def self._delete_file(file, permission, data) def self._delete_file(file, _permission, _data)
location = @@root + '/' + file location = @@root + '/' + file
# install file # install file

View file

@ -1,7 +1,7 @@
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
module Auth::Developer module Auth::Developer
def self.check( username, password, config, user ) def self.check( _username, password, _config, user )
# development systems # development systems
if Setting.get('developer_mode') == true if Setting.get('developer_mode') == true

View file

@ -1,7 +1,7 @@
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
module Auth::Internal module Auth::Internal
def self.check( username, password, config, user ) def self.check( _username, password, _config, user )
# return if no user exists # return if no user exists
return nil if !user return nil if !user

View file

@ -480,7 +480,7 @@ module Import::OTRS2
end end
def self._ticket_result(result, locks, thread = '-') def self._ticket_result(result, locks, _thread = '-')
# puts result.inspect # puts result.inspect
map = { map = {
Ticket: { Ticket: {
@ -968,7 +968,7 @@ module Import::OTRS2
} }
end end
def self.get_queue_ids(user, groups, roles, queues) def self.get_queue_ids(user, _groups, _roles, queues)
queue_ids = [] queue_ids = []
# lookup by groups # lookup by groups
@ -991,7 +991,7 @@ module Import::OTRS2
queue_ids queue_ids
end end
def self.get_roles_ids(user, groups, roles, queues) def self.get_roles_ids(user, groups, roles, _queues)
roles = ['Agent'] roles = ['Agent']
role_ids = [] role_ids = []
user['GroupIDs'].each {|group_id, permissions| user['GroupIDs'].each {|group_id, permissions|

View file

@ -150,7 +150,7 @@ return search result
=end =end
def self.search( query, limit = 10, index = nil, query_extention = {} ) def self.search( query, _limit = 10, index = nil, query_extention = {} )
return [] if !query return [] if !query
url = build_url() url = build_url()

View file

@ -1,7 +1,7 @@
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
module Sso::Env module Sso::Env
def self.check( params, config_item ) def self.check( _params, _config_item )
# try to find user based on login # try to find user based on login
if ENV['REMOTE_USER'] if ENV['REMOTE_USER']

View file

@ -1,7 +1,7 @@
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/ # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
module Sso::Otrs module Sso::Otrs
def self.check( params, config_item ) def self.check( params, _config_item )
endpoint = Setting.get('import_otrs_endpoint') endpoint = Setting.get('import_otrs_endpoint')
return false if !endpoint return false if !endpoint

View file

@ -696,7 +696,7 @@ class TestCase < Test::Unit::TestCase
=end =end
def open_task(params = {}, fallback = false) def open_task(params = {}, _fallback = false)
log('open_task', params) log('open_task', params)
instance = params[:browser] || @browser instance = params[:browser] || @browser