diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cc287e6429e..3cbe7ce5142 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,47 +1,86 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2020-11-30 14:34:25 UTC using RuboCop version 0.89.1. +# on 2024-03-06 12:17:55 UTC using RuboCop version 1.23.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 169 +# Offense count: 168 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth. # SupportedStyles: case, end Layout/CaseIndentation: Enabled: false -# Offense count: 194 +# Offense count: 1 +# Cop supports --auto-correct. +Layout/CommentIndentation: + Exclude: + - 'app/models/concerns/orchestration.rb' + +# Offense count: 8 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleAlignWith, Severity. +# SupportedStylesAlignWith: keyword, variable, start_of_line +Layout/EndAlignment: + Exclude: + - 'app/controllers/api/base_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/models/compute_resources/foreman/model/ovirt.rb' + - 'app/models/concerns/foreman/sti.rb' + - 'app/models/concerns/orchestration.rb' + - 'app/models/concerns/orchestration/dhcp.rb' + - 'app/models/template.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +# Configuration parameters: Width, IgnoredPatterns. +Layout/IndentationWidth: + Exclude: + - 'app/controllers/api/base_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/models/compute_resources/foreman/model/ovirt.rb' + - 'app/models/concerns/foreman/sti.rb' + - 'app/models/concerns/orchestration.rb' + - 'app/models/concerns/orchestration/dhcp.rb' + - 'app/models/template.rb' + +# Offense count: 158 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: symmetrical, new_line, same_line Layout/MultilineHashBraceLayout: Enabled: false -# Offense count: 84 +# Offense count: 95 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: symmetrical, new_line, same_line Layout/MultilineMethodCallBraceLayout: Enabled: false -# Offense count: 106 +# Offense count: 104 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented, indented_relative_to_receiver Layout/MultilineMethodCallIndentation: Enabled: false -# Offense count: 87 +# Offense count: 75 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented Layout/MultilineOperationIndentation: Enabled: false -# Offense count: 3656 +# Offense count: 1 +# Cop supports --auto-correct. +Layout/SpaceAroundMethodCallOperator: + Exclude: + - 'test/controllers/api/v2/hosts_controller_test.rb' + +# Offense count: 3290 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. # SupportedStyles: space, no_space, compact @@ -49,44 +88,92 @@ Layout/MultilineOperationIndentation: Layout/SpaceInsideHashLiteralBraces: Enabled: false +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'script/dynflowd' + # Offense count: 58 +# Configuration parameters: IgnoredMethods. Lint/AmbiguousBlockAssociation: Enabled: false -# Offense count: 134 +# Offense count: 127 # Cop supports --auto-correct. Lint/AmbiguousRegexpLiteral: Enabled: false -# Offense count: 108 +# Offense count: 1 +Lint/BinaryOperatorWithIdenticalOperands: + Exclude: + - 'test/models/application_record_test.rb' + +# Offense count: 103 # Cop supports --auto-correct. Lint/BooleanSymbol: Enabled: false +# Offense count: 1 +# Cop supports --auto-correct. +Lint/DeprecatedOpenSSLConstant: + Exclude: + - 'app/services/foreman/fips.rb' + # Offense count: 5 Lint/DuplicateMethods: Exclude: - - 'lib/fog_extensions/openstack/server.rb' - 'app/registries/foreman/plugin/report_scanner_registry.rb' - 'app/services/report_importer.rb' + - 'lib/fog_extensions/openstack/server.rb' - 'test/models/concerns/exportable_test.rb' -# Offense count: 9 +# Offense count: 1 +Lint/FloatComparison: + Exclude: + - 'test/unit/puppet_fact_parser_test.rb' + +# Offense count: 11 +Lint/MissingSuper: + Exclude: + - 'app/graphql/collection_loader.rb' + - 'app/graphql/record_loader.rb' + - 'app/models/report_composer.rb' + - 'app/services/ansible_fact_parser.rb' + - 'app/services/foreman/renderer/source/string.rb' + - 'app/services/foreman_ansible/structured_fact_importer.rb' + - 'lib/foreman/exception.rb' + - 'test/controllers/concerns/bulk_hosts_extension_test.rb' + - 'test/unit/ensure_no_cycle_test.rb' + - 'test/unit/sso_test.rb' + +# Offense count: 6 Lint/NonLocalExitFromIterator: Exclude: - 'app/controllers/api/base_controller.rb' - - 'app/models/concerns/facets/model_extensions_base.rb' - 'app/services/compute_resource_host_importer.rb' - 'app/services/foreman/deprecation.rb' - 'app/services/interface_merge.rb' - - 'db/migrate/20170223161638_lock_seeded_roles.rb' - 'test/models/provisioning_template_test.rb' -# Offense count: 61 +# Offense count: 50 # Cop supports --auto-correct. Lint/ParenthesesAsGroupedExpression: Enabled: false +# Offense count: 1 +# Cop supports --auto-correct. +Lint/RedundantCopDisableDirective: + Exclude: + - 'test/factories/bookmark.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Lint/RedundantCopEnableDirective: + Exclude: + - 'app/models/concerns/orchestration.rb' + # Offense count: 4 Lint/ShadowingOuterLocalVariable: Exclude: @@ -96,7 +183,7 @@ Lint/ShadowingOuterLocalVariable: - 'test/models/template_test.rb' # Offense count: 4 -# Configuration parameters: AllowComments. +# Configuration parameters: AllowComments, AllowNil. Lint/SuppressedException: Exclude: - 'app/controllers/concerns/find_common.rb' @@ -104,30 +191,22 @@ Lint/SuppressedException: - 'app/models/concerns/orchestration/compute.rb' - 'test/models/hostgroup_test.rb' -# Offense count: 122 +# Offense count: 111 # Cop supports --auto-correct. # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: Enabled: false -# Offense count: 141 +# Offense count: 144 # Cop supports --auto-correct. # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. Lint/UnusedMethodArgument: Enabled: false -# Offense count: 13 -Lint/UriEscapeUnescape: - Exclude: - - 'app/helpers/application_helper.rb' - - 'app/helpers/compute_resources_vms_helper.rb' - - 'test/unit/tasks/interfaces_test.rb' - -# Offense count: 2 +# Offense count: 1 # Cop supports --auto-correct. Lint/UriRegexp: Exclude: - - 'app/models/http_proxy.rb' - 'app/validators/url_schema_validator.rb' # Offense count: 4 @@ -139,19 +218,22 @@ Lint/Void: - 'app/models/nic/base.rb' - 'app/services/name_generator.rb' +# Offense count: 2 +# Cop supports --auto-correct. +Minitest/AssertEmpty: + Exclude: + - 'test/models/user_test.rb' -# Offense count: 26 +# Offense count: 22 # Cop supports --auto-correct. Minitest/AssertEqual: Exclude: - 'test/controllers/api/v2/hosts_controller_test.rb' - - 'test/controllers/api/v2/registration_controller_test.rb' - 'test/controllers/api/v2/template_inputs_controller_test.rb' - 'test/controllers/api/v2/users_controller_test.rb' - 'test/controllers/audits_controller_test.rb' - 'test/controllers/common_parameters_controller_test.rb' - 'test/controllers/domains_controller_test.rb' - - 'test/controllers/environments_controller_test.rb' - 'test/controllers/hosts_controller_test.rb' - 'test/controllers/realms_controller_test.rb' - 'test/controllers/users_controller_test.rb' @@ -160,7 +242,7 @@ Minitest/AssertEqual: - 'test/models/operatingsystem_test.rb' - 'test/models/shared/taxonomies_base_test.rb' -# Offense count: 159 +# Offense count: 139 # Cop supports --auto-correct. Minitest/AssertIncludes: Enabled: false @@ -185,23 +267,16 @@ Minitest/AssertRespondTo: - 'test/models/orchestration_test.rb' - 'test/unit/fact_importer_test.rb' -# Offense count: 49 +# Offense count: 52 # Cop supports --auto-correct. Minitest/AssertTruthy: Enabled: false # Offense count: 13 # Cop supports --auto-correct. -Minitest/GlobalExpectations: - Exclude: - - 'test/unit/net/validations_test.rb' - -# Offense count: 14 -# Cop supports --auto-correct. Minitest/RefuteEmpty: Exclude: - 'test/controllers/api/v2/bookmarks_controller_test.rb' - - 'test/controllers/api/v2/environments_controller_test.rb' - 'test/controllers/api/v2/hostgroups_controller_test.rb' - 'test/controllers/api/v2/hosts_controller_test.rb' - 'test/controllers/api/v2/os_default_templates_controller_test.rb' @@ -210,12 +285,12 @@ Minitest/RefuteEmpty: - 'test/models/template_test.rb' - 'test/unit/net/dhcp_test.rb' -# Offense count: 240 +# Offense count: 219 # Cop supports --auto-correct. Minitest/RefuteFalse: Enabled: false -# Offense count: 40 +# Offense count: 41 # Cop supports --auto-correct. Minitest/RefuteIncludes: Enabled: false @@ -231,18 +306,20 @@ Naming/AccessorMethodName: Enabled: false # Offense count: 2 +# Cop supports --auto-correct. Naming/BinaryOperatorParameterName: Exclude: - 'app/models/host/base.rb' - 'app/registries/foreman/plugin.rb' # Offense count: 21 -# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms. +# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. +# CheckDefinitionPathHierarchyRoots: lib, spec, test, src # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS Naming/FileName: Enabled: false -# Offense count: 15 +# Offense count: 14 # Configuration parameters: ForbiddenDelimiters. # ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$)) Naming/HeredocDelimiterNaming: @@ -250,7 +327,6 @@ Naming/HeredocDelimiterNaming: - 'app/controllers/api/v2/hosts_controller.rb' - 'app/controllers/api/v2/media_controller.rb' - 'lib/foreman/silenced_logger.rb' - - 'lib/tasks/model.rake' - 'lib/tasks/webpack_compile.rake' - 'test/benchmark/benchmark_helper.rb' - 'test/models/lookup_key_test.rb' @@ -267,7 +343,7 @@ Naming/HeredocDelimiterNaming: Naming/MemoizedInstanceVariableName: Enabled: false -# Offense count: 49 +# Offense count: 42 # Configuration parameters: EnforcedStyle, IgnoredPatterns. # SupportedStyles: snake_case, camelCase Naming/MethodName: @@ -278,7 +354,6 @@ Naming/MethodName: - 'app/models/concerns/orchestration/puppetca.rb' - 'app/models/concerns/orchestration/ssh_provision.rb' - 'app/models/concerns/orchestration/tftp.rb' - - 'app/models/environment.rb' - 'app/models/host/managed.rb' - 'app/models/hostgroup.rb' - 'app/services/proxy_api/tftp.rb' @@ -286,15 +361,14 @@ Naming/MethodName: - 'test/controllers/api/v2/table_preferences_controller_test.rb' - 'test/helpers/fact_values_helper_test.rb' - 'test/models/orchestration_test.rb' - - 'test/models/setting_test.rb' -# Offense count: 152 +# Offense count: 147 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to Naming/MethodParameterName: Enabled: false -# Offense count: 39 +# Offense count: 43 # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. # NamePrefix: is_, has_, have_ # ForbiddenPrefixes: is_, has_, have_ @@ -303,32 +377,29 @@ Naming/MethodParameterName: Naming/PredicateName: Enabled: false -# Offense count: 60 +# Offense count: 58 # Cop supports --auto-correct. # Configuration parameters: PreferredName. Naming/RescuedExceptionsVariableName: Enabled: false -# Offense count: 42 -# Configuration parameters: EnforcedStyle. -# SupportedStyles: snake_case, normalcase, non_integer -Naming/VariableNumber: - Exclude: - - 'test/controllers/api/v2/domains_controller_test.rb' - - 'test/controllers/api/v2/hostgroups_controller_test.rb' - - 'test/controllers/api/v2/locations_controller_test.rb' - - 'test/controllers/api/v2/operatingsystems_controller_test.rb' - - 'test/controllers/api/v2/organizations_controller_test.rb' - - 'test/controllers/api/v2/subnets_controller_test.rb' - - 'test/integration/org_admin_js_test.rb' - - 'test/models/host_test.rb' - - 'test/unit/plugin/rbac_registry_test.rb' - - 'test/unit/ui_notifications/rss_notifications_checker_test.rb' - -# Offense count: 18 +# Offense count: 15 # Configuration parameters: MinSize. Performance/CollectionLiteralInLoop: - Enabled: false + Exclude: + - 'app/controllers/api/base_controller.rb' + - 'app/controllers/concerns/foreman/controller/auto_complete_search.rb' + - 'app/models/concerns/audit_extensions.rb' + - 'app/models/concerns/facets/model_extensions_base.rb' + - 'app/models/concerns/nested_ancestry_common.rb' + - 'app/models/concerns/orchestration/compute.rb' + - 'app/services/graphql_attribute.rb' + - 'app/services/tax_host.rb' + - 'db/seeds.d/150-bookmarks.rb' + - 'test/benchmark/puppet_fact_importer_benchmark.rb' + - 'test/benchmark/puppet_fact_parser_interfaces.rb' + - 'test/controllers/provisioning_templates_controller_test.rb' + - 'test/factories/smart_proxy.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -345,39 +416,38 @@ Rails/ApplicationController: - 'app/controllers/api/graphql_controller.rb' - 'test/controllers/concerns/application_shared_test.rb' -# Offense count: 184 +# Offense count: 162 # Cop supports --auto-correct. # Configuration parameters: Include. # Include: **/test/**/* Rails/AssertNot: Enabled: false -# Offense count: 101 +# Offense count: 1 # Cop supports --auto-correct. -Rails/ContentTag: - Enabled: false +# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent. +Rails/Blank: + Exclude: + - 'app/models/compute_resources/foreman/model/ovirt.rb' -# Offense count: 28 +# Offense count: 25 # Configuration parameters: Include. # Include: db/migrate/*.rb Rails/CreateTableWithTimestamps: Enabled: false -# Offense count: 10 -# Configuration parameters: EnforcedStyle. +# Offense count: 6 +# Configuration parameters: EnforcedStyle, AllowToTime. # SupportedStyles: strict, flexible Rails/Date: Exclude: - 'app/controllers/concerns/foreman/controller/csv_responder.rb' - - 'app/models/report_composer.rb' - 'app/models/report_template.rb' - - 'app/services/host_fact_importer.rb' - - 'app/services/ui_notifications/clean_expired.rb' - 'test/controllers/concerns/csv_responder_test.rb' - 'test/controllers/report_templates_controller_test.rb' - 'test/models/report_template_test.rb' -# Offense count: 557 +# Offense count: 444 # Cop supports --auto-correct. # Configuration parameters: Whitelist, AllowedMethods, AllowedReceivers. # Whitelist: find_by_sql @@ -386,13 +456,13 @@ Rails/Date: Rails/DynamicFindBy: Enabled: false -# Offense count: 41 +# Offense count: 44 # Configuration parameters: EnforcedStyle. # SupportedStyles: slashes, arguments Rails/FilePath: Enabled: false -# Offense count: 12 +# Offense count: 10 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasAndBelongsToMany: @@ -402,7 +472,6 @@ Rails/HasAndBelongsToMany: - 'app/models/operatingsystem.rb' - 'app/models/provisioning_template.rb' - 'app/models/ptable.rb' - - 'app/models/puppetclass.rb' - 'app/models/taxonomies/location.rb' - 'app/models/taxonomies/organization.rb' @@ -412,20 +481,19 @@ Rails/HasAndBelongsToMany: Rails/HasManyOrHasOneDependent: Enabled: false -# Offense count: 100 +# Offense count: 98 # Configuration parameters: Include. # Include: app/helpers/**/*.rb Rails/HelperInstanceVariable: Enabled: false -# Offense count: 6 +# Offense count: 5 # Cop supports --auto-correct. Rails/IndexBy: Exclude: - 'app/controllers/concerns/foreman/controller/smart_proxy_auth.rb' - 'app/models/concerns/audit_search.rb' - 'app/models/feature.rb' - - 'app/models/setting.rb' - 'app/services/facets.rb' - 'app/services/structured_fact_importer.rb' @@ -439,13 +507,13 @@ Rails/IndexWith: - 'test/active_support_test_case_helper.rb' - 'test/factories/smart_proxy.rb' -# Offense count: 52 +# Offense count: 51 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/InverseOf: Enabled: false -# Offense count: 13 +# Offense count: 11 # Configuration parameters: Include. # Include: app/controllers/**/*.rb Rails/LexicallyScopedActionFilter: @@ -454,42 +522,37 @@ Rails/LexicallyScopedActionFilter: - 'app/controllers/api/v2/auth_sources_controller.rb' - 'app/controllers/api/v2/base_controller.rb' - 'app/controllers/api/v2/operatingsystems_controller.rb' - - 'app/controllers/concerns/api/v2/lookup_keys_common_controller.rb' - 'app/controllers/concerns/api/v2/taxonomies_controller.rb' - 'app/controllers/concerns/foreman/controller/auto_complete_search.rb' - 'app/controllers/concerns/foreman/controller/set_redirection_path.rb' - 'app/controllers/concerns/foreman/controller/users_mixin.rb' - 'app/controllers/lookup_keys_controller.rb' -# Offense count: 17 +# Offense count: 12 +# Cop supports --auto-correct. # Configuration parameters: Include. # Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb Rails/Output: Exclude: - - 'app/helpers/puppetclasses_and_environments_helper.rb' - 'app/models/concerns/encrypt_value.rb' - 'config/initializers/2_rbvmomi.rb' - - 'config/initializers/apipie.rb' - 'config/initializers/sig_ttin_trap.rb' - - 'config/puma/production.rb' - 'db/seeds.d/035-admin.rb' - 'db/seeds.d/050-taxonomies.rb' -# Offense count: 82 +# Offense count: 80 Rails/OutputSafety: Enabled: false -# Offense count: 14 +# Offense count: 12 # Cop supports --auto-correct. # Configuration parameters: Include. # Include: **/Rakefile, **/*.rake Rails/RakeEnvironment: Exclude: - - 'lib/capistrano/tasks/**/*.rake' - 'lib/tasks/apipie.rake' - 'lib/tasks/encrypt.rake' - 'lib/tasks/fix_cache.rake' - - 'lib/tasks/gettext.rake' - 'lib/tasks/jenkins.rake' - 'lib/tasks/pkg.rake' - 'lib/tasks/plugin_apipie.rake' @@ -514,22 +577,21 @@ Rails/ReflectionClassName: - 'app/models/provisioning_template.rb' - 'app/models/ptable.rb' -# Offense count: 11 +# Offense count: 10 # Configuration parameters: Include. # Include: db/migrate/*.rb Rails/ReversibleMigration: Exclude: - 'db/migrate/20130908170524_add_keys.rb' - - 'db/migrate/20140219183342_change_label_to_title.rb' - 'db/migrate/20180715202514_optimize_indices.rb' -# Offense count: 196 +# Offense count: 159 # Configuration parameters: ForbiddenMethods, AllowedMethods. # ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all Rails/SkipsModelValidations: Enabled: false -# Offense count: 24 +# Offense count: 19 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: strict, flexible @@ -539,7 +601,6 @@ Rails/TimeZone: - 'app/models/host_facets/reported_data_facet.rb' - 'app/models/stored_value.rb' - 'app/models/upgrade_task.rb' - - 'app/services/ping.rb' - 'test/controllers/api/v2/personal_access_tokens_controller_test.rb' - 'test/controllers/api/v2/report_templates_controller_test.rb' - 'test/controllers/unattended_controller_test.rb' @@ -549,17 +610,9 @@ Rails/TimeZone: - 'test/models/stored_value_test.rb' - 'test/models/upgrade_task_test.rb' - 'test/subscribers/foreman/base_subscriber_test.rb' - - 'test/unit/host_fact_importer_test.rb' - -# Offense count: 42 -# Configuration parameters: Include. -# Include: app/models/**/*.rb -Rails/UniqueValidationWithoutIndex: - Enabled: false # Offense count: 8 # Cop supports --auto-correct. -# Configuration parameters: AutoCorrect. Security/JSONLoad: Exclude: - 'app/models/lookup_keys/lookup_key.rb' @@ -568,65 +621,42 @@ Security/JSONLoad: - 'lib/tasks/parameters.rake' - 'test/unit/rabl_test.rb' -# Offense count: 21 +# Offense count: 2 # Cop supports --auto-correct. Security/YAMLLoad: Exclude: - - 'app/models/compute_resources/foreman/model/vmware.rb' - - 'app/models/lookup_keys/lookup_key.rb' - - 'app/models/report.rb' - - 'app/models/setting.rb' - - 'app/services/foreman/importer_puppetclass.rb' - - 'app/services/foreman/parameters/caster.rb' - - 'config/boot_settings.rb' - 'config/settings.rb' - - 'db/migrate/20101019183859_convert_reports.rb' - - 'db/migrate/20140219183343_migrate_permissions.rb' - - 'db/migrate/20150312144232_migrate_websockets_setting.rb' - - 'db/migrate/20190801143210_convert_dns_conflict_timeout_setting.rb' - - 'lib/tasks/parameters.rake' - - 'lib/tasks/puppet.rake' - - 'test/factories/reports_related.rb' -# Offense count: 1 -# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols. -# SupportedStyles: inline, group -Style/AccessModifierDeclarations: - Exclude: - - 'app/services/foreman/observable.rb' - -# Offense count: 203 +# Offense count: 174 # Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle. +# Configuration parameters: EnforcedStyle. # SupportedStyles: nested, compact Style/ClassAndModuleChildren: Enabled: false -# Offense count: 11 +# Offense count: 10 Style/ClassVars: Exclude: - 'app/helpers/templates_helper.rb' - 'app/models/concerns/encrypt_value.rb' - - 'app/models/setting.rb' - 'app/models/template_kind.rb' - 'test/active_support_test_case_helper.rb' -# Offense count: 8 +# Offense count: 6 # Cop supports --auto-correct. -# Configuration parameters: Keywords. -# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW +# Configuration parameters: Keywords, RequireColon. +# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE Style/CommentAnnotation: Exclude: - - 'app/models/environment_class.rb' - 'app/models/lookup_value.rb' - 'app/models/smart_proxy.rb' - 'app/services/facets.rb' - 'config/initializers/apipie.rb' - - 'lib/core_extensions.rb' + - 'test/models/hostgroup_test.rb' - 'test/models/usergroup_test.rb' - - 'test/unit/compute_resource_host_importer_test.rb' -# Offense count: 21 +# Offense count: 16 +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: allowed_in_returns, forbidden Style/DoubleNegation: @@ -640,9 +670,6 @@ Style/DoubleNegation: - 'app/services/foreman/render_templates_from_folder.rb' - 'app/services/foreman/renderer/scope/variables/base.rb' - 'config/application.rb' - - 'db/migrate/20110301154453_add_managed_to_hosts.rb' - - 'db/migrate/20150312144232_migrate_websockets_setting.rb' - - 'lib/foreman/telemetry.rb' - 'test/controllers/api/v2/report_templates_controller_test.rb' - 'test/controllers/report_templates_controller_test.rb' - 'test/factories/disable_auditing.rb' @@ -653,65 +680,98 @@ Style/ExpandPathArguments: Exclude: - 'config.ru' -# Offense count: 162 +# Offense count: 168 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: format, sprintf, percent Style/FormatString: Enabled: false -# Offense count: 393 -# Configuration parameters: EnforcedStyle. +# Offense count: 375 +# Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, IgnoredMethods. # SupportedStyles: annotated, template, unannotated Style/FormatStringToken: Enabled: false -# Offense count: 5 +# Offense count: 3 # Configuration parameters: AllowedVariables. Style/GlobalVars: Exclude: - - 'lib/tasks/errors.rake' - 'lib/tasks/exports.rake' -# Offense count: 186 +# Offense count: 158 # Configuration parameters: MinBodyLength. Style/GuardClause: Enabled: false +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AllowedReceivers. +Style/HashEachMethods: + Exclude: + - 'app/controllers/api/base_controller.rb' + - 'app/controllers/application_controller.rb' + - 'app/controllers/filters_controller.rb' + # Offense count: 2 +# Configuration parameters: MinBranchesCount. +Style/HashLikeCase: + Exclude: + - 'app/controllers/concerns/parameter_attributes.rb' + - 'app/models/concerns/parameter_search.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Style/HashTransformValues: + Exclude: + - 'app/controllers/smart_proxies_controller.rb' + - 'app/models/compute_resources/foreman/model/libvirt.rb' + - 'app/models/concerns/host_params.rb' + - 'app/registries/foreman/plugin/rbac_registry.rb' + - 'app/registries/menu/item.rb' + - 'lib/fog_extensions/vsphere/mini_servers.rb' + +# Offense count: 2 +# Cop supports --auto-correct. Style/IdenticalConditionalBranches: Exclude: - 'app/services/puppet_fact_parser.rb' -# Offense count: 11 +# Offense count: 9 +# Cop supports --auto-correct. # Configuration parameters: AllowIfModifier. Style/IfInsideElse: Exclude: - 'app/controllers/concerns/application_shared.rb' - 'app/controllers/concerns/foreman/controller/smart_proxy_auth.rb' - 'app/controllers/concerns/foreman/controller/taxonomy_multiple.rb' - - 'app/controllers/puppetclasses_controller.rb' - 'app/controllers/users_controller.rb' - 'app/models/concerns/audit_extensions.rb' - - 'app/models/concerns/puppet_host_extensions.rb' - 'app/models/host_status/build_status.rb' - 'app/models/template.rb' - 'config/application.rb' -# Offense count: 58 +# Offense count: 62 # Cop supports --auto-correct. # Configuration parameters: IgnoredMethods. Style/MethodCallWithoutArgsParentheses: Enabled: false -# Offense count: 150 +# Offense count: 4 +Style/MixinUsage: + Exclude: + - 'Rakefile' + - 'config/initializers/1_fast_gettext.rb' + - 'config/initializers/secret_token.rb' + +# Offense count: 157 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: literals, strict Style/MutableConstant: Enabled: false -# Offense count: 22 +# Offense count: 20 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, MinBodyLength. # SupportedStyles: skip_modifier_ifs, always @@ -726,45 +786,58 @@ Style/NumericLiteralPrefix: Exclude: - 'config/initializers/secret_token.rb' -# Offense count: 47 +# Offense count: 57 # Cop supports --auto-correct. # Configuration parameters: Strict. Style/NumericLiterals: MinDigits: 15 -# Offense count: 202 +# Offense count: 195 # Cop supports --auto-correct. # Configuration parameters: PreferredDelimiters. Style/PercentLiteralDelimiters: Enabled: false -# Offense count: 85 +# Offense count: 95 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. +# Configuration parameters: EnforcedStyle, AllowedCompactTypes. # SupportedStyles: compact, exploded Style/RaiseArgs: Enabled: false -# Offense count: 67 +# Offense count: 2 +# Cop supports --auto-correct. +Style/RedundantBegin: + Exclude: + - 'app/controllers/concerns/foreman/controller/registration_commands.rb' + - 'app/services/foreman/preload_scopes_builder.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantRegexpCharacterClass: + Exclude: + - 'script/plugin_webpack_directories.rb' + +# Offense count: 71 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed Style/RegexpLiteral: Enabled: false -# Offense count: 64 +# Offense count: 56 # Cop supports --auto-correct. Style/RescueModifier: Enabled: false -# Offense count: 184 +# Offense count: 178 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: implicit, explicit Style/RescueStandardError: Enabled: false -# Offense count: 8 +# Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: only_raise, only_fail, semantic @@ -775,7 +848,7 @@ Style/SignalException: - 'app/services/facets/entry.rb' - 'lib/foreman/logging.rb' -# Offense count: 8 +# Offense count: 9 # Cop supports --auto-correct. Style/StderrPuts: Exclude: @@ -790,9 +863,9 @@ Style/StructInheritance: - 'app/services/jwt_token.rb' - 'test/models/host_status/global_test.rb' -# Offense count: 100 +# Offense count: 106 # Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. +# Configuration parameters: AllowMethodsWithArguments, IgnoredMethods. # IgnoredMethods: respond_to, define_method Style/SymbolProc: Enabled: false