3scale/porta

View on GitHub

Showing 5,267 of 5,597 total issues

Pdf::Report#traffic_graph_style_axes doesn't depend on instance state (maybe move it to another class?)
Open

    def traffic_graph_style_axes(css)
Severity: Minor
Found in app/lib/pdf/report.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

Pdf::Report#traffic_graph_style_clean_up doesn't depend on instance state (maybe move it to another class?)
Open

    def traffic_graph_style_clean_up(css)
Severity: Minor
Found in app/lib/pdf/report.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

SimpleLayout has missing safe method 'import_pages!'
Open

  def import_pages!
Severity: Minor
Found in app/lib/simple_layout.rb by reek

A candidate method for the Missing Safe Method smell are methods whose names end with an exclamation mark.

An exclamation mark in method names means (the explanation below is taken from here ):

The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name. So, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.

Such a method is called Missing Safe Method if and only if her non-bang version does not exist and this method is reported as a smell.

Example

Given

class C
  def foo; end
  def foo!; end
  def bar!; end
end

Reek would report bar! as Missing Safe Method smell but not foo!.

Reek reports this smell only in a class context, not in a module context in order to allow perfectly legit code like this:

class Parent
  def foo; end
end

module Dangerous
  def foo!; end
end

class Son < Parent
  include Dangerous
end

class Daughter < Parent
end

In this example, Reek would not report the Missing Safe Method smell for the method foo of the Dangerous module.

Pdf::Report#traffic_graph_y_align doesn't depend on instance state (maybe move it to another class?)
Open

    def traffic_graph_y_align(xml)
Severity: Minor
Found in app/lib/pdf/report.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

SimpleLayout has missing safe method 'setup_main_layout!'
Open

  def setup_main_layout!
Severity: Minor
Found in app/lib/simple_layout.rb by reek

A candidate method for the Missing Safe Method smell are methods whose names end with an exclamation mark.

An exclamation mark in method names means (the explanation below is taken from here ):

The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name. So, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.

Such a method is called Missing Safe Method if and only if her non-bang version does not exist and this method is reported as a smell.

Example

Given

class C
  def foo; end
  def foo!; end
  def bar!; end
end

Reek would report bar! as Missing Safe Method smell but not foo!.

Reek reports this smell only in a class context, not in a module context in order to allow perfectly legit code like this:

class Parent
  def foo; end
end

module Dangerous
  def foo!; end
end

class Son < Parent
  include Dangerous
end

class Daughter < Parent
end

In this example, Reek would not report the Missing Safe Method smell for the method foo of the Dangerous module.

SimpleLayout has missing safe method 'create_builtin_partial!'
Open

  def create_builtin_partial!(system_name)
Severity: Minor
Found in app/lib/simple_layout.rb by reek

A candidate method for the Missing Safe Method smell are methods whose names end with an exclamation mark.

An exclamation mark in method names means (the explanation below is taken from here ):

The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name. So, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.

Such a method is called Missing Safe Method if and only if her non-bang version does not exist and this method is reported as a smell.

Example

Given

class C
  def foo; end
  def foo!; end
  def bar!; end
end

Reek would report bar! as Missing Safe Method smell but not foo!.

Reek reports this smell only in a class context, not in a module context in order to allow perfectly legit code like this:

class Parent
  def foo; end
end

module Dangerous
  def foo!; end
end

class Son < Parent
  include Dangerous
end

class Daughter < Parent
end

In this example, Reek would not report the Missing Safe Method smell for the method foo of the Dangerous module.

SimpleLayout has missing safe method 'import!'
Open

  def import! # _all
Severity: Minor
Found in app/lib/simple_layout.rb by reek

A candidate method for the Missing Safe Method smell are methods whose names end with an exclamation mark.

An exclamation mark in method names means (the explanation below is taken from here ):

The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name. So, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.

Such a method is called Missing Safe Method if and only if her non-bang version does not exist and this method is reported as a smell.

Example

Given

class C
  def foo; end
  def foo!; end
  def bar!; end
end

Reek would report bar! as Missing Safe Method smell but not foo!.

Reek reports this smell only in a class context, not in a module context in order to allow perfectly legit code like this:

class Parent
  def foo; end
end

module Dangerous
  def foo!; end
end

class Son < Parent
  include Dangerous
end

class Daughter < Parent
end

In this example, Reek would not report the Missing Safe Method smell for the method foo of the Dangerous module.

Stats::Deprecated#self.usage_in_day performs a nil-check
Open

      raise InvalidParameterError, 'missing :day option' if options[:day].nil?
      raise InvalidParameterError, 'missing :metric option' if options[:metric].nil?
Severity: Minor
Found in app/lib/stats/deprecated.rb by reek

A NilCheck is a type check. Failures of NilCheck violate the "tell, don't ask" principle.

Additionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.

Example

Given

class Klass
  def nil_checker(argument)
    if argument.nil?
      puts "argument isn't nil!"
    end
  end
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [3]:Klass#nil_checker performs a nil-check. (NilCheck)

