Skip to content

Commit

Permalink
Maintenance: Activated rubocop Layout/LeadingCommentSpace.
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsteneckel authored and mgruner committed Jul 19, 2021
1 parent 916bb77 commit b8b5778
Show file tree
Hide file tree
Showing 58 changed files with 177 additions and 182 deletions.
5 changes: 0 additions & 5 deletions .rubocop/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ Style/RescueStandardError:
Enabled: true
EnforcedStyle: implicit

Layout/LeadingCommentSpace:
Description: 'Comments should start with a space.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
Enabled: false

Layout/SpaceInsideReferenceBrackets:
Description: 'Checks the spacing inside referential brackets.'
Enabled: false
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/application_controller/authenticates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def authentication_check(auth_param = {})
end

def authentication_check_only(auth_param = {})
#logger.debug 'authentication_check'
#logger.debug params.inspect
#logger.debug session.inspect
#logger.debug cookies.inspect
# logger.debug 'authentication_check'
# logger.debug params.inspect
# logger.debug session.inspect
# logger.debug cookies.inspect
authentication_errors = []

# already logged in, early exit
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller/has_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def set_user

# update session updated_at
def session_update
#sleep 0.6
# sleep 0.6

session[:ping] = Time.zone.now.iso8601

Expand Down
12 changes: 6 additions & 6 deletions app/controllers/first_steps_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ class FirstStepsController < ApplicationController

def index
invite_agents = false
#if User.of_role('Agent').count > 2
# if User.of_role('Agent').count > 2
# invite_agents = true
#end
# end
invite_customers = false
#if User.of_role('Customer').count > 2
# if User.of_role('Customer').count > 2
# invite_customers = true
#end
# end

chat_active = false
if Setting.get('chat')
Expand Down Expand Up @@ -98,11 +98,11 @@ def index
checked: macro_active,
location: '#manage/macros',
},
#{
# {
# name: 'Create Overviews',
# checked: false,
# location: '#manage/overviews',
#},
# },
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/getting_started_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def auto_wizard_enabled_response
end

def setup_done
#return false
# return false
count = User.all.count()
done = true
if count <= 2
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/long_polling_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def message_receive
4.times do
sleep 0.25
end
#sleep 1
# sleep 1
Sessions.touch(client_id) # rubocop:disable Rails/SkipsModelValidations

# set max loop time to 24 sec. because of 30 sec. timeout of mod_proxy
Expand All @@ -83,7 +83,7 @@ def message_receive
8.times do
sleep 0.25
end
#sleep 2
# sleep 2
if count.zero?
render json: { event: 'pong' }
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module HasDelayedJobMonitoringCompatibilty
# until we resolve this dependency.
after_enqueue do |job|
# skip update of `attempts` attribute if job wasn't queued because of ActiveJobLock
#(another job with same lock key got queued before this job could be retried)
# (another job with same lock key got queued before this job could be retried)
next if job.provider_job_id.blank?

# update the column right away without loading Delayed::Job record
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/communicate_telegram_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def perform(article_id)
channel = Channel.lookup(id: ticket.preferences['channel_id'])
end
log_error(article, "No such channel for bot #{ticket.preferences['bid']} or channel id #{ticket.preferences['channel_id']}") if !channel
#log_error(article, "Channel.find(#{channel.id}) isn't a telegram channel!") if channel.options[:adapter] !~ /\Atelegram/i
# log_error(article, "Channel.find(#{channel.id}) isn't a telegram channel!") if channel.options[:adapter] !~ /\Atelegram/i
log_error(article, "Channel.find(#{channel.id}) has not telegram api token!") if channel.options[:api_token].blank?

begin
Expand Down
2 changes: 1 addition & 1 deletion app/models/calendar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def validate_hours
return
end

#raise Exceptions::UnprocessableEntity, 'No configured business hours found!' if hours.blank?
# raise Exceptions::UnprocessableEntity, 'No configured business hours found!' if hours.blank?

