lujanfernaud/prevy

View on GitHub
app/decorators/application_decorator.rb

Summary

Maintainability
A
0 mins
Test Coverage

ApplicationDecorator has no descriptive comment
Open

class ApplicationDecorator < SimpleDelegator

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

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

    def h

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

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

    def url

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

ApplicationDecorator#h has the name 'h'
Open

    def h

An Uncommunicative Method Name is a method name that doesn't communicate its intent well enough.

Poor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.

Inconsistent indentation detected.
Open

    def h
      ActionController::Base.helpers
    end

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Inconsistent indentation detected.
Open

    def url
      Rails.application.routes.url_helpers
    end

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Missing top-level class documentation comment.
Open

class ApplicationDecorator < SimpleDelegator

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

There are no issues that match your filters.

Category
Status