SimpleLayout has missing safe method 'setup_error_layout!'
Open

  def setup_error_layout!
Severity: Minor
Found in app/lib/simple_layout.rb by reek

A candidate method for the Missing Safe Method smell are methods whose names end with an exclamation mark.

An exclamation mark in method names means (the explanation below is taken from here ):

The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name. So, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.

Such a method is called Missing Safe Method if and only if her non-bang version does not exist and this method is reported as a smell.

Example

Given

class C
  def foo; end
  def foo!; end
  def bar!; end
end

Reek would report bar! as Missing Safe Method smell but not foo!.

Reek reports this smell only in a class context, not in a module context in order to allow perfectly legit code like this:

class Parent
  def foo; end
end

module Dangerous
  def foo!; end
end

class Son < Parent
  include Dangerous
end

class Daughter < Parent
end

In this example, Reek would not report the Missing Safe Method smell for the method foo of the Dangerous module.

Stats::KeyHelpers#decode_key doesn't depend on instance state (maybe move it to another class?)
Open

    def decode_key(key)
Severity: Minor
Found in app/lib/stats/key_helpers.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

SimpleLayout has missing safe method 'update_error_layout!'
Open

  def update_error_layout!(error_layout)
Severity: Minor
Found in app/lib/simple_layout.rb by reek

A candidate method for the Missing Safe Method smell are methods whose names end with an exclamation mark.

An exclamation mark in method names means (the explanation below is taken from here ):

The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name. So, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.

Such a method is called Missing Safe Method if and only if her non-bang version does not exist and this method is reported as a smell.

Example

Given

class C
  def foo; end
  def foo!; end
  def bar!; end
end

Reek would report bar! as Missing Safe Method smell but not foo!.

Reek reports this smell only in a class context, not in a module context in order to allow perfectly legit code like this:

class Parent
  def foo; end
end

module Dangerous
  def foo!; end
end

class Son < Parent
  include Dangerous
end

class Daughter < Parent
end

In this example, Reek would not report the Missing Safe Method smell for the method foo of the Dangerous module.

SimpleLayout#update_error_layout! doesn't depend on instance state (maybe move it to another class?)
Open

  def update_error_layout!(error_layout)
Severity: Minor
Found in app/lib/simple_layout.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

Stats::Views::Csv::TopApplications#filename doesn't depend on instance state (maybe move it to another class?)
Open

        def filename

A Utility Function is any instance method that has no dependency on the state of the instance.

Stats::Views::UsageHack#storage performs a nil-check
Open

    raise NoStorageException if @storage.nil?
Severity: Minor
Found in app/lib/stats/views/usage_hack.rb by reek

A NilCheck is a type check. Failures of NilCheck violate the "tell, don't ask" principle.

Additionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.

Example

Given

class Klass
  def nil_checker(argument)
    if argument.nil?
      puts "argument isn't nil!"
    end
  end
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [3]:Klass#nil_checker performs a nil-check. (NilCheck)

ThreeScale::Diff#chunked doesn't depend on instance state (maybe move it to another class?)
Open

    def chunked(what)
Severity: Minor
Found in app/lib/three_scale/diff.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

Logic::Contracting::Provider#find_or_create_service_contract performs a nil-check
Open

          if service_plan.nil? && service.service_plans.first
Severity: Minor
Found in app/lib/logic/contracting.rb by reek

A NilCheck is a type check. Failures of NilCheck violate the "tell, don't ask" principle.

Additionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.

Example

Given

class Klass
  def nil_checker(argument)
    if argument.nil?
      puts "argument isn't nil!"
    end
  end
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [3]:Klass#nil_checker performs a nil-check. (NilCheck)

PaymentGateways::BrainTreeBlueCrypt#errors doesn't depend on instance state (maybe move it to another class?)
Open

    def errors(result)

A Utility Function is any instance method that has no dependency on the state of the instance.

Pdf::Report#report is a writable attribute
Open

    attr_accessor :account, :period, :pdf, :service, :report
Severity: Minor
Found in app/lib/pdf/report.rb by reek

A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.

The same holds to a lesser extent for getters, but Reek doesn't flag those.

Example

Given:

class Klass
  attr_accessor :dummy
end

Reek would emit the following warning:

reek test.rb

test.rb -- 1 warning:
  [2]:Klass declares the writable attribute dummy (Attribute)

Stats::Views::Usage#usage performs a nil-check
Open

        unless @cinstance.nil?
Severity: Minor
Found in app/lib/stats/views/usage.rb by reek

A NilCheck is a type check. Failures of NilCheck violate the "tell, don't ask" principle.

Additionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.

Example

Given

class Klass
  def nil_checker(argument)
    if argument.nil?
      puts "argument isn't nil!"
    end
  end
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [3]:Klass#nil_checker performs a nil-check. (NilCheck)

Messenger::MessageLiquidizer#infer_drop_class doesn't depend on instance state (maybe move it to another class?)
Open

    def infer_drop_class(value)

A Utility Function is any instance method that has no dependency on the state of the instance.

Severity
Category
Status
Source
Language