# validate if business hours are usable by execute a try calculation
begin
Expand Down
2 changes: 1 addition & 1 deletion app/models/channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def self.stream
end
end

#logger.info "thread stream for channel (#{channel.id}) already running" if @@channel_stream[channel_id].present?
# logger.info "thread stream for channel (#{channel.id}) already running" if @@channel_stream[channel_id].present?
next if @@channel_stream[channel_id].present?

@@channel_stream[channel_id] = {
Expand Down
2 changes: 1 addition & 1 deletion app/models/channel/driver/pop3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def fetch(options, channel, check_type = '', verify_string = '')
Rails.logger.info "fetching pop3 (#{options[:host]}/#{options[:user]} port=#{port},ssl=#{ssl})"

@pop = ::Net::POP3.new(options[:host], port)
#@pop.set_debug_output $stderr
# @pop.set_debug_output $stderr

# on check, reduce open_timeout to have faster probing
@pop.open_timeout = 16
Expand Down
4 changes: 2 additions & 2 deletions app/models/concerns/has_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def history_update
end
end
self.history_changes_last_done = changes
#logger.info 'updated ' + self.changes.inspect
# logger.info 'updated ' + self.changes.inspect

return if changes['id'] && !changes['id'][0]

Expand Down Expand Up @@ -101,7 +101,7 @@ def history_update
id_from: value_id[0],
id_to: value_id[1],
}
#logger.info "HIST NEW #{self.class.to_s}.find(#{self.id}) #{data.inspect}"
# logger.info "HIST NEW #{self.class.to_s}.find(#{self.id}) #{data.inspect}"
history_log('updated', updated_by_id, data)
end
end
Expand Down
6 changes: 3 additions & 3 deletions app/models/setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,17 @@ def reset_cache
# check if cache is still valid
def self.cache_valid?
if @@lookup_at && @@lookup_at > Time.now.to_i - @@lookup_timeout
#logger.debug "Setting.cache_valid?: cache_id has been set within last #{@@lookup_timeout} seconds"
# logger.debug "Setting.cache_valid?: cache_id has been set within last #{@@lookup_timeout} seconds"
return true
end

change_id = Cache.read('Setting::ChangeId')
if @@change_id && change_id == @@change_id
@@lookup_at = Time.now.to_i # rubocop:disable Style/ClassVars
#logger.debug "Setting.cache_valid?: cache still valid, #{@@change_id}/#{change_id}"
# logger.debug "Setting.cache_valid?: cache still valid, #{@@change_id}/#{change_id}"
return true
end
#logger.debug "Setting.cache_valid?: cache has changed, #{@@change_id}/#{change_id}"
# logger.debug "Setting.cache_valid?: cache has changed, #{@@change_id}/#{change_id}"
false
end
private_class_method :cache_valid?
Expand Down
2 changes: 1 addition & 1 deletion app/models/text_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def self.load(locale, overwrite_existing_item = false)
def self.push(locale)

# only push changed text_modules
text_modules = TextModule.all #where(locale: locale)
text_modules = TextModule.all # where(locale: locale)
text_modules_to_push = []
text_modules.each do |text_module|
next if !text_module.active
Expand Down
2 changes: 1 addition & 1 deletion app/models/transaction/slack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def human_changes(record)

# only show allowed attributes
attribute_list = ObjectManager::Object.new('Ticket').attributes(user).index_by { |item| item[:name] }
#puts "AL #{attribute_list.inspect}"
# puts "AL #{attribute_list.inspect}"
user_related_changes = {}
@item[:changes].each do |key, value|

Expand Down
2 changes: 1 addition & 1 deletion app/models/translation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def self.lang(locale, admin = false)

