3scale/porta

View on GitHub

Showing 5,267 of 5,597 total issues

path_to calls 'Service.find_by(name: $2)' 4 times
Open

      product = Service.find_by(name: $2) || @product || @service || provider_first_service!
      admin_service_application_plans_path(product)

    when /^(product "(.*)"|the product's) new application plan admin page$/
      product = Service.find_by(name: $2) || @product || @service || provider_first_service!
Severity: Minor
Found in features/support/paths.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

TimeMachineHelpers#time_flies_to calls 'Time.zone' 3 times
Open

    time_machine(Time.zone.parse(date))
    assert_equal Time.zone.parse(date).beginning_of_hour, Time.zone.now.beginning_of_hour

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

RemovingBcmsTables#self.down calls 't.text "headers"' 2 times
Open

      t.text     "headers"
      t.string   "notes"
      t.integer  "tenant_id",       :limit => 8
    end
    add_index "dynamic_view_versions", ["account_id"], :name => "index_dynamic_view_versions_on_account_id"

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

path_to calls '@provider.default_service' 2 times
Open

      admin_service_metrics_path(@provider.default_service)
    when 'the metrics and methods page of my backend api'
      provider_admin_backend_api_metrics_path(@provider.default_service.backend_api)
Severity: Minor
Found in features/support/paths.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

path_to calls 'AuthenticationProvider.last' 3 times
Open

      auth_provider = AuthenticationProvider.last
      provider_admin_account_authentication_provider_path(auth_provider)
    when 'the new sso integration page'
      new_provider_admin_account_authentication_provider_path
    when 'the edit rh sso integration page'
Severity: Minor
Found in features/support/paths.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

selector_for_table_row_with_cells calls 'XPath.generate' 2 times
Open

    tds = cells.map{|cell| XPath.generate { |x| x.child(:td)[x.string.contains(cell)] } }.reduce(:+)
    XPath.generate { |x| x.anywhere[ tds ] }.to_s
Severity: Minor
Found in features/support/tables.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

RemovingBcmsTables#self.down calls 't.string "slug"' 2 times
Open

      t.string   "slug"
      t.text     "summary"
      t.text     "body"
      t.integer  "comments_count"
      t.datetime "published_at"

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

path_to calls '@provider.api_docs_services.find_by!(name: $1)' 2 times
Open

      spec = $1.present? ? @provider.api_docs_services.find_by!(name: $1) : @api_docs_service
      edit_admin_api_docs_service_path(spec)

    when /the product's ActiveDocs page/
      admin_service_api_docs_path(@product)
Severity: Minor
Found in features/support/paths.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

path_to calls 'Regexp.last_match(1)' 2 times
Open

      message = @provider.sent_messages.find_by(subject: Regexp.last_match(1))
      provider_admin_messages_outbox_path(message)

    when "the outbox compose page"
      new_provider_admin_messages_outbox_path
Severity: Minor
Found in features/support/paths.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

TimeMachineHelpers#time_flies_to calls 'Time.zone.parse(date)' 2 times
Open

    time_machine(Time.zone.parse(date))
    assert_equal Time.zone.parse(date).beginning_of_hour, Time.zone.now.beginning_of_hour

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

BraintreeData has initialize method
Open

module BraintreeData
Severity: Minor
Found in lib/active_merchant_hacks.rb by reek

A module is usually a mixin, so when an #initialize method is present it is hard to tell initialization order and parameters so having #initialize in a module is usually a bad idea.

Example

The Foo module below contains a method initialize. Although class B inherits from A, the inclusion of Foo stops A#initialize from being called.

class A
  def initialize(a)
    @a = a
  end
end

module Foo
  def initialize(foo)
    @foo = foo
  end
end

class B < A
  include Foo

  def initialize(b)
    super('bar')
    @b = b
  end
end

A simple solution is to rename Foo#initialize and call that method by name:

module Foo
  def setup_foo_module(foo)
    @foo = foo
  end
end

class B < A
  include Foo

  def initialize(b)
    super 'bar'
    setup_foo_module('foo')
    @b = b
  end
end

DeveloperPortal::Admin::Account::AuthorizeNetController#assign_token calls 'site_account.payment_gateway.options' 2 times
Open

                 login: site_account.payment_gateway.options[:login],
                 trans_key: site_account.payment_gateway.options[:password],

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

RemoveStreams#self.down calls 't.integer "tag_id"' 2 times
Open

      t.integer  "tag_id"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.boolean  "published",          :default => false
      t.boolean  "deleted",            :default => false

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

RemovingBcmsTables#self.down calls 't.integer "created_by_id", :limit => 8' 21 times
Open

      t.integer  "created_by_id",   :limit => 8
      t.integer  "updated_by_id",   :limit => 8
      t.integer  "account_id",      :limit => 8
      t.integer  "tenant_id",       :limit => 8
    end

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

RemovingBcmsTables#self.down calls 't.string "file_path"' 2 times
Open

      t.string   "file_path"
      t.string   "file_location"
      t.string   "file_extension"
      t.string   "file_type"
      t.integer  "file_size"

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

RemovingBcmsTables#self.down calls 't.string "url"' 5 times
Open

      t.string   "url"
      t.text     "description"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.integer  "position"

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

RemovingBcmsTables#self.down calls 't.text "content", :limit => 2147483647' 2 times
Open

      t.text     "content",             :limit => 2147483647
      t.boolean  "published",                                 :default => false
      t.boolean  "deleted",                                   :default => false
      t.boolean  "archived",                                  :default => false
      t.string   "version_comment"

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

path_to calls 'account.messages.build(body: 'foo', subject: 'bar')' 2 times
Open

      message = account.messages.build(body: 'foo', subject: 'bar')
      message.to current_account
      message.deliver
      admin_messages_inbox_path(message.recipients[0])

Severity: Minor
Found in features/support/paths.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

PlanHelpers#create_plan calls 'options[:cost]' 3 times
Open

    options[:cost] ||= 0

    issuer = options[:issuer]

    case type.to_sym
Severity: Minor
Found in features/support/plan_helpers.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

Unused#print_summary calls 'key.file_colon_line' 2 times
Open

        puts "#{key.file_colon_line} (#{key.regexp_source})"
        file, start = key.file_colon_line.split(':')
Severity: Minor
Found in features/support/unused.rb by reek

Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.

Reek implements a check for Duplicate Method Call.

Example

Here's a very much simplified and contrived example. The following method will report a warning:

def double_thing()
  @other.thing + @other.thing
end

One quick approach to silence Reek would be to refactor the code thus:

def double_thing()
  thing = @other.thing
  thing + thing
end

A slightly different approach would be to replace all calls of double_thing by calls to @other.double_thing:

class Other
  def double_thing()
    thing + thing
  end
end

The approach you take will depend on balancing other factors in your code.

Severity
Category
Status
Source
Language