Flockingbird/roost

View on GitHub

Showing 37 of 76 total issues

RequestHelpers has no descriptive comment
Open

module RequestHelpers
Severity: Minor
Found in test/support/request_helpers.rb by reek

Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.

Example

Given

class Dummy
  # Do things...
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [1]:Dummy has no descriptive comment (IrresponsibleModule)

Fixing this is simple - just an explaining comment:

# The Dummy class is responsible for ...
class Dummy
  # Do things...
end

Minitest::Spec has no descriptive comment
Open

  class Spec
Severity: Minor
Found in test/test_helper.rb by reek

Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.

Example

Given

class Dummy
  # Do things...
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [1]:Dummy has no descriptive comment (IrresponsibleModule)

Fixing this is simple - just an explaining comment:

# The Dummy class is responsible for ...
class Dummy
  # Do things...
end

Minitest::WebSpec has no descriptive comment
Open

  class WebSpec < Spec
Severity: Minor
Found in test/test_helper.rb by reek

Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.

Example

Given

class Dummy
  # Do things...
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [1]:Dummy has no descriptive comment (IrresponsibleModule)

Fixing this is simple - just an explaining comment:

# The Dummy class is responsible for ...
class Dummy
  # Do things...
end

TimeHelpers#die_wende doesn't depend on instance state (maybe move it to another class?)
Open

  def die_wende
Severity: Minor
Found in test/support/time_helpers.rb by reek

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

EventHelpers#event_store doesn't depend on instance state (maybe move it to another class?)
Open

  def event_store
Severity: Minor
Found in test/support/event_helpers.rb by reek

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

Reactors::InvitationMailer#subject doesn't depend on instance state (maybe move it to another class?)
Open

    def subject(inviter)
Severity: Minor
Found in app/reactors/invitation_mailer.rb by reek

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

Workflows::TagsMember#steps doesn't depend on instance state (maybe move it to another class?)
Open

    def steps
Severity: Minor
Found in test/support/workflows/tags_member.rb by reek

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

Aggregates::Member::Tag#== performs a nil-check
Open

        return if other.nil?
Severity: Minor
Found in app/aggregates/member/tag.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)

RequestHelpers#secret doesn't depend on instance state (maybe move it to another class?)
Open

  def secret
Severity: Minor
Found in test/support/request_helpers.rb by reek

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

Roost::Config#database_url is a writable attribute
Open

    attr_accessor :database_url, :secret_base, :web_url
Severity: Minor
Found in config/environment.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)

Roost::Config#web_url is a writable attribute
Open

    attr_accessor :database_url, :secret_base, :web_url
Severity: Minor
Found in config/environment.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)

Reactors::InvitationMailer#from doesn't depend on instance state (maybe move it to another class?)
Open

    def from(inviter)
Severity: Minor
Found in app/reactors/invitation_mailer.rb by reek

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

Aggregates::Member::TagList inherits from core class 'Array'
Open

    class TagList < Array
Severity: Minor
Found in app/aggregates/member/tag_list.rb by reek

Subclassing core classes in Ruby can lead to unexpected side effects.

Knowing that Ruby has a core library, which is written in C, and a standard library, which is written in Ruby, if you do not know exactly how these core classes operate at the C level, you are gonna have a bad time.

Source: http://words.steveklabnik.com/beware-subclassing-ruby-core-classes

Roost::Config#secret_base is a writable attribute
Open

    attr_accessor :database_url, :secret_base, :web_url
Severity: Minor
Found in config/environment.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)

Workflows::MemberRegisters#steps doesn't depend on instance state (maybe move it to another class?)
Open

    def steps

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

DataHelpers#fixtures doesn't depend on instance state (maybe move it to another class?)
Open

  def fixtures(file)
Severity: Minor
Found in test/support/data_helpers.rb by reek

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

Complex method Web::TagsController::post#/tags (20.5)
Open

    post '/tags' do
      requires_authorization

      Commands.handle(
        'Profile',

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Severity
Category
Status
Source
Language