presorted_list.push item
list.delete item
#list.unshift presort
# list.unshift presort
end
end
data['list'] = presorted_list.concat list
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20120101000001_create_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def up
end
add_index :users, [:login], unique: true
add_index :users, [:email]
#add_index :users, [:email], unique: => true
# add_index :users, [:email], unique: => true
add_index :users, [:organization_id]
add_index :users, [:image]
add_index :users, [:department]
Expand Down
2 changes: 1 addition & 1 deletion db/seeds/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@
description: 'Set notes for ticket create types by selecting type.',
options: {},
state: {
#'email-out' => 'Attention: When creating a ticket an e-mail is sent.',
# 'email-out' => 'Attention: When creating a ticket an e-mail is sent.',
},
preferences: {
permission: ['admin.ui'],
Expand Down
2 changes: 1 addition & 1 deletion lib/can_be_published/state_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def save_record
state :internal
state :published
state :archived
state :unarchived #magic
state :unarchived # magic

event :internal do
transitions from: :draft,
Expand Down
2 changes: 1 addition & 1 deletion lib/core_ext/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def signature_identify(type = 'text', force = false)
# word 14
# edv hotline wrote:
# edv hotline schrieb:
#map['word-en-de'] = "[^#{marker}].{1,250}\s(wrote|schrieb):"
# map['word-en-de'] = "[^#{marker}].{1,250}\s(wrote|schrieb):"

map.each_value do |regexp|
string.sub!(%r{#{regexp}}) do |placeholder|
Expand Down
6 changes: 3 additions & 3 deletions lib/external_credential/facebook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def self.request_account_to_link(credentials = {}, app_required = true)
state = rand(999_999_999_999).to_s
{
request_token: state,
#authorize_url: oauth.url_for_oauth_code(permissions: 'publish_pages, manage_pages, user_posts', state: state),
#authorize_url: oauth.url_for_oauth_code(permissions: 'publish_pages, manage_pages', state: state),
# authorize_url: oauth.url_for_oauth_code(permissions: 'publish_pages, manage_pages, user_posts', state: state),
# authorize_url: oauth.url_for_oauth_code(permissions: 'publish_pages, manage_pages', state: state),
authorize_url: oauth.url_for_oauth_code(permissions: 'pages_manage_posts, pages_manage_engagement, pages_manage_metadata, pages_read_engagement, pages_read_user_content', state: state),
}
end
Expand All @@ -52,7 +52,7 @@ def self.link_account(_request_token, params)
access_token = oauth.get_access_token(params[:code])
client = Koala::Facebook::API.new(access_token)
user = client.get_object('me')
#p client.get_connections('me', 'accounts').inspect
# p client.get_connections('me', 'accounts').inspect
pages = []
client.get_connections('me', 'accounts').each do |page|
pages.push(
Expand Down
2 changes: 1 addition & 1 deletion lib/facebook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def to_article(post, ticket, page)
end

article = {
#to: @account['name'],
# to: @account['name'],
ticket_id: ticket.id,
internal: false,
sender_id: Ticket::Article::Sender.lookup(name: 'Customer').id,
Expand Down
2 changes: 1 addition & 1 deletion lib/idoit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def self.query(method, filter = {})
raise 'Unable for find api_token in config' if setting[:api_token].blank?
raise 'Unable for find endpoint in config' if setting[:endpoint].blank?

#translator_key = Setting.get('translator_key')
# translator_key = Setting.get('translator_key')
params = {
apikey: setting[:api_token],
}
Expand Down
2 changes: 1 addition & 1 deletion lib/import/otrs/article.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Article
Subject: :subject,
InReplyTo: :in_reply_to,
MessageID: :message_id,
#ReplyTo: :reply_to,
# ReplyTo: :reply_to,
References: :references,
ContentType: :content_type,
Changed: :updated_at,
Expand Down
12 changes: 6 additions & 6 deletions lib/import/otrs/ticket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class Ticket
Title: :title,
TicketID: :id,
FirstResponse: :first_response_at,
#FirstResponseTimeDestinationDate: :first_response_escalation_at,
#FirstResponseInMin: :first_response_in_min,
#FirstResponseDiffInMin: :first_response_diff_in_min,
# FirstResponseTimeDestinationDate: :first_response_escalation_at,
# FirstResponseInMin: :first_response_in_min,
# FirstResponseDiffInMin: :first_response_diff_in_min,
Closed: :close_at,
#SoltutionTimeDestinationDate: :close_escalation_at,
#CloseTimeInMin: :close_in_min,
#CloseTimeDiffInMin: :close_diff_in_min,
# SoltutionTimeDestinationDate: :close_escalation_at,
# CloseTimeInMin: :close_in_min,
# CloseTimeDiffInMin: :close_diff_in_min,
}.freeze

def initialize(ticket)
Expand Down
6 changes: 3 additions & 3 deletions lib/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def self.all
all[model_class][:attributes] = model_class.attribute_names
all[model_class][:reflections] = model_class.reflections
all[model_class][:table] = model_class.table_name
#puts model_class
#puts "rrrr #{all[model_class][:attributes]}"
#puts " #{model_class.attribute_names.inspect}"
# puts model_class
# puts "rrrr #{all[model_class][:attributes]}"
# puts " #{model_class.attribute_names.inspect}"
end
all
end
Expand Down
6 changes: 3 additions & 3 deletions lib/report/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def self.time_average(data)
# puts 'FR:' + first_response.to_s
# puts 'CT:' + ticket.created_at.to_s
diff = timestamp - ticket.created_at
#puts 'DIFF:' + diff.to_s
# puts 'DIFF:' + diff.to_s
time_total += diff
tickets += 1
end
Expand Down Expand Up @@ -275,7 +275,7 @@ def self.time_min(data)
# puts 'FR:' + first_response.to_s
# puts 'CT:' + ticket.created_at.to_s
diff = timestamp - ticket.created_at
#puts 'DIFF:' + diff.to_s
# puts 'DIFF:' + diff.to_s
if !time_min
time_min = diff
end
Expand Down Expand Up @@ -313,7 +313,7 @@ def self.time_max(data)
# puts 'FR:' + ticket.first_response.to_s
# puts 'CT:' + ticket.created_at.to_s
diff = timestamp - ticket.created_at
#puts 'DIFF:' + diff.to_s
# puts 'DIFF:' + diff.to_s
if !time_max
time_max = diff
end
Expand Down
4 changes: 2 additions & 2 deletions lib/sessions/event/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ def log(level, data, client_id = nil)
end
# rubocop:disable Rails/Output
puts "#{Time.now.utc.iso8601}:client(#{client_id}) #{data}"
#puts "#{Time.now.utc.iso8601}:#{ level }:client(#{ client_id }) #{ data }"
# puts "#{Time.now.utc.iso8601}:#{ level }:client(#{ client_id }) #{ data }"
# rubocop:enable Rails/Output
#Rails.logger.info "#{Time.now.utc.iso8601}:client(#{client_id}) #{data}"
# Rails.logger.info "#{Time.now.utc.iso8601}:client(#{client_id}) #{data}"
end

def self.database_connection_required
Expand Down
12 changes: 6 additions & 6 deletions lib/sessions/store/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ def nodes
nodes.push data
rescue => e
Rails.logger.error "can't parse status file #{filename}, #{e.inspect}"
#to_delete.push "#{path}/#{entry}"
#next
# to_delete.push "#{path}/#{entry}"
# next
end
end
end
Expand Down Expand Up @@ -260,8 +260,8 @@ def each_node_session()
yield data
rescue => e
Rails.logger.error "can't parse session file #{filename}, #{e.inspect}"
#to_delete.push "#{path}/#{entry}"
#next
# to_delete.push "#{path}/#{entry}"
# next
end
end
end
Expand Down Expand Up @@ -300,8 +300,8 @@ def each_session_by_node(node_id)
yield data
rescue => e
Rails.logger.error "can't parse session file #{filename}, #{e.inspect}"
#to_delete.push "#{path}/#{entry}"
#next
# to_delete.push "#{path}/#{entry}"
# next
end
end
end
Expand Down
Loading

0 comments on commit b8b5778

Please sign in to comment.