Project

General

Profile

Actions

Maintenance #2059

closed

Fix rubocop complaints

Added by liaham about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Compatible Redmine Version:

Description

app/helpers/dashboards_helper.rb:70:25: C: [Correctable] Performance/StringIdentifierArgument: Use :"render_#{block_object[:type]}_block" instead of "render_#{block_object[:type]}_block".
      block_object.send "render_#{block_object[:type]}_block", block_id, settings, dashboard
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/helpers/dashboards_queries_helper.rb:26:5: W: [Correctable] Lint/SymbolConversion: Unnecessary symbol conversion; use :"#{object_type}_query" instead.
    "#{object_type}_query".to_sym
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/dashboard.rb:48:22: C: [Correctable] Style/RedundantParentheses: Don't use parentheses around an expression.
  scope :by_project, (->(project_id) { where project_id: project_id if project_id.present? })
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/dashboard.rb:49:18: C: [Correctable] Style/RedundantParentheses: Don't use parentheses around an expression.
  scope :sorted, (-> { order "#{Dashboard.table_name}.name" })
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/dashboard.rb:50:24: C: [Correctable] Style/RedundantParentheses: Don't use parentheses around an expression.
  scope :welcome_only, (-> { where dashboard_type: DashboardContentWelcome::TYPE_NAME })
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/dashboard.rb:426:5: C: [Correctable] Style/RedundantParentheses: Don't use parentheses around a logical expression.
    (author == user && user.allowed_to?(:manage_own_dashboards, prj, global: true))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/dashboard_block.rb:189:10: C: [Correctable] Performance/StringIdentifierArgument: Use :"#{attr[0]}=" instead of "#{attr[0]}=".
    send("#{attr[0]}=", nil)
Actions #1

Updated by liaham about 1 year ago

  • Tracker changed from Improvement to Maintenance
Actions #2

Updated by liaham about 1 year ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF