Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Rubocop all the things #22919

Open
wants to merge 205 commits into
base: master
Choose a base branch
from

Conversation

Fryguy
Copy link
Member

@Fryguy Fryguy commented Feb 28, 2024

No description provided.

@@ -205,12 +207,12 @@
def to_pdf
# Create the pdf header section
html_string = generate_pdf_header(
:title => name.gsub(/'/, '\\\\\&'), # Escape single quotes
:title => name.gsub("'", '\\\\\&'), # Escape single quotes

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, single quotes vs double quotes for the replacement string.

though, am a little confused what the original code intends.

@@ -67,7 +67,7 @@ def self.xml_to_hashes(xmlNode, findPath, typeName)
nh[:acctid] = nh.delete("#{typeName}id".to_sym)
nh[:acctid] = nil unless nh[:acctid].respond_to?(:to_int) || nh[:acctid].to_s =~ /^-?[0-9]+$/
# Convert to signed integer values for acctid
nh[:acctid] = [nh[:acctid].to_i].pack("I").unpack("i")[0] unless nh[:acctid].nil?
nh[:acctid] = [nh[:acctid].to_i].pack("I").unpack1("i") unless nh[:acctid].nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's actually correct - I agree it does look strange though.

@miq-bot
Copy link
Member

miq-bot commented Feb 29, 2024

Some comments on commits Fryguy/manageiq@3ab431e~...a0fe6fb

lib/tasks/evm_automate.rake

  • ⚠️ - 112 - Detected puts. Remove all debugging statements.
  • ⚠️ - 150 - Detected puts. Remove all debugging statements.
  • ⚠️ - 153 - Detected puts. Remove all debugging statements.
  • ⚠️ - 156 - Detected puts. Remove all debugging statements.
  • ⚠️ - 159 - Detected puts. Remove all debugging statements.
  • ⚠️ - 194 - Detected puts. Remove all debugging statements.
  • ⚠️ - 209 - Detected puts. Remove all debugging statements.
  • ⚠️ - 221 - Detected puts. Remove all debugging statements.
  • ⚠️ - 75 - Detected puts. Remove all debugging statements.

lib/tasks/evm_plugins.rake

  • ⚠️ - 16 - Detected puts. Remove all debugging statements.

lib/tasks/locale.rake

  • ⚠️ - 316 - Detected puts. Remove all debugging statements.
  • ⚠️ - 324 - Detected puts. Remove all debugging statements.
  • ⚠️ - 326 - Detected puts. Remove all debugging statements.
  • ⚠️ - 331 - Detected puts. Remove all debugging statements.
  • ⚠️ - 335 - Detected puts. Remove all debugging statements.

lib/tasks/test.rake

  • ⚠️ - 23 - Detected puts. Remove all debugging statements.
  • ⚠️ - 39 - Detected puts. Remove all debugging statements.

product/script/export_policy_profiles.rb

  • ⚠️ - 21 - Detected puts. Remove all debugging statements.

spec/lib/ansible/runner/credential/machine_credential_spec.rb

  • ⚠️ - 89 - Detected pp. Remove all debugging statements.
  • ⚠️ - 90 - Detected pp. Remove all debugging statements.

spec/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script_source_spec.rb

  • ⚠️ - 105 - Detected allow_any_instance_of. This RSpec method is highly discouraged, please only use when absolutely necessary.

spec/support/custom_matchers/be_same_time_as.rb

  • ⚠️ - 5 - Detected puts. Remove all debugging statements.

spec/tools/perf_generate.rb

  • ⚠️ - 47 - Detected puts. Remove all debugging statements.

@miq-bot
Copy link
Member

miq-bot commented Feb 29, 2024

Checked commits Fryguy/manageiq@3ab431e~...a0fe6fb with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
1049 files checked, 414 offenses detected

app/mailers/generic_mailer.rb

  • ❗ - Line 102, Col 11 - Style/SafeNavigation - Use safe navigation (&.) instead of checking if an object exists before calling the method.

app/models/asset_tag_import.rb

app/models/assigned_server_role.rb

app/models/authenticator/base.rb

app/models/authenticator/httpd.rb

app/models/authenticator/ldap.rb

app/models/blacklisted_event.rb

app/models/chargeback.rb

app/models/chargeback/consumption.rb

app/models/chargeback/consumption_with_rollups.rb

app/models/chargeback/report_options.rb

app/models/chargeback_configured_system.rb

app/models/chargeback_rate.rb

app/models/chargeback_rate_detail_currency.rb

app/models/chargeback_vm.rb

  • ❗ - Line 210, Col 1 - Layout/EmptyLinesAroundMethodBody - Extra empty line detected at method body end.
  • ❗ - Line 67, Col 7 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

app/models/classification.rb

  • ❗ - Line 221, Col 26 - Performance/MapCompact - Use filter_map instead.

app/models/cloud_network.rb

app/models/container_group.rb

app/models/container_replicator.rb

app/models/container_service.rb

app/models/customization_template_sysprep.rb

app/models/dialog.rb

app/models/dialog_field.rb

app/models/dialog_field_tag_control.rb

app/models/dialog_serializer.rb

app/models/ems_cluster.rb

app/models/ems_event/automate.rb

  • ❗ - Line 21, Col 33 - Performance/MapCompact - Use filter_map instead.

app/models/ems_refresh/link_inventory.rb

app/models/ext_management_system.rb

  • 💣 💥 🔥 🚒 - Line 1, Col 1 - Lint/Syntax - class definition in method body
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 784, Col 20 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 786, Col 21 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 788, Col 25 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 790, Col 23 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 792, Col 27 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 810, Col 3 - Lint/Syntax - dynamic constant assignment
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

app/models/file_depot_ftp.rb

app/models/hardware.rb

app/models/host.rb

app/models/job.rb

app/models/lifecycle_event.rb

app/models/manageiq/providers/base_manager/event_catcher/runner.rb

app/models/manageiq/providers/cloud_manager/vm.rb

app/models/manageiq/providers/embedded_ansible/automation_manager/azure_credential.rb

app/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script_source.rb

app/models/manageiq/providers/embedded_ansible/automation_manager/openstack_credential.rb

app/models/metric/ci_mixin.rb

app/models/metric/common.rb

app/models/metric/helper.rb

  • ❗ - Line 27, Col 18 - Rails/TimeZone - Do not use Time.parse without zone. Use one of Time.zone.parse, Time.current, Time.parse.in_time_zone, Time.parse.utc, Time.parse.getlocal, Time.parse.xmlschema, Time.parse.iso8601, Time.parse.jisx0301, Time.parse.rfc3339, Time.parse.httpdate, Time.parse.to_i, Time.parse.to_f instead.

app/models/miq_action.rb

app/models/miq_ae_class.rb

  • ❗ - Line 78, Col 15 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 81, Col 15 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

app/models/miq_ae_field.rb

  • ❗ - Line 115, Col 5 - Rails/ReadWriteAttribute - Prefer self[:default_value] = datatype == "password" ? MiqAePassword.encrypt(value) : value.
  • ❗ - Line 17, Col 22 - Style/MutableConstant - Freeze mutable objects assigned to constants.
  • ❗ - Line 19, Col 23 - Style/MutableConstant - Freeze mutable objects assigned to constants.
  • ❗ - Line 82, Col 15 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 85, Col 15 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

app/models/miq_ae_instance.rb

  • ❗ - Line 96, Col 15 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 99, Col 15 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

app/models/miq_ae_method.rb

  • ❗ - Line 26, Col 25 - Style/MutableConstant - Freeze mutable objects assigned to constants.
  • ❗ - Line 30, Col 22 - Style/MutableConstant - Freeze mutable objects assigned to constants.
  • ❗ - Line 94, Col 15 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 97, Col 15 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

app/models/miq_ae_namespace.rb

app/models/miq_ae_value.rb

  • ❗ - Line 14, Col 15 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 17, Col 15 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

app/models/miq_alert.rb

app/models/miq_automate.rb

  • ❗ - Line 24, Col 5 - Style/SafeNavigation - Use safe navigation (&.) instead of checking if an object exists before calling the method.

app/models/miq_bulk_import.rb

app/models/miq_enterprise.rb

app/models/miq_policy.rb

app/models/miq_policy/import_export.rb

app/models/miq_product_feature.rb

app/models/miq_provision/custom_attributes.rb

app/models/miq_provision_request.rb

app/models/miq_provision_task.rb

app/models/miq_provision_virt_workflow.rb

  • ❗ - Line 461, Col 25 - Performance/RedundantMerge - Use result["fields"] = "Specification"; result["file"] = "Sysprep Answer File" instead of result.merge!("fields" => "Specification", "file" => "Sysprep Answer File").
  • ❗ - Line 473, Col 27 - Style/SymbolProc - Pass &:to_s as an argument to index_with instead of a block.
  • ❗ - Line 680, Col 85 - Performance/MapCompact - Use filter_map instead.
  • ❗ - Line 680, Col 93 - Style/SymbolProc - Pass &:presence as an argument to collect instead of a block.

app/models/miq_queue.rb

app/models/miq_report/generator.rb

  • ❗ - Line 598, Col 1 - Layout/EmptyLinesAroundMethodBody - Extra empty line detected at method body end.
  • ❗ - Line 750, Col 15 - Style/HashTransformKeys - Prefer transform_keys over each_with_object.
  • ❗ - Line 772, Col 10 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 808, Col 38 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

app/models/miq_report/generator/async.rb

app/models/miq_report/generator/html.rb

app/models/miq_report/generator/sorting.rb

  • ❗ - Line 72, Col 51 - Style/SafeNavigation - Use safe navigation (&.) instead of checking if an object exists before calling the method.

app/models/miq_report/generator/trend.rb

app/models/miq_report/import_export.rb

app/models/miq_report_result.rb

app/models/miq_request.rb

app/models/miq_request_workflow.rb

  • ❗ - Line 152, Col 17 - Performance/StringInclude - Use String#include? instead of a regex match with literal-only pattern.

app/models/miq_request_workflow/dialog_field_validation.rb

app/models/miq_retire_task.rb

app/models/miq_schedule.rb

app/models/miq_search.rb

app/models/miq_server.rb

app/models/miq_server/log_management.rb

app/models/miq_server/role_management.rb

app/models/miq_server/worker_management/dequeue.rb

app/models/miq_server/worker_management/heartbeat.rb

app/models/miq_server/worker_management/monitor/reason.rb

  • ❗ - Line 8, Col 5 - Style/SafeNavigation - Use safe navigation (&.) instead of checking if an object exists before calling the method.

app/models/miq_server/worker_management/monitor/status.rb

  • ❗ - Line 5, Col 5 - Style/SafeNavigation - Use safe navigation (&.) instead of checking if an object exists before calling the method.

app/models/miq_smart_proxy_worker/runner.rb

app/models/miq_snmp.rb

app/models/miq_template.rb

  • 💣 💥 🔥 🚒 - Line 1, Col 1 - Lint/Syntax - class definition in method body
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 40, Col 15 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

app/models/miq_widget.rb

app/models/miq_worker.rb

app/models/miq_worker/runner.rb

app/models/mixins/assignment_mixin.rb

app/models/mixins/custom_attribute_mixin.rb

app/models/mixins/filterable_mixin.rb

app/models/mixins/ownership_mixin.rb

app/models/mixins/provider_object_mixin.rb

app/models/mixins/service_mixin.rb

app/models/notification.rb

app/models/openscap_result.rb

app/models/pglogical_subscription.rb

app/models/provider_tag_mapping/mapper.rb

app/models/pxe_server.rb

app/models/resource_action_workflow.rb

app/models/resource_pool.rb

@miq-bot
Copy link
Member

miq-bot commented Feb 29, 2024

...continued

app/models/service.rb

app/models/service_reconfigure_request.rb

app/models/service_template.rb

  • ❗ - Line 241, Col 9 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 293, Col 9 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

app/models/service_template_provision_task.rb

app/models/session.rb

app/models/storage.rb

app/models/system_console.rb

  • ❗ - Line 72, Col 19 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

app/models/vim_performance_daily.rb

  • 💣 💥 🔥 🚒 - Line 1, Col 1 - Lint/Syntax - class definition in method body
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 2, Col 35 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 4, Col 3 - Lint/Syntax - dynamic constant assignment
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 5, Col 3 - Lint/Syntax - dynamic constant assignment
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

app/models/vim_performance_tag.rb

app/models/vim_performance_trend.rb

app/models/vm/operations.rb

app/models/vm_or_template.rb

app/models/vm_or_template/scanning.rb

app/models/vm_scan.rb

config/preinitializer.rb

lib/ansible/runner/response.rb

lib/container_orchestrator.rb

  • ❗ - Line 29, Col 18 - Performance/StringInclude - Use String#include? instead of a regex match with literal-only pattern.
  • ❗ - Line 37, Col 18 - Performance/StringInclude - Use String#include? instead of a regex match with literal-only pattern.
  • ❗ - Line 45, Col 18 - Performance/StringInclude - Use String#include? instead of a regex match with literal-only pattern.
  • ❗ - Line 53, Col 18 - Performance/StringInclude - Use String#include? instead of a regex match with literal-only pattern.
  • ❗ - Line 59, Col 18 - Performance/StringInclude - Use String#include? instead of a regex match with literal-only pattern.
  • ❗ - Line 65, Col 18 - Performance/StringInclude - Use String#include? instead of a regex match with literal-only pattern.

lib/extensions/ar_adapter/ar_kill.rb

lib/extensions/ar_miq_set.rb

  • 💣 💥 🔥 🚒 - Line 100, Col 38 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 60, Col 1 - Lint/Syntax - module definition in method body
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 95, Col 3 - Lint/Syntax - module definition in method body
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

lib/extensions/ar_order.rb

lib/manageiq.rb

lib/manageiq/reporting/formatter/c3_helper.rb

lib/manageiq/reporting/formatter/text.rb

  • ❗ - Line 121, Col 25 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 21, Col 25 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 258, Col 40 - Performance/Sum - Use sum((columns.length - 1) * 3) instead of inject((columns.length - 1) * 3) { |s, e| s + e }.
  • ❗ - Line 260, Col 40 - Performance/Sum - Use sum(columns.length * 3) instead of inject(columns.length * 3) { |s, e| s + e }.
  • ❗ - Line 262, Col 11 - Style/StringConcatenation - Prefer string interpolation to string concatenation.

lib/manageiq/reporting/formatter/timeline.rb

lib/manageiq/session/memory_store_adapter.rb

lib/miq_expression.rb

  • ❗ - Line 11, Col 30 - Rails/RootPathnameMethods - Rails.root is a Pathname so you can just append #read.
  • ❗ - Line 594, Col 10 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 598, Col 13 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

lib/miq_expression/target.rb

lib/miq_ldap.rb

lib/miq_pglogical/connection_handling.rb

lib/rbac/filterer.rb

lib/remote_console/rack_server.rb

lib/task_helpers/exports/scan_profiles.rb

  • ❗ - Line 14, Col 11 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 16, Col 13 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

lib/task_helpers/imports/customization_templates.rb

lib/tasks/evm_automate.rake

lib/tasks/evm_dba.rake

lib/tasks/locale.rake

lib/tasks/test.rake

lib/vmdb/appliance.rb

lib/vmdb/plugins.rb

lib/vmdb/settings/validator.rb

lib/vmdb/util.rb

lib/workers/bin/run_single_worker.rb

product/script/export_policy_profiles.rb

spec/factories/dialog.rb

  • 💣 💥 🔥 🚒 - Line 12, Col 31 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/factories/dialog_group.rb

  • 💣 💥 🔥 🚒 - Line 12, Col 31 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/factories/dialog_tab.rb

  • 💣 💥 🔥 🚒 - Line 12, Col 31 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/factories/miq_user_role.rb

spec/lib/ems_event_helper_spec.rb

  • ❗ - Line 21, Col 64 - Style/NumericLiterals - Use underscores(_) as thousands separator and separate every 3 digits with them.
  • ❗ - Line 37, Col 71 - Rails/TimeZone - Do not use Time.now without zone. Use one of Time.zone.now, Time.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.xmlschema, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.httpdate, Time.now.to_i, Time.now.to_f instead.
  • ❗ - Line 52, Col 71 - Rails/TimeZone - Do not use Time.now without zone. Use one of Time.zone.now, Time.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.xmlschema, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.httpdate, Time.now.to_i, Time.now.to_f instead.
  • ❗ - Line 67, Col 71 - Rails/TimeZone - Do not use Time.now without zone. Use one of Time.zone.now, Time.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.xmlschema, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.httpdate, Time.now.to_i, Time.now.to_f instead.
  • ❗ - Line 82, Col 71 - Rails/TimeZone - Do not use Time.now without zone. Use one of Time.zone.now, Time.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.xmlschema, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.httpdate, Time.now.to_i, Time.now.to_f instead.
  • ❗ - Line 89, Col 66 - Style/NumericLiterals - Use underscores(_) as thousands separator and separate every 3 digits with them.

spec/lib/extensions/ar_base_model_spec.rb

  • 💣 💥 🔥 🚒 - Line 20, Col 25 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
  • 💣 💥 🔥 🚒 - Line 5, Col 23 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/lib/extensions/ar_base_spec.rb

  • 💣 💥 🔥 🚒 - Line 5, Col 23 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/lib/extensions/database_configuration_spec.rb

spec/lib/rbac/filterer_spec.rb

spec/lib/task_helpers/exports/customization_templates_spec.rb

spec/lib/uuid_mixin_spec.rb

  • 💣 💥 🔥 🚒 - Line 4, Col 21 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/models/dialog_field_serializer_spec.rb

spec/models/dialog_spec.rb

spec/models/metric_spec.rb

  • ❗ - Line 65, Col 89 - Style/NumericLiterals - Use underscores(_) as thousands separator and separate every 3 digits with them.
  • ❗ - Line 69, Col 106 - Rails/TimeZone - Do not use Time.parse without zone. Use one of Time.zone.parse, Time.current, Time.parse.in_time_zone, Time.parse.utc, Time.parse.getlocal, Time.parse.xmlschema, Time.parse.iso8601, Time.parse.jisx0301, Time.parse.rfc3339, Time.parse.httpdate, Time.parse.to_i, Time.parse.to_f instead.
  • ❗ - Line 71, Col 106 - Rails/TimeZone - Do not use Time.parse without zone. Use one of Time.zone.parse, Time.current, Time.parse.in_time_zone, Time.parse.utc, Time.parse.getlocal, Time.parse.xmlschema, Time.parse.iso8601, Time.parse.jisx0301, Time.parse.rfc3339, Time.parse.httpdate, Time.parse.to_i, Time.parse.to_f instead.

spec/models/miq_queue_spec.rb

spec/models/miq_report_result_spec.rb

spec/models/miq_server/worker_management/monitor/system_limits_spec.rb

spec/models/miq_server/worker_management/monitor_spec.rb

spec/models/miq_worker_spec.rb

spec/models/mixins/ansible_playbook_mixin_spec.rb

  • 💣 💥 🔥 🚒 - Line 4, Col 21 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/models/mixins/authentication_mixin_spec.rb

  • 💣 💥 🔥 🚒 - Line 12, Col 21 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/models/mixins/custom_actions_mixin_spec.rb

  • 💣 💥 🔥 🚒 - Line 4, Col 21 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/models/mixins/custom_attribute_mixin_spec.rb

  • 💣 💥 🔥 🚒 - Line 5, Col 21 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/models/mixins/external_url_spec.rb

  • 💣 💥 🔥 🚒 - Line 4, Col 21 - Lint/Syntax - unexpected token tEQL
    (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

spec/models/provider_tag_mapping_spec.rb

spec/spec_helper.rb

spec/support/custom_matchers/be_same_time_as.rb

spec/support/examples_group/shared_examples_for_ownership_mixin.rb

spec/support/miq_request_task_helper.rb

spec/support/query_counter.rb

spec/support/quota_helper.rb

  • ❗ - Line 9, Col 9 - Style/SafeNavigation - Use safe navigation (&.) instead of checking if an object exists before calling the method.

spec/tools/perf_generate.rb

tools/copy_reports_structure/report_structure.rb

tools/fix_disk_sizes.rb

tools/fix_vm_relationships.rb

@miq-bot
Copy link
Member

miq-bot commented Feb 29, 2024

...continued

tools/import_v4_provision_dialogs.rb

tools/ldap_ping.rb

tools/list_evm_snapshots.rb

tools/log_processing/ems_refresh_timings.rb

tools/log_processing/ui_request_parser.rb

  • ⚠️ - Line 14, Col 12 - Lint/AssignmentInCondition - Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
  • ⚠️ - Line 19, Col 15 - Lint/AssignmentInCondition - Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.

tools/miq_config_sssd_ldap/cli_config.rb

tools/pg_inspector/active_connections_to_human.rb

  • ❗ - Line 101, Col 9 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 116, Col 9 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 241, Col 9 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
  • ❗ - Line 80, Col 9 - Performance/CollectionLiteralInLoop - Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

tools/pg_inspector/active_connections_to_yaml.rb

tools/pg_inspector/servers_to_yaml.rb

tools/purge_archived_vms.rb

tools/purge_metrics.rb

tools/purge_miq_report_results.rb

tools/remove_grouping_from_report_results.rb

tools/rm_evm_snapshots.rb

tools/vim_collect_inventory.rb

end
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub is presenting this funny, but it's a hidden tab character being fixed to spaces.

end
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub is presenting this funny, but it's a hidden tab character being fixed to spaces.

Comment on lines +96 to 97
raise _("Cannot call method '%{caller}' on an Account of type '%{type}'") % {:caller => caller(1..1).first[/`.*'/][1..-2],
:type => accttype}
Copy link
Member

@kbrock kbrock Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also looks strange to me

maybe this is a performance statement where caller() only builds an array for the line in question so you don't create a large backtrace to throw away most of it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct - this prevents it from returning the entire payload

@miq-bot
Copy link
Member

miq-bot commented Feb 29, 2024

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented Jun 3, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

1 similar comment
@miq-bot
Copy link
Member

miq-bot commented Sep 9, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants