Browse Source

Maintenance: Update dependency rubocop-performance to v1.23.0

renovatebot 3 months ago
parent
commit
b883c3bafc

+ 4 - 0
.dev/rubocop/default.yml

@@ -300,6 +300,10 @@ Style/FetchEnvVar:
   Description: 'This cop suggests `ENV.fetch` for the replacement of `ENV[]`.'
   Enabled: false
 
+Style/SafeNavigationChainLength:
+  Description: 'This cops suggests to not use&.optional&.chaining&.too&.much'
+  Enabled: false
+
 GraphQL/OrderedArguments:
   Enabled: false
 

+ 4 - 4
Gemfile.lock

@@ -458,7 +458,7 @@ GEM
       iniparse (~> 1.4)
       rexml (>= 3.3.9)
     parallel (1.26.3)
-    parser (3.3.5.0)
+    parser (3.3.6.0)
       ast (~> 2.4.1)
       racc
     pg (1.5.9)
@@ -581,7 +581,7 @@ GEM
       rspec-core (> 3.3)
     rspec-support (3.13.1)
     rszr (1.5.0)
-    rubocop (1.67.0)
+    rubocop (1.68.0)
       json (~> 2.3)
       language_server-protocol (>= 3.17.0)
       parallel (~> 1.10)
@@ -591,7 +591,7 @@ GEM
       rubocop-ast (>= 1.32.2, < 2.0)
       ruby-progressbar (~> 1.7)
       unicode-display_width (>= 2.4.0, < 3.0)
-    rubocop-ast (1.32.3)
+    rubocop-ast (1.36.1)
       parser (>= 3.3.1.0)
     rubocop-capybara (2.21.0)
       rubocop (~> 1.41)
@@ -606,7 +606,7 @@ GEM
       activesupport
       rubocop
       rubocop-rspec
-    rubocop-performance (1.22.1)
+    rubocop-performance (1.23.0)
       rubocop (>= 1.48.1, < 2.0)
       rubocop-ast (>= 1.31.1, < 2.0)
     rubocop-rails (2.27.0)

+ 0 - 1
app/controllers/reports_controller.rb

@@ -117,7 +117,6 @@ class ReportsController < ApplicationController
   end
 
   def params_all
-    profile = nil
     if !params[:profiles] && !params[:profile_id]
       raise Exceptions::UnprocessableEntity, __("Required parameter 'profile' is missing.")
     end

+ 0 - 1
app/models/channel/driver/imap.rb

@@ -81,7 +81,6 @@ example
     ssl            = true
     ssl_verify     = options.fetch(:ssl_verify, true)
     starttls       = false
-    port           = 993
     keep_on_server = false
     folder         = 'INBOX'
     if options[:keep_on_server] == true || options[:keep_on_server] == 'true'

+ 5 - 5
app/models/ticket/search_index.rb

@@ -29,7 +29,7 @@ module Ticket::SearchIndex
       # lookup attributes of ref. objects (normally name and note)
       article_attributes = search_index_article_attributes(article)
 
-      article_attributes_payload_size = article_attributes.to_json.bytes.size
+      article_attributes_payload_size = article_attributes.to_json.bytesize
 
       next if search_index_attribute_lookup_oversized?(total_size_current + article_attributes_payload_size)
 
@@ -45,10 +45,10 @@ module Ticket::SearchIndex
 
         next if search_index_attribute_lookup_file_oversized?(attachment, total_size_current)
 
-        next if search_index_attribute_lookup_oversized?(total_size_current + attachment.content.bytes.size)
+        next if search_index_attribute_lookup_oversized?(total_size_current + attachment.content.bytesize)
 
         # add attachment size to totel payload size
-        total_size_current += attachment.content.bytes.size
+        total_size_current += attachment.content.bytesize
 
         article_attributes['attachment'].push search_index_article_attachment_attributes(attachment)
       end
@@ -75,10 +75,10 @@ module Ticket::SearchIndex
 
     # if attachment size is bigger as configured
     attachment_max_size = (Setting.get('es_attachment_max_size_in_mb') || 10).megabyte
-    return true if attachment.content.bytes.size > attachment_max_size
+    return true if attachment.content.bytesize > attachment_max_size
 
     # if complete size is bigger as configured
-    return true if search_index_attribute_lookup_oversized?(total_size_current + attachment.content.bytes.size)
+    return true if search_index_attribute_lookup_oversized?(total_size_current + attachment.content.bytesize)
 
     false
   end

+ 1 - 1
lib/core_ext/string.rb

@@ -92,7 +92,7 @@ class String
 
     removed = ''
     each_char.with_object('') do |c, result|
-      if c.bytes.count > 3
+      if c.bytesize > 3
         removed << c
         next
       end

+ 0 - 1
lib/facebook.rb

@@ -317,7 +317,6 @@ result
   end
 
   def from_article(article)
-    post = nil
     if article[:type] != 'facebook feed comment'
       raise "Can't handle unknown facebook article type '#{article[:type]}'."
     end

+ 1 - 4
lib/notification_factory/mailer.rb

@@ -51,9 +51,6 @@ returns
     matrix = user_preferences['notification_config']['matrix']
     return if !matrix
 
-    owned_by_nobody = false
-    owned_by_me = false
-    subscribed = false
     case ticket.owner_id
     when 1
       owned_by_nobody = true
@@ -76,7 +73,7 @@ returns
     end
 
     # always trigger notifications for user if he is subscribed
-    if owned_by_me == false && ticket.mentions.exists?(user: user)
+    if !owned_by_me && ticket.mentions.exists?(user: user)
       subscribed = true
     end
 

+ 1 - 1
lib/selector/sql.rb

@@ -658,7 +658,7 @@ class Selector::Sql < Selector::Base
   end
 
   def valid?
-    object_count, _objects = target_class.selectors(selector, **options.merge(limit: 1, execution_time: true, ticket_id: 1, access: 'ignore'))
+    object_count, _objects = target_class.selectors(selector, **options, limit: 1, execution_time: true, ticket_id: 1, access: 'ignore')
     !object_count.nil?
   rescue
     false

+ 0 - 2
lib/telegram_helper.rb

@@ -760,8 +760,6 @@ returns
   end
 
   def from_article(article)
-
-    message = nil
     Rails.logger.debug { "Create telegram personal message from article to '#{article[:to]}'..." }
 
     message = {}

Some files were not shown because too many files changed in this diff