Skip to content

Fix performance analytics rubocop

Linjie Zhang请求将fix-performance-rubocop合并到main-jh

What does this MR do and why?

Fix performance analytics rubocop

jh/lib/gitlab/analytics/performance_analytics/group_report.rb:33:25: C: [Correctable] Rails/IndexWith: Prefer index_with over to_h { ... }.
          column_data = COLUMN_KEYS.to_h do |key| ...
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
jh/lib/gitlab/analytics/performance_analytics/group_report.rb:57:25: C: [Correctable] Rails/IndexWith: Prefer index_with over to_h { ... }.
          column_data = COLUMN_KEYS.to_h do |key| ...
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
jh/lib/gitlab/analytics/performance_analytics/group_report.rb:82:44: C: [Correctable] Rails/IndexWith: Prefer index_with over to_h { ... }.
            { "username" => "Name" }.merge(COLUMN_KEYS.to_h { |key| [key, column_class(key).header] })
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jh/lib/gitlab/analytics/performance_analytics/project_report.rb:76:26: C: [Correctable] Rails/IndexWith: Prefer index_with over to_h { ... }.
            query_data = COLUMN_KEYS.to_h do |key| ...
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
jh/lib/gitlab/analytics/performance_analytics/project_report.rb:94:44: C: [Correctable] Rails/IndexWith: Prefer index_with over to_h { ... }.
            { "username" => "Name" }.merge(COLUMN_KEYS.to_h { |key| [key, column_class(key).header] })
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Describe in detail what your merge request does and why.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

合并请